5

I seem to remember that, in the past, when one disabled Javascript in Firefox, it would immediately stop all previous-loaded scripts and event handlers from running.

However, I am now running Firefox 51 on Ubuntu Linux, and I discovered that setting javascript.enabled to false in about:config still allows already-running scripts to run until the next page refresh.

Is there some mechanism to disable Javascript immediately without reloading the page in modern Firefox?

| improve this question | |
  • Use an older version of Firefox and maybe try to verify the behavior beforehand? Why do you have this requirement? – Seth May 2 '17 at 9:19
  • 2
    @Seth, I just want to read the rendered content without executing event handlers on every click and mouse over event. Also, the site constantly make Ajax requests as well, which I find wasteful if I'm just trying to read the contents. Unfortunately the initial rendering requires js, so disable after refresh is not an option. – merlin2011 May 2 '17 at 10:10
6

You can simply go to your dev-tools, in the Debugger Panel, and then click the Pause button || or press F8 :

Screencast of the dev-tools
(screenscast from FF54 on osX)

This will immediately stop all execution of javascript in the current page.

| improve this answer | |
  • 2
    This makes the rest of the page non usable. – merlin2011 May 6 '17 at 4:25
  • 2
    That is, I can't scroll the page or do anything else. – merlin2011 May 6 '17 at 4:25
  • @merlin2011 This should not disable scrolling on the page, but other features like mouse events (even on CSS) will be blocked too. But you should have a complete access of the current DOM through the js console. – Kaiido May 6 '17 at 4:35
  • I'm trying to use the page as an ordinary user, as if the current page was simply a static page instead of one rendered by js. – merlin2011 May 6 '17 at 4:46
  • @merlin2011, then var blob = new Blob([new XMLSerializer().serializeToString(document.documentElement)]); window.open(URL.createObjectURL(blob)); once the page has loaded, and in dev-tools preferences of the opened pop-up check "Disable JavaScript". But I don't understand why you would need to try a page without js when js is needed to render the page... – Kaiido May 6 '17 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.