Loading text files with requires.js fails in Firefox: “AccessControlException” #13

ghost23 opened this Issue Aug 9, 2012 · 10 comments


None yet

3 participants



i have also have a question on stackoverflow running regarding my issue:

I am using requires.js 2.0. I have the following simplified use case:

my HTML file:

    <script type="text/javascript" data-main="apptest.js" src="../_js/libs/require/require.js"></script>


And then in apptest.js:

    paths: {
        'text': '../_js/libs/require/text'


    function (Boxes) {

Ok, so it doesn't really do much, but enough to make my point. Only in Firefox (14.0.1) i get an exception "uncaught exception: java.security.AccessControlException: access denied (java.io.FilePermission .\boxes.html read)".

So, require.js successfully loaded the text plugin, but fails loading my html file, which i want to use as a template later on. In Google Chrome and even IE9 it works just fine. I am on Windows 7.

I am running this on a local webserver, so no file://... requests here.

I have checked, if i have any special permissions set on the html file, but have not found anything suspicious.

Anyone have an idea?

Update: Running the test in Firefox 13.0.1 does actually work for me without errors. So could it be, that this is a bug, that has been introduced in firefox 14?

requirejs member

Can you confirm what version of text.js you are using? The version should be in the file.

At first read, it looks like it may be trying to use the java route, maybe mistaking the env for rhino. I did a change related to that in text.js 2.0.2. If the version you are using is 2.0.2, do you mind trying it with text.js 2.0.1?


If the error only happens with 2.0.2, then it sounds like the java/rhino detection is messing things up.


I am using 2.0.2. Will check again with 2.0.1, just a sec.


Indeed, switching to 2.0.1 fixes the issue.


I've got the same problem with text 2.0.2 under Firefox 14.0.1 on Mac. The same version on Windows is ok, every other browsers are ok, too.

I debugged this line with firebug:

  } else if (typeof Packages !== 'undefined' && typeof java !== 'undefined') {
    //Why Java, why is this so awkward?

console: Packages and java => return undefined.

However, console: typeof Packages and typeof java => return "function".

This is weird. And finally, this is the error on the console:

uncaught exception: java.security.AccessControlException: access denied (java.io.FilePermission

Sticking with text 2.0.1 is ok.

requirejs member

I do not see this problem on Firefox Beta channel (version 15) or Aurora, on Mac, so it is a bit hard for me to test at the moment, and I'm on a limited connection, cannot download 14.

@hoatle can you confirm if the following check would return false for 14, and if so, then I'll update the check to this:

typeof Packages !== 'undefined' && typeof java !== 'undefined' && Packages && java

@jrburke I applied this new check, however, it still returns true and the problem remains.

@jrburke jrburke added a commit that referenced this issue Aug 12, 2012
@jrburke jrburke Relates to #13, roll back the change to #11, but introduce a config.e…
…nv override to help address #11.
requirejs member

I just rolled back the change for #11, you can try the latest master:


I also introduced a "env" config override to try to help the case for #11:


If one of you can confirm this new one works now, then I'll push out a 2.0.3 change with this fix.


Hi @jrburke, I confirm that it works now. Thanks!

requirejs member

OK, just pushed a 2.0.3 release with this change:


@jrburke jrburke closed this Aug 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment