37

How can I stop scripts on a page in Firefox? I don't care if the solution is draconian. Super-tech-savvy solutions are also fine.

Clarification: I don't want to turn off scripts permanently. I want to be able to kill a script (or all active scripts) on-demand for a given web page.

Sildoreth
  • 485

5 Answers5

18

It's been answered on a later question. For short:

  • Open the developer console from the menu or by F12.
  • Click the debugger tab.
  • Click the pause button.
minghua
  • 618
3

Firefox developer console has a ⏸ pause button and a Disable JavaScript setting, which is very effective:

Firefox Developer Console

  • In case you don't want any JavaScript to run, first disable it then refresh page (F5).
  • In case you want it to run just until a given point, use the ⏸ pause button in the debugger tab.

You can open the developer console for a given page form the menu, with F12, or with one of this shortcut combinations: Shit + Ctrl/ + K/I

2

Firefox provides a method for disabling JavaScript within its configuration settings. You can put about:config in the address bar where you would normally place the URL for a page you wished to visit. You will see a warning stating "Changing these advanced settings can be harmful to the stability, security, and performance of this application. You should only continue if you are sure of what you are doing." Click on the "I'll be careful, I promise!" button. Look for the javascript.enabled setting; when you've found it double-click on it to toggle the setting from enabled to disabled. Or you can right-click on the setting and choose "Toggle". But that will enable/disable JavaScript for all sites and all pages, so you would have to disable JavaScript before visiting the page and re-enable it afterwards. For finer-grained control at the domain and page level, you can install the NoScript extension for Firefox.

Another option is the PrefBar add-on to add a button for toggling JavaScript off and on for the current tab. The developer's home page is at PrefBar.

moonpoint
  • 5,268
  • 2
  • 21
  • 22
2

Pressing ESC worked for me as suggested by @simlev. For me, it was a page where a blocking pop-over would be displayed in 5-10 seconds after the page was loaded. Pressing ESC effectively stopped the JavaScript on that page. This wouldn't be a replacement for extensions like NoScript, but could be handy in similar situations.

Update on 10/2020: Given the multiple comments about how pressing ESC does not work, one should not have much hope with this method. As stated before, this worked only for a specific case; however, I guess it does not hurt to try just to see if works for you - without much expectation.

dojuba
  • 137
0

The only way I could stop an infinite loop in the Firefox Developer Console while preserving the rest of my Firefox/tabs was to kill the CPU-intensive process in my Task Manager/System Monitor.

Andrew
  • 632