Commit 5be580a8 authored by Morgan Bazalgette's avatar Morgan Bazalgette Committed by Haelwenn

Default when there is no applicationServerKey meta on the page

parent 0733870f
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment