Given this code here:
|
<script type="module"> |
|
import { Workbox } from <?php echo wp_json_encode( $workbox_window_src ); ?>; |
|
|
|
if ( 'serviceWorker' in navigator ) { |
|
window.wp = window.wp || {}; |
|
window.wp.serviceWorkerWindow = new Workbox( |
|
<?php echo wp_json_encode( $sw_src ); ?>, |
|
<?php echo wp_json_encode( $register_options ); ?> |
|
); |
|
window.wp.serviceWorkerWindow.register(); |
|
} |
|
</script> |
The lack of wp_print_inline_script_tag() means that CSP nonce attribute cannot be injected.
Related: #1241
Given this code here:
pwa-wp/wp-includes/service-workers.php
Lines 184 to 195 in f2a0ad4
The lack of
wp_print_inline_script_tag()means that CSPnonceattribute cannot be injected.Related: #1241