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

Discussion of features in Mozilla Firefox
Post Reply
videobruce
Posts: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

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.
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
videobruce
Posts: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

This is not a request to Mozilla to add this, just if someone has already come up with a way to do so. :wink:
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
User avatar
lovemyfoxy
Posts: 2337
Joined: December 11th, 2009, 11:23 am
Location: USA

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

Post by lovemyfoxy »

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 )
2 Desktops--Win 7 Ult.SP1 x64/6GB RAM /Firefox 52.9ESR/Waterfox64 2022.11/Thunderbird 52.9ESR/BitWarden PW Manager/Verizon FIOS wired network
videobruce
Posts: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

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.)
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

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

Post by Brummelchen »

its blocked because NOT signed. anyhow its rather old and buggy.
videobruce
Posts: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

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:
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
User avatar
lovemyfoxy
Posts: 2337
Joined: December 11th, 2009, 11:23 am
Location: USA

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

Post by lovemyfoxy »

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:
2 Desktops--Win 7 Ult.SP1 x64/6GB RAM /Firefox 52.9ESR/Waterfox64 2022.11/Thunderbird 52.9ESR/BitWarden PW Manager/Verizon FIOS wired network
videobruce
Posts: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

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.
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
User avatar
lovemyfoxy
Posts: 2337
Joined: December 11th, 2009, 11:23 am
Location: USA

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

Post by lovemyfoxy »

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.
2 Desktops--Win 7 Ult.SP1 x64/6GB RAM /Firefox 52.9ESR/Waterfox64 2022.11/Thunderbird 52.9ESR/BitWarden PW Manager/Verizon FIOS wired network
morat
Posts: 6403
Joined: February 3rd, 2009, 6:29 pm

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

Post by morat »

@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: 336
Joined: March 25th, 2006, 11:38 am
Location: New York State

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

Post by videobruce »

Thanks for the above, but the "advanced users" part put the brakes on that for me. :(
Browsers that don't have a conventional horizontal Menu bar (where it's been for 25 years) are poorly designed. Period. Stop 'fixing' something that isn't broke!
Post Reply