Changeset 3435666
- Timestamp:
- 01/09/2026 07:11:45 AM (2 months ago)
- File:
-
- 1 edited
-
notification-button/trunk/index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
notification-button/trunk/index.php
r3435655 r3435666 36 36 */ 37 37 add_action('template_redirect', function() { 38 if (get_query_var('ntbutton_sw')) { 39 header('Content-Type: application/javascript; charset=utf-8'); 40 // Service-Worker-Allowed header is required for cross-path scope 41 header('Service-Worker-Allowed: /'); 42 echo "importScripts('https://notificationbutton.com/assets/files/serviceWorkerContain.min.js');"; 43 exit; 44 } 38 if (get_query_var('ntbutton_sw')) { 39 // Prevent WordPress from adding a trailing slash to this URL 40 remove_filter('redirect_canonical', 'redirect_canonical'); 41 42 header('Content-Type: application/javascript; charset=utf-8'); 43 header('Service-Worker-Allowed: /'); 44 echo "importScripts('https://notificationbutton.com/assets/files/serviceWorkerContain.min.js');"; 45 exit; 46 } 45 47 }); 46 48
Note: See TracChangeset
for help on using the changeset viewer.