Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
Move window.sessionStorage into try catch block.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanek committed Nov 1, 2013
1 parent b41ab65 commit d5894b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion js/hopscotch-0.1.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@
waitingToStart = false, // is a tour waiting for the document to finish
// loading so that it can start?
hasJquery = (typeof window.jQuery !== undefinedStr),
hasSessionStorage = (typeof window.sessionStorage !== undefinedStr),
hasSessionStorage = false,
document = window.document;

// If cookies are disabled, accessing sessionStorage can throw an error.
try {
hasSessionStorage = (typeof window.sessionStorage !== undefinedStr);
} catch (err) {}

defaultOpts = {
smoothScroll: true,
scrollDuration: 1000,
Expand Down
Loading

0 comments on commit d5894b2

Please sign in to comment.