Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding TVMLKit support #579

Merged
merged 2 commits into from Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/browser.js
Expand Up @@ -129,7 +129,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 @@ -144,7 +144,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 @@ -168,7 +168,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