Friday, December 12, 2008

Firefox3 new security rule: Selenium no CSS on Chrome TestRunner

Firefox 3 introduced more strict security rules than older version. Many Selenium weird issues on FF3 are related to it, while most of these issues didn't happen on FF2.

Today I encountered one SeleniumIDE1.0b2 bug: [SIDE-222]Test execution is not possible in chrome mode in Firefox 3.

FF3 Error Console reported:
Security Error: Content at (local test suite html address like file:///c:/seltest/testsuite1.html) may not load or link to "chrome://selenium-ide-testrunner/content/selenium/selenium-test.css" 
It seems FF3's default security settings not allow external file access chrome:// resource.
I read Mozilla docs: https://developer.mozilla.org/en/Chrome_Registration#contentaccessible

It said: (New in FF3) Chrome resources can no longer be referenced from within <img>, <script>, or other elements contained in, or added to, content that was loaded from an untrusted source. This restriction applies to both elements defined by the untrusted source and to elements added by trusted extensions. If such references need to be explicitly allowed, set the contentaccessible flag to yes to obtain the behavior found in older versions of Firefox.

So, I try to modify Selenium-IDE1.0b2's chrome.manifest file.
content selenium-ide-testrunner jar:chrome/selenium-ide.jar!/content/ xpcnativewrappers=no 
content selenium-ide-testrunner jar:chrome/selenium-ide.jar!/content/ xpcnativewrappers=no contentaccessible=yes
SeleniumIDE1.0b2 displayed CSS correctly this time on FF3 Chrome TestRunner.

1 comment:

  1. Hey! I liked your article! it was something new! And now I would surely follow your advice! I think your blog is really informative and creative!
    Visit:- Mozilla Firefox Technical Support

    ReplyDelete