Changeset 3435679
- Timestamp:
- 01/09/2026 07:34:05 AM (2 months ago)
- File:
-
- 1 edited
-
notification-button/trunk/index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
notification-button/trunk/index.php
r3435666 r3435679 37 37 add_action('template_redirect', function() { 38 38 if (get_query_var('ntbutton_sw')) { 39 // Prevent WordPress from adding a trailing slash to this URL 39 // This is the key: stop WordPress from redirecting or adding slashes 40 status_header(200); 41 header('Content-Type: application/javascript; charset=utf-8'); 42 header('Service-Worker-Allowed: /'); 43 44 // Disable canonical redirect for this specific request 40 45 remove_filter('redirect_canonical', 'redirect_canonical'); 41 42 header('Content-Type: application/javascript; charset=utf-8'); 43 header('Service-Worker-Allowed: /'); 46 44 47 echo "importScripts('https://notificationbutton.com/assets/files/serviceWorkerContain.min.js');"; 45 48 exit; 46 49 } 47 } );50 }, 1); 48 51 49 52 /**
Note: See TracChangeset
for help on using the changeset viewer.