Firefox test suite issue

This looks to be an issue specifically with Codepen, Firefox, and localStorage. The test uses localStorage and we have implemented a test for it to make sure the user is not blocking it. This is why you see the alert message.

I’m getting Uncaught DOMException: The operation is insecure when trying to set something to localStorage on Codepen in Firefox.

Here is a simple test that fails on Codepen in Firefox
https://codepen.io/lasjorg/pen/XWjzeOy

It fails with modernizr as well.
https://codepen.io/lasjorg/pen/ZEpaXmR

Works fine on jsfiddle, repl.it, and codesandbox
https://jsfiddle.net/aj0w6bsn/
https://repl.it/@lasjorg/modernizr-localstorage-test
https://codesandbox.io/s/modernizr-localstorage-test-crfss


Not really sure what is going on yet but one thing I did notice was the sandbox attribute for the iframe on Codepen does not have the allow-same-origin value which the other sites do have. Not sure if it’s the issue though.

Codepen:

sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-scripts allow-top-navigation-by-user-activation"

jsfiddle:

sandbox="allow-modals allow-forms allow-scripts allow-same-origin allow-popups allow-top-navigation-by-user-activation allow-downloads"

repl.it:

sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"

codesandbox:

sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts allow-downloads"


I don’t think there is much we can do about it on our end. It would seem to be an issue Codepen has to fix.

Edit: I send Codepen support a message about this.

Edit2: I got a response back from Codepen and they are looking into it.

7 Likes