Rhino throws uncaught JavaScript runtime exception: ReferenceError: "window" is not defined #20

madr opened this Issue Mar 7, 2012 · 2 comments


None yet

2 participants


I cloned the repo and tried to run Yslow in Rhino with the following:

cd build/rhino
java -jar rhino.jar yslow.js http://example.com/

and got this:

js: uncaught JavaScript runtime exception: ReferenceError: "window" is not defined.

In several Google groups some extra parameters were suggested, for example -opt -1 which I tried too.

java -jar rhino.jar yslow.js -opt -1 http://example.com/

Same thing.

Is this a bug or am I doing it wrong? My skills in env.js is too brief for me to find it out myself.
If it works, please describe the correct use with Rhino here and update the README with Rhino instructions.


Rhino is still experimental, thus is not list in the official flavors on README. Moreover it's supposed to work with .har files and not directly fetching URLs.

rhino yslow.js foobar.har

Where rhino is an alias for java org.mozilla.javascript.tools.shell.Main -opt -1

I've just created an issue #21 to finish Rhino support.

@marcelduran marcelduran closed this Mar 7, 2012

Thanks for the reply. Will read more about .har files, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment