X
Tap here to go to the mobile version of the site.

Support Forum

security exception when accessing css rules

Posted

if ( document.styleSheets[i].rules !== undefined ) {

                   cssRule = document.styleSheets[i].rules[ii]; 
                   }
               else if ( document.styleSheets[i].cssRules !== undefined ){
                   cssRule = document.styleSheets[i].cssRules[ii];
                   }

the above code causes a security exception when the tab is already open and another page from the same domain has already been accessed. Note that the original access does not cause a security exception. The security exception is on the "else if" rather than the "if" statement. If I kill the browser and reopen the same page the security exception does not occur. I have tried everything I can think of the prevent any CORs based exception from happening.

To recreate this behavior use: https://www.fanaticmasks.com/test/store/index.php?main_page=product_info&cPath=1&products_id=7 The page should not throw the security exception

Alter the url to: https://www.fanaticmasks.com/store/index.php?main_page=product_info&cPath=1&products_id=7 And it does throw the exception.

To my understanding of COR this is the EXACT SAME DOMAIN.

But for some reason, firefox gets upset about css rules access for no apparent reason. I have also used the built in functions to a. clear cache b. clear history (ALL history)

but unless I restart firefox the security exception still fires. This appears to be a browser issue since I used php to prevent CORs exceptions at the server.

My research via google only turns up old solutions that I can demonstrate don't solve the problem. I can trap the exception, but I need the rule in order for my animation to work.

If necessary I can make a small example show the behavior.

I have had problems with a html BASE tag in the zen cart package but I can't see how that would affect this problem, since the BASE tag is in both pages.

if ( document.styleSheets[i].rules !== undefined ) { cssRule = document.styleSheets[i].rules[ii]; } else if ( document.styleSheets[i].cssRules !== undefined ){ cssRule = document.styleSheets[i].cssRules[ii]; } the above code causes a security exception when the tab is already open and another page from the same domain has already been accessed. Note that the original access does not cause a security exception. The security exception is on the "else if" rather than the "if" statement. If I kill the browser and reopen the same page the security exception does not occur. I have tried everything I can think of the prevent any CORs based exception from happening. To recreate this behavior use: https://www.fanaticmasks.com/test/store/index.php?main_page=product_info&cPath=1&products_id=7 The page should not throw the security exception Alter the url to: https://www.fanaticmasks.com/store/index.php?main_page=product_info&cPath=1&products_id=7 And it does throw the exception. To my understanding of COR this is the EXACT SAME DOMAIN. But for some reason, firefox gets upset about css rules access for no apparent reason. I have also used the built in functions to a. clear cache b. clear history (ALL history) but unless I restart firefox the security exception still fires. This appears to be a browser issue since I used php to prevent CORs exceptions at the server. My research via google only turns up old solutions that I can demonstrate don't solve the problem. I can trap the exception, but I need the rule in order for my animation to work. If necessary I can make a small example show the behavior. I have had problems with a html BASE tag in the zen cart package but I can't see how that would affect this problem, since the BASE tag is in both pages.

Additional System Details

Installed Plug-ins

  • Creative Cloud Desktop Plugin.v_3_0_0_0
  • A plugin to detect whether the Adobe Extension Manager is installed on this machine.
  • Amazon MP3 Downloader Plugin 1.0.17
  • Plugin that detects installed Citrix Online products (visit www.citrixonline.com).
  • Provides information about the default web browser
  • The Google Earth Plugin allows you to view 3D imagery and terrain in your web browser.
  • Version 5.41.0.0
  • Office Live Update v1.0
  • Picasa plugin.
  • The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages. For more information, visit the QuickTime Web site.
  • Shockwave Flash 19.0 r0
  • 5.1.20913.0
  • Plugin for Wacom tablets.
  • iPhoto6

Application

  • User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0

More Information

guigs 1072 solutions 11697 answers

I tested it just to test it in the beta version of Firefox and I did not run into this issue. I am wondering if any of the default security settings have been changed in the about:config page.

I also attached a screenshot of the js debug pop up that came up instead of the security exception. see via http://screencast.com/t/B3cCNEMPYN1

I tested it just to test it in the beta version of Firefox and I did not run into this issue. I am wondering if any of the default security settings have been changed in the about:config page. I also attached a screenshot of the js debug pop up that came up instead of the security exception. see via http://screencast.com/t/B3cCNEMPYN1 *[https://support.mozilla.org/en-US/kb/where-go-developer-support Where to go for developer support]
jscher2000
  • Top 10 Contributor
8787 solutions 71865 answers

This could be a factor:

TEST PAGE:

<base href="https://fanaticmasks.com/test/store/" />

NON-TEST PAGE:

<base href="https://www.fanaticmasks.com/store/" />
This could be a factor: TEST PAGE: &lt;base href="https://fanaticmasks''.''com/test/store/" /> NON-TEST PAGE: &lt;base href="https://www.fanaticmasks''.''com/store/" />