WebPagetest Forums
firefoxPref can't change javascript.enabled - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: firefoxPref can't change javascript.enabled (/showthread.php?tid=14082)

firefoxPref can't change javascript.enabled - krudnik - 11-23-2015 09:16 PM


I have tried to measure a performance of a website without JS. I don't want just block js requests, but simulate that JS is disabled in the browser.
So I gave a try to https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/scripting#TOC-firefoxPref - the setting itself seems to be working fine (e.g. firefoxPref general.useragent.override "TEST" is ok).
But I do not see any difference between javascript.enabled (http://kb.mozillazine.org/Javascript.enabled) true or false:
firefoxPref    javascript.enabled    true
navigate    https://www.mozilla.org/en-US/firefox/new/
firefoxPref    javascript.enabled    false
navigate    https://www.mozilla.org/en-US/firefox/new/

Two questions:
1. Is there anything specific about javascript.enabled? Is this an expected behavior?
2. Any recommendation how to simulate javascript disabled?

RE: firefoxPref can't change javascript.enabled - krudnik - 11-24-2015 09:12 PM

Ok, there is an easier - trivial way - to disable JS. Trying to solve my issue I found https://github.com/WPO-Foundation/webpagetest/blob/master/agent/wptdriver/web_browser.cc and this piece of code
if (_test._noscript) {
      user_prefs += "user_pref(\"javascript.enabled\", false);\r\n";
led me to Advanced Settings > Advanced > Disable Javascript checkbox on http://www.webpagetest.org