MozillaZine

Make View/Page Style/No Style a Navigation button?

Discussion of features in Mozilla Firefox
videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 15th, 2018, 7:13 am

Has anyone come up with a way of making this Menu option under View/Page Style/No Style a single dedicated button that can be added to the navigation bar instead of clicking thru the Menu View tree??

This seems to be similar to Opera Classic's "Author/User" button that toggles CCS on or off. I used that all the time when it came to printing out poorly written web pages (probably 1/4 of them) using Opera. I realize that FF has this "Simplify Pages" option in the Print Preview which is a great feature, but not the same thing.
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 15th, 2018, 7:19 am

This is not a request to Mozilla to add this, just if someone has already come up with a way to do so. :wink:
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

LoveMyFoxy

User avatar
 
Posts: 2039
Joined: December 11th, 2009, 11:23 am
Location: USA

Post Posted March 17th, 2018, 1:22 pm

I have a Toolbar Buttons extension from Codefisher. See if he has something, or can make something on your request. He also has custom button sets
https://codefisher.org/toolbar_button/

(OT--you should say something about Edge in your sig too #-o )
Desktop--Win 7 Ult. 64-bit, 6GB RAM /FF 52ESR 64/ Thunderbird 52 / MS Sec. Essent./ Windows firewall / Verizon FIOS

videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 18th, 2018, 3:46 am

Download was blocked by Mozilla. :(

(I would have to include other browsers also, but since it's from the same source, most seasoned users already know that.)
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

Brummelchen
 
Posts: 3396
Joined: March 19th, 2005, 10:51 am

Post Posted March 18th, 2018, 5:22 am

its blocked because NOT signed. anyhow its rather old and buggy.

videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 18th, 2018, 6:01 am

I sent a message to the developer and the reply was;
It is not so much blocked as the changes introduced makes it impossible for it to work. Firefox 57 made even more changes. I am trying to play catch up but a rewrite takes a lot of work, but I am short on time, so development is slow.

And I also made a donation. :wink:
Unbelievable number of choices in his 'custom' list. :shock:
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

LoveMyFoxy

User avatar
 
Posts: 2039
Joined: December 11th, 2009, 11:23 am
Location: USA

Post Posted March 18th, 2018, 8:50 am

I should have mentioned I have FF 52.7.2ESR. I've had Toolbar Buttons for many years and I've downloaded some of the custom ones. He had written a few months ago that he's upgrading for 57+. :oops:
Desktop--Win 7 Ult. 64-bit, 6GB RAM /FF 52ESR 64/ Thunderbird 52 / MS Sec. Essent./ Windows firewall / Verizon FIOS

videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 18th, 2018, 9:05 am

Was there that much a difference between 52 ESR and 56? I thought the big change was v57? #-o
I did mention to him that I was using v56.
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

LoveMyFoxy

User avatar
 
Posts: 2039
Joined: December 11th, 2009, 11:23 am
Location: USA

Post Posted March 18th, 2018, 10:15 am

52ESR allows you to keep almost all of your extensions till the last update, I think in June. It runs on a different track, and I 'm not planning on getting back on the regular track. I'm sure if I have even one punctuation mark wrong in that sentence, Brummelchen will correct me.
Desktop--Win 7 Ult. 64-bit, 6GB RAM /FF 52ESR 64/ Thunderbird 52 / MS Sec. Essent./ Windows firewall / Verizon FIOS

morat
 
Posts: 2662
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 20th, 2018, 1:06 am

@videobruce

You could create a toggle page style button similar to the restart button. (for advanced users only)

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

Restart Button
http://gist.github.com/Sporif/ad6e917d8 ... 80d3c8918c

* TogglePageStyleFirefoxButton_Movable.uc.js

Code: Select all
(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  /* CustomizableUI
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm
  */

  try {
    CustomizableUI.createWidget({
      id: "toggle-page-style-button", // should match id below
      type: "custom",
   // defaultArea: CustomizableUI.AREA_MENUBAR,
      defaultArea: CustomizableUI.AREA_NAVBAR,
      onBuild: function (aDocument) {
        var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        var toolbaritem = aDocument.createElementNS(XUL_NS, "toolbarbutton");
        toolbaritem.onclick = event => onClick(event);
        var props = {
          id: "toggle-page-style-button",
          class: "toolbarbutton-1 chromeclass-toolbar-additional",
          label: "Toggle Page Style",
          tooltiptext: "Toggle page style between basic page style and no style",
          style: 'list-style-image: url("chrome://branding/content/icon16.png");',
        };
        for (var p in props) toolbaritem.setAttribute(p, props[p]);
        return toolbaritem;
      },
    });
  } catch (e) {};

  function onClick(event) {
    if (event.button == 0) {
      try {
        // Firefox 52
        var styleDisabled = getMarkupDocumentViewer().authorStyleDisabled;
        if (styleDisabled) getMarkupDocumentViewer().authorStyleDisabled = false;
        else getMarkupDocumentViewer().authorStyleDisabled = true;
      } catch (e) {
        // Firefox 58
        var browser = gBrowser.selectedBrowser;
        var styleSheetInfo = gPageStyleMenu._getStyleSheetInfo(browser);
        var styleDisabled = styleSheetInfo.authorStyleDisabled;
        if (styleDisabled) gPageStyleMenu.switchStyleSheet("");
        else gPageStyleMenu.disableStyle();
      }
    }
  }
})();

I tested the button in Firefox 59. I believe the button works in Firefox 52 and Firefox 56.

CustomizableUI
http://developer.mozilla.org/en-US/docs ... ableUI.jsm
Last edited by morat on March 29th, 2018, 10:59 am, edited 3 times in total.

videobruce
 
Posts: 109
Joined: March 25th, 2006, 11:38 am
Location: Buffalo NY

Post Posted March 20th, 2018, 4:58 am

Thanks for the above, but the "advanced users" part put the brakes on that for me. :(
Idiot Exploiter couldn't be a standard even if it was the only browser and Chrome is just another way Google spies on you.

Return to Firefox Features


Who is online

Users browsing this forum: No registered users and 1 guest