3

Is there any method in about:config to enable in the URL bar JavaScript prefixed by javascript: to run in Firefox?

browser.urlbar.filter.javascript: false doesn't seem to work.

2 Answers 2

7

browser.urlbar.filter.javascript: false doesn't seem to work.

Indeed it doesn't. You can work around it using Bookmarks (at least until Mozilla block that as well):

  • Set up a Bookmark with the location: javascript:%s

  • Set the keyword for that bookmark as: javascript

Now you can run JavaScript from the address bar in the format: javascript alert('Hello World') which is very similar to the old javascript:alert('Hello World') method - it's just that the colon needs to be replaced by a space.

Source Executing JavaScript in Firefox address bar - AutoHotkey Community

3
  • 1
    Thak you very much. You saved my day. I've been googling for this many days. I was near a nervous breakdown ;-)
    – Ingo
    Jun 21, 2020 at 12:10
  • Nice, you can also add js as a keyword to the bookmark, if you want a shorthand. Oct 17, 2020 at 21:53
  • 1
    It is not explicitly stated, but note that this effectively means that Firefox still supports bookmarklets - it just requires them to be run via an assigned keyword (through address bar), or via clicking on them... Nov 16, 2020 at 22:24
0

The setting you are trying to use only controls whether javascript: URLs show up as auto completes when you type in the URL Bar. From http://kb.mozillazine.org/Browser.urlbar.filter.javascript

True
Filter out “javascript:” URLs from appearing in the Location Bar autocomplete dropdown. (Default)

False
Allow “javascript:” URLs to appear in the dropdown.

It seems javascript: URLs are completely disabled in newer version of firefox.

However you should still be able to save javascript: URLs as bookmarks and activate them by clicking on them.

Other people have noticed this too:

https://www.reddit.com/r/firefox/comments/9qykd0/firefox_63_disabled_javascript_in_address_bar/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .