Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

security exception when accessing css rules

more options

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.

Tất cả các câu trả lời (2)

more options

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

more options

This could be a factor:

TEST PAGE:

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

NON-TEST PAGE:

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