Current Version plugins

Firefox blocks JavaScript in address bar by default

Update: it appears that the change has been in Firefox for longer than that. The preference mentioned below will only filter javascript: from pasted code to avoid that these appear in the history and autocomplete. It still appears to allow JavaScript code to be executed when set to false. End

Firefox users who upgraded the web browser to version 63 released in October 2018 may notice that the browser does not accept JavaScript code anymore when entered in the address bar.

Previous versions of the web browser allowed users to write or paste JavaScript code in the address bar to execute it from there. You can try this out yourself by typing javascript:alert(“hello world”) in the address bar and hitting Enter.

Previous versions of Firefox displayed the Hello World alert when executed but Firefox 63 blocks the execution and redirects the input to the default search engine instead. The same is true for any other JavaScript code that you enter in the address bar.

firefox javascript address bar

You may notice that javascript: is removed when you paste code into the address bar but even if you add it manually, it won’t be executed.

Note: The change affects only JavaScript execution in the address bar. It does not impact bookmarklet functionality or the execution of JavaScript in the Developer Tools console.

While most Firefox users probably don’t need the functionality, some may have used it for certain useful operations such as killing sticky elements on a page, changing the referrer on the fly or edit any website you come across temporarily.

The Firefox 63 changelog does not mention the change; considering that Mozilla makes hundreds of changes to Firefox, it is clear that it represents only a small portion of changes.

firefox address bar javascript

Thankfully, it is possible to undo the change by changing the value of a preference of the web browser. Here is how that is done:

  1. Load about:config?filter=browser.urlbar.filter.javascript in the Firefox address bar.
  2. You may get a warning page. Accept the warning to continue.
  3. Double-click on browser.urlbar.filter.javascript to change the value of the preference.

A value of True is the default. It means that Firefox blocks JavaScript code in the address bar. A value of False disables the limitation and enables the execution of JavaScript code in the Firefox address bar again.

You can undo the change at any time by repeating the three steps outlined above.

A value of False for the preference restores the functionality. Pasting code works again (javascript: is no longer removed), and code is executed when you hit the Enter-key on the keyboard.

Now You: Did you run JavaScript code from the address bar previously?

Ghacks needs you. You can find out how to support us here or support the site directly by becoming a Patreon. Thank you for being a Ghacks reader. The post Firefox blocks JavaScript in address bar by default appeared first on gHacks Technology News.

Leave a Comment

Your email address will not be published. Required fields are marked *

Menu Title