guard against DOMException when checking for a weird cookie parameter

pull/1/head
ansuz 3 years ago
parent 15cf523144
commit 5dbff0709f

@ -153,8 +153,9 @@ define([], function () {
out.registerInner = function () { }; out.registerInner = function () { };
out.registerOuter = function () { }; out.registerOuter = function () { };
if (document.cookie.indexOf('test=') === 0) {
try { try {
if (document.cookie.indexOf('test=') === 0) {
var x = JSON.parse(decodeURIComponent(document.cookie.replace('test=', ''))); var x = JSON.parse(decodeURIComponent(document.cookie.replace('test=', '')));
if (x.test === 'auto') { if (x.test === 'auto') {
out.options = x.opts; out.options = x.opts;
@ -165,8 +166,8 @@ define([], function () {
enableManual(); enableManual();
console.log("Enable manual testing " + window.origin); console.log("Enable manual testing " + window.origin);
} }
} catch (e) { }
} }
} catch (e) { }
return out; return out;
}); });

Loading…
Cancel
Save