Skip to content
Permalink
Browse files
Add TVMLKit support (#579)
* Adding TVMLKit support

* removed the check for window/navigationDocument, instead relying on localStorage in the global context on all 'browser' based platforms
  • Loading branch information
febbraro authored and TooTallNate committed Jun 21, 2018
1 parent 1ad1e4a commit 02b9ea9fd7ec95c42de47da13b4b6bb8e50025d8
Showing 1 changed file with 5 additions and 3 deletions.
@@ -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) {}
}
@@ -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
@@ -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) {}
}

0 comments on commit 02b9ea9

Please sign in to comment.