Skip to content

Commit 02b9ea9

Browse files
febbraroTooTallNate
authored andcommitted
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
1 parent 1ad1e4a commit 02b9ea9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/browser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function save(namespaces) {
126126
if (null == namespaces) {
127127
exports.storage.removeItem('debug');
128128
} else {
129-
exports.storage.debug = namespaces;
129+
exports.storage.setItem('debug', namespaces);
130130
}
131131
} catch(e) {}
132132
}
@@ -141,7 +141,7 @@ function save(namespaces) {
141141
function load() {
142142
var r;
143143
try {
144-
r = exports.storage.debug;
144+
r = exports.storage.getItem('debug');
145145
} catch(e) {}
146146

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

166166
function localstorage() {
167167
try {
168-
return window.localStorage;
168+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
169+
// The Browser also has localStorage in the global context.
170+
return localStorage;
169171
} catch (e) {}
170172
}
171173

0 commit comments

Comments
 (0)