Skip to content

Commit

Permalink
Add query param in a safe way
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Feb 11, 2022
1 parent 4bc140d commit 3bdc8d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/admin-manifest/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import { addQueryArgs } from '@wordpress/url';

function addManifest( manifest ) {
const link = document.createElement( 'link' );
link.rel = 'manifest';
Expand Down Expand Up @@ -164,6 +169,8 @@ window.addEventListener( 'load', () => {
),
] ).then( () => {
addManifest( manifest );
window.navigator.serviceWorker.register( adminUrl + '?service-worker' );
window.navigator.serviceWorker.register(
addQueryArgs( adminUrl, { 'service-worker': true } )
);
} );
} );

0 comments on commit 3bdc8d1

Please sign in to comment.