Default when there is no applicationServerKey meta on the page
This commit is contained in:
parent
a915aca1db
commit
882d44afdf
2 changed files with 8 additions and 2 deletions
|
@ -18,7 +18,10 @@ const urlBase64ToUint8Array = (base64String) => {
|
|||
return outputArray;
|
||||
};
|
||||
|
||||
const getApplicationServerKey = () => document.querySelector('[name="applicationServerKey"]').getAttribute('content');
|
||||
const getApplicationServerKey = () => {
|
||||
const k = document.querySelector('[name="applicationServerKey"]');
|
||||
return k === null ? '' : k.getAttribute('content');
|
||||
};
|
||||
|
||||
const getRegistration = () => navigator.serviceWorker.ready;
|
||||
|
||||
|
|
|
@ -14,7 +14,10 @@ const urlBase64ToUint8Array = (base64String) => {
|
|||
return decodeBase64(base64);
|
||||
};
|
||||
|
||||
const getApplicationServerKey = () => document.querySelector('[name="applicationServerKey"]').getAttribute('content');
|
||||
const getApplicationServerKey = () => {
|
||||
const k = document.querySelector('[name="applicationServerKey"]');
|
||||
return k === null ? '' : k.getAttribute('content');
|
||||
};
|
||||
|
||||
const getRegistration = () => navigator.serviceWorker.ready;
|
||||
|
||||
|
|
Loading…
Reference in a new issue