You are here

function hook_pwa_cache_urls_assets_alter in Progressive Web App 8

Same name and namespace in other branches
  1. 2.x pwa.api.php \hook_pwa_cache_urls_assets_alter()

Alters cached assets urls list for the service worker file.

This hook allows altering the list of asset URLs to cache on install.

Parameters

array &$resources: List of asset URLs to cache.

See also

hook_pwa_cache_urls_assets_page_alter()

1 invocation of hook_pwa_cache_urls_assets_alter()
PWAController::_pwa_fetch_offline_page_resources in src/Controller/PWAController.php
Fetch all resources.

File

./pwa.api.php, line 72
Hooks provided by the Progressive Web App module.

Code

function hook_pwa_cache_urls_assets_alter(&$resources) {
  $module_path = drupal_get_path('module', 'pwa');
  $resources[] = "/{$module_path}/assets/loading.gif";
}