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

JavaScript tracker fails on Firefox with "Always ask" setting for cookies #163

Closed
alexanderdean opened this issue Feb 12, 2013 · 4 comments
Assignees
Milestone

Comments

@alexanderdean
Copy link
Member

With "ask me every time" set for site cookies:

Capture

the JavaScript tracker fails to execute with "SecurityError: The operation is insecure".

Some related posts around the internet:

To fix this: we need to run the un-minified version on Firefox and dive into the error line.

@ghost ghost assigned alexanderdean Feb 12, 2013
@featureless
Copy link

To resolve this I added this function :

var storageCheck = function(){
try {
window.sessionStorage.setItem('History.test',true);
} catch (e) {
return false;
}
window.sessionStorage.removeItem('History.test');
return true;
};

And replaced:
sessionStorage = window.sessionStorage||false
by
sessionStorage = (storageCheck())?(window.sessionStorage||false):false

@alexanderdean
Copy link
Member Author

Awesome - big thanks for sharing @featureless !

Scheduling to add that into the next release (which is a JavaScript-centric release)!

@alexanderdean
Copy link
Member Author

Update: error is on line (when snowpak'ed without compression) 2468:

!!window.sessionStorage,

@alexanderdean
Copy link
Member Author

Implemented as part of 0.8.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants