Skip to content

Commit

Permalink
Remove todo for load event since part of workbox-window
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Aug 23, 2021
1 parent 26b1323 commit 495d806
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wp-includes/service-workers.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ function wp_print_service_workers() {
return;
}

$workbox_window_src = sprintf( '%s/wp-includes/js/workbox-v%s/workbox-window.%s.js', PWA_PLUGIN_URL, PWA_WORKBOX_VERSION, SCRIPT_DEBUG ? 'dev' : 'prod' );
$workbox_window_src = sprintf(
'%s/wp-includes/js/workbox-v%s/workbox-window.%s.js',
PWA_PLUGIN_URL,
PWA_WORKBOX_VERSION,
SCRIPT_DEBUG ? 'dev' : 'prod'
);
$register_options = array(
'scope' => $scope,
);
Expand All @@ -177,7 +182,6 @@ function wp_print_service_workers() {
<script type="module">
import { Workbox } from <?php echo wp_json_encode( $workbox_window_src ); ?>;

// @todo Defer to load event?
if ( 'serviceWorker' in navigator ) {
window.wp = window.wp || {};
window.wp.serviceWorkerWindow = new Workbox(
Expand Down

0 comments on commit 495d806

Please sign in to comment.