Skip to content

Commit

Permalink
Merge 7a5a90b into 1ad1e4a
Browse files Browse the repository at this point in the history
  • Loading branch information
febbraro committed Jun 21, 2018
2 parents 1ad1e4a + 7a5a90b commit a1dfc7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/browser.js
Expand Up @@ -126,7 +126,7 @@ function save(namespaces) {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
exports.storage.setItem('debug', namespaces);
}
} catch(e) {}
}
Expand All @@ -141,7 +141,7 @@ function save(namespaces) {
function load() {
var r;
try {
r = exports.storage.debug;
r = exports.storage.getItem('debug');
} catch(e) {}

// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
Expand All @@ -165,7 +165,9 @@ function load() {

function localstorage() {
try {
return window.localStorage;
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
// The Browser also has localStorage in the global context.
return localStorage;
} catch (e) {}
}

Expand Down

0 comments on commit a1dfc7a

Please sign in to comment.