Firefox SecurityError: “The operation is insecure.”

前端 未结 4 728
半阙折子戏
半阙折子戏 2021-01-05 04:48

I am using Backbone.LocalStorage plugin with backbone app. It is working fine in chrome and safari however, it is giving me below error in firefox.

DO

4条回答
  •  感动是毒
    2021-01-05 05:13

    This happens when we try to access a resource (CSS...) that is located on a different domain. To deal with this error we can use this:

                       try {
                         //your critical access to ressources !
                         //rules = document.styleSheets[i].cssRules;
                            } catch(e) {
                       if(e.name !== "SecurityError") {
                           throw e;
                           }
    

提交回复
热议问题