guard against DOMException when checking for a weird cookie parameter
This commit is contained in:
parent
15cf523144
commit
5dbff0709f
1 changed files with 5 additions and 4 deletions
|
@ -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…
Reference in a new issue