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 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ function load() {
function localstorage() {
try {
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
if (typeof window === 'undefined' && typeof navigationDocument !== 'undefined') {
return localStorage;
}

return window.localStorage;
// The Browser also has localStorage in the global context.
return localStorage;
} catch (e) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This try/catch is now unnecessary, isn't it? cc @TooTallNate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old versions of IE don't support local storage, so this would throw when attempting to access it.

}

Expand Down