MozillaZine

Suggestion : Option to disable Javscript

Discussion of features in Mozilla Firefox
McRack
 
Posts: 2
Joined: December 16th, 2013, 8:29 pm

Post Posted December 16th, 2013, 8:52 pm

I already know that the feature was removed because too many basic users broke Firefox by disabling it accidentally.

I know that I can do it by changing javascript.enabled in about:config but it's too dangerous if you want to do it often.
I know that convenient extensions for Firefox like Noscript and others exists to do it, but I don't trust and don't want to manage yet another extension.
And it seems to me such a basic feature for a web browser that I think Firefox is not complete without it.

So I suggest this :
To include the javascript disabling option, not in Preferences or Options, but in the "Permissions" tab of the "Page Info" dialog and in the permissions manager "about:permissions".

The permissions system that introduced the feature to block images, cookies or plugins site-by-site is great.
But how does it make sense to disable Flash, Cookies or even Images for an undesirable or dangerous website but not be able to disable javascript the same way ?

This way would also be an upgrade over the previous situation, because users would have site-by-site control with the option.
And don't tell me basic users would again broke Firefox, because blocking Cookies and Images can broke a website just as well.

I hope that if someone who can do a thing about it read this, he or she would take it under consideration.

Elbart
 
Posts: 997
Joined: February 21st, 2010, 8:38 am

Post Posted December 17th, 2013, 3:09 am

You should post this on an official Mozilla-mailing list, not in this forum, which has no relation with Mozilla, and where no Mozilla-devs will read it.
gone

Jim too
 
Posts: 483
Joined: December 29th, 2003, 11:16 am

Post Posted December 17th, 2013, 7:42 am

Elbart wrote:You should post this on an official Mozilla-mailing list, not in this forum, which has no relation with Mozilla, and where no Mozilla-devs will read it.


Isn't it of value to post a suggestion here and get comments/suggestions on what should be asked for before submitting a feature suggestion officially?

WaltS48

User avatar
 
Posts: 3290
Joined: May 7th, 2010, 9:38 am
Location: Pennsylvania, USA

Post Posted December 17th, 2013, 12:44 pm

The option to disable JavaScript exists in the developer tools, the NoScript extension and probably other extensions.
Linux Desktop - AMD Athlon(tm) II X3 455 3.3GHz | 8.0GB RAM | GeForce GT 630
Windows Notebook - AMD A8 7410 2.2GHz | 6.0GB RAM | AMD Radeon R5

McRack
 
Posts: 2
Joined: December 16th, 2013, 8:29 pm

Post Posted December 17th, 2013, 1:54 pm

WLS wrote:The option to disable JavaScript exists in the developer tools, the NoScript extension and probably other extensions.
Thank you, I didn't know about the option being in the developer tools, I didn't scroll down in the advanced section, I learned something today.
I think that's great for the option to be included without third-party extensions.

I still think the javascript permission would be a great addition, its place is right there with the cookie, images and plugins permission.

For posting in a mailing list, I thought about it, but didn't really know in which one since a lot of forum threads around the web give different addresses.
If someone could guide me in the right direction I would gladly post it in the appropriate mailing-list.

Zoolcar9

User avatar
 
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted December 17th, 2013, 7:48 pm

Permissions in Page Info and about:permissions are per-site whereas JavaScript permission is global.
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."

Gort

User avatar
 
Posts: 2320
Joined: February 2nd, 2003, 6:01 pm
Location: Sussex, UK

Post Posted December 18th, 2013, 2:06 pm

Zoolcar9 wrote:Permissions in Page Info and about:permissions are per-site whereas JavaScript permission is global.


Sure, but so are images, cookies and other stuff in the View Page Info, yet they're there to be overridden. The suggestion would be akin to the Yesscript extension. Yeah, you could just install that extension, but the suggestion seems to be a logical extension of what's done with images, cookies, popups and other items in the site permissions.

dickvl

User avatar
 
Posts: 52130
Joined: July 18th, 2005, 3:25 am

Post Posted December 25th, 2013, 11:44 pm

Firefox does support JavaScript via the docShell property for an individual tab..
https://developer.mozilla.org/en-US/doc ... sIDocShell

This code can toggle JavaScript in the current tab with this code in the Browser Console:
Code: Select all
var {classes:Cc,interfaces:Ci} = Components;
var ps = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var gB = wm.getMostRecentWindow("navigator:browser").gBrowser;

function getDocShell(){
 var docShell = gB.docShell; docShell.QueryInterface(Ci.nsIDocShell); return docShell;
}
var val = getDocShell().allowJavascript;
var res = ps.confirm(null, "JavaScript ("+(val?"enabled":"disabled")+")", (val?"Disable":"Enable")+" JavaScript");
if (res){getDocShell().allowJavascript = !val}


Similar code can be used to toggle images (allowImages) and plugins (allowPlugins) in a tab.

patrickjdempsey

User avatar
 
Posts: 23734
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC

Post Posted December 26th, 2013, 12:13 am

YesScript. It's light, has no unexpected features, and requires no learning curve (unlike NoScript).
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/

mgagnonlv
 
Posts: 602
Joined: February 12th, 2005, 8:33 pm

Post Posted December 31st, 2013, 9:35 am

Another good extension is QuickJava. Once installed, it allows you to enable and disable on the fly Javascript, Java, Flash, Cookies, Silverlight, Images, Animated Images...

I use it to keep Java disabled all the time, except on some specific sites that need it.
Michel Gagnon

Zoolcar9

User avatar
 
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted December 31st, 2013, 11:25 am

dickvl wrote:This code can toggle JavaScript in the current tab with this code in the Browser Console:
Code: Select all

or without prompt

Code: Select all
var currentDocShell = gBrowser.getBrowserForTab(gBrowser.mCurrentTab).docShell;
currentDocShell.allowJavascript = !currentDocShell.allowJavascript;
gBrowser.reloadTab(gBrowser.mCurrentTab);
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."

M-Reimer
 
Posts: 63
Joined: July 2nd, 2013, 4:29 am

Post Posted January 15th, 2014, 12:16 am

Another option to toggle Javascript quickly is PrefBar:
Global: http://prefbar.tuxfamily.org/help/butto ... javascript
Per Tab: http://prefbar.tuxfamily.org/help/butto ... javascript
It's even possible to define a hotkey for the buttons, you need regularly.

dickvl

User avatar
 
Posts: 52130
Joined: July 18th, 2005, 3:25 am

Post Posted January 15th, 2014, 6:43 am

Thanks Manuel. I'm using your PrefBar extension for years (I think since Mozilla Suite 1.0) and just updated to the new 6.3.0 release (seem to have missed it), so thanks for the continued support to keep the extension working. I noticed that you've added Australis support, so thanks for that!

The code I posted above is based on what you use in your extension.

Could you consider to use this code in buttonCommands.js as that will make it possible to only set the width or height?
Code: Select all
function prefbarSetResolution(value) {
  var vA=value.split("x");
  if(vA[0])window.outerWidth = vA[0];
  if(vA[1])window.outerHeight = vA[1];
}

M-Reimer
 
Posts: 63
Joined: July 2nd, 2013, 4:29 am

Post Posted January 16th, 2014, 2:04 am


Return to Firefox Features


Who is online

Users browsing this forum: No registered users and 0 guests