Enable Javascript in Url Bar in Firefox

Enable Javascript in Url Bar in Firefox

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

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

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

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:

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.