Skip to content

Commit

Permalink
fix(debugging): fix DOMException: Failed to read the 'sessionStorage'
Browse files Browse the repository at this point in the history
close issue prebid#8934
  • Loading branch information
fasenderos authored Sep 1, 2022
1 parent 0827e2b commit 3e12f6e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/debugging.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,22 @@ export function debuggingControls({load = debuggingModuleLoader(), hook = getHoo
const ctl = debuggingControls();
export const reset = ctl.reset;

export function loadSession({storage = window.sessionStorage, debugging = ctl} = {}) {
let config = null;
export function loadSession() {
let storage = null;
try {
config = storage.getItem(DEBUG_KEY);
storage = window.sessionStorage;
} catch (e) {}
if (config != null) {
// just make sure the module runs; it will take care of parsing the config (and disabling itself if necessary)
debugging.enable();

if (storage !== null) {
let debugging = ctl;
let config = null;
try {
config = storage.getItem(DEBUG_KEY);
} catch (e) {}
if (config !== null) {
// just make sure the module runs; it will take care of parsing the config (and disabling itself if necessary)
debugging.enable();
}
}
}

Expand Down

0 comments on commit 3e12f6e

Please sign in to comment.