I tried running this JavaScript code in the address bar in Firefox 6:
javascript:alert("Hello")
I get a
ReferenceError: alert not defined.
It used to work fine in Firefox 5 though, and still works on Opera, Safari and Chrome. How do I fix this?
It seems using
javascript:
anddata:
URLs (directly in the address bar) are currently not allowed as per this comment:And this is the "bug" that was resolved in the latest version. The last comment also states:
Now:
You can't, you have to wait until they decided for a proper solution. As the comment said, bookmarklets will work, but must be explicitly allowed. If you just want to test code, use either Firebug or the new Scratchpad feature.