A kind reminder we would like all registered users to weigh in on one of our forum's security policies.
Please take a moment to read this thread and place a vote.
https://forum.palemoon.org/viewtopic.php?f=17&t=32935

Website Navigation Bar

Dedicated board for extension releases/support threads

Moderators: FranklinDM, Lootyhoof

Forum rules
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Website Navigation Bar

Post by jobbautista9 » 2021-04-30, 06:05

If you don't know what a Website Navigation Bar is, see this thread on CodeVerge, the first answer by Dirk.

So I stumbled upon this thread last night, and I thought, "hey this should be easy to port in Borealis Navigator". And so I did port that toolbar. It was very easy, I got the toolbar working on Borealis, as well as the basic Top and Up buttons in just like 30 minutes. It's after all just simple copy-and-paste from SeaMonkey's XUL code and some minor alterations to make it work on Borealis. In the next morning, I fixed some bugs in the add-on, particularly the RSS/Atom feed function as well as the More button. I also added basic support for Pale Moon and Basilisk, and localization from SeaMonkey's lang packs. As a final touch, I used this Sburb logo from Homestuck, and recolored it to match SeaMonkey's logo color scheme.
icon.png
Here's a screenshot of the add-on in Borealis Navigator:
website-navigation-bar.png
I hope federatedfly and RexyDallas, if they are still here, find this add-on useful. I think the Website Navigation Bar is not obsolete, and in fact is just even more relevant now that we are seeing JavaScript hell being used just to get basic navigation to work. Like guys, why are you reinventing the wheel, when there's already <link> tags for that?

The add-on will be available at https://addons.palemoon.org/addon/websi ... gation-bar once it's approved.
You do not have the required permissions to view the files attached to this post.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-04-30, 14:26

2.53-2 has been released! This is a minor bugfix release which fixes the known bug in Phoenix-based browsers, particularly where the toolbar doesn't update when you switch tabs. Thanks to FranklinDM for helping me fix this! :thumbup:
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5712
Joined: 2015-12-09, 15:45

Re: Website Navigation Bar

Post by moonbat » 2021-04-30, 15:48

The toolbar seems to default to 'hide always' - I thought there was something wrong and I had to change it to 'show as needed' from the view menu in Borealis. Maybe you should make that the default so users at least know it is there.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-05-01, 04:05

Yeah, good point. I made it default now into "Show Always" for new users in the new 2.53-3 release. Also added a Tagalog locale as a bonus. :)
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

New Tobin Paradigm

Re: Website Navigation Bar

Post by New Tobin Paradigm » 2021-05-01, 04:07

You should really NEVER use a dash in the version number. It doesn't evaluate like you think it does in comparisons.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-05-01, 04:15

Yeah, my bad, sorry. I pushed the version number to 3.0 now. There's no code changes.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-05-01, 09:00

3.1 has been released! This is a minor bugfix release.

So I was hunting for known bugs in the Website Navigation Bar via Bugzilla, and stumbled upon bug #134436, which was reported 19 years ago. Apparently it doesn't recognize language codes that have a country identifier included (e.g. en-US, sv-SE, es-AR). So I fixed it, and it was relatively easy. I just had to include chrome://global/locale/regionNames.properties into my stringbundles, and define it in the linkToolbarHandler.js file. I used some test(x), substring(x[, y]), indexOf(x), and toLowerCase() trickery to make it work.

I also included the fix in comment #6 of the bug, so that SeaMonkey developers can finally fix this.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5712
Joined: 2015-12-09, 15:45

Re: Website Navigation Bar

Post by moonbat » 2021-05-01, 11:02

jobbautista9 wrote:
2021-05-01, 09:00
which was reported 19 years ago
:shock:
I bet there's tons more like this. All while MozCo kept throwing their money around on tons of useless shit unrelated to fixing their browser.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

vinipsmaker

Re: Website Navigation Bar

Post by vinipsmaker » 2021-06-06, 20:50

Cool extension. Would it be possible to make mid-click on one of the navigation buttons to open the link in a new tab?

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-06-07, 06:09

Good idea. I just finished implementing the middle-click, ctrl-key, and shift-key checks in the extension. After I finish porting bug 1709443, I will push a new update. Might as well contribute back the middle-click and key checks to SeaMonkey once I updated the extension. :)
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-06-07, 07:24

3.3 has been released! This is a major update. I skipped 3.2 because there are three changes done in this update, which is pretty major, but not major enough for a 4.0 release.

First change is the ctrl-key, shift-key, and middle-click checks are now implemented. So if you middle-click the Next button for example, it will open in a new tab in the background. If you hold Shift while clicking Next, it will open the link in a new window. And so on... Thanks to vinipsmaker for suggesting the middle-click feature!

Second change is that bug 1709443 has been ported to the extension. This should make the extension on par with SeaMonkey 2.53.8 (which is currently in beta 1).

Third change is I implemented the three visibility levels for Phoenix-based browsers (e.g. Pale Moon and Basilisk) under the toolbar right-click context menu. Unfortunately "Show Only As Needed" doesn't work for some reason. And you can't find it in View => Toolbars from the menubar, because the menupopup for the toolbar items doesn't exist.

There's also a known bug while I'm testing the update where if you hold Ctrl and Shift and left-click one of the menu items in More => Other Versions, the More button no longer pops up in the next clicks. As a workaround, you can hide the Website Navigation Bar and show it again to fix this.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

vinipsmaker

Re: 3.3 has been released!

Post by vinipsmaker » 2021-06-07, 11:20

It's working here. Thanks for the update.

Another idea: sometimes I want to subscribe to a page's RSS, so I'd like to be able to right-click on the RSS item and click on "copy link". Right now I have to actually open the page just to copy the link from the address bar before I can paste this RSS link on my news aggregator.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2021-06-07, 13:03

I think I can do that. I just need to add a new context menu containing a Copy Link item...

I got the known bug fixed by using the whereToOpenLink function of utilityOverlay.js (thanks frg of SeaMonkey). Unfortunately the fix only works properly (and inconsistent with the anchor behaviour on webpages) in Phoenix-based browsers. In Borealis and SeaMonkey, shift-leftclick doesn't work because it returns null to the where object. I'm going to ask Tobin first whether he'd make shift-leftclick work in Borealis, before I release the fix. And maybe make the ctrl-leftclick consistent too.
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

New Tobin Paradigm

Re: Website Navigation Bar

Post by New Tobin Paradigm » 2021-06-07, 19:39

One: I wouldn't give them shit.. They are burning out hard running on gecko/56 and calling US old and insecure and low and behold kairo is back on their failnode channel.

They could have signed with us before this 56 abomination they ran on for three years. Would have been trivial to get them on UXP.

At this point, they can either continue to crash and burn or mutate them selves more which they can't do. They are fucked.

As for whatever you want to port to Borealis... I removed the ancient toolbar for a reason.

vinipsmaker

Re: Website Navigation Bar

Post by vinipsmaker » 2021-06-09, 11:37

One last feature request: still on the RSS thing, it'd be good to have a tooltip containing the URL (or change the statusbar, or any other hint for the actual URL... anything that shows me the URL will do) when I hover the mouse over the RSS links so I can take a look at which one I want to copy before copying.

This feedback is not important for most navigation buttons (top, up, first, prev, next, last, document > section, section > chapter, ...), but it does help when you're not sure where you're navigating to (both more > ..., and the RSS > ...).

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2025-11-03, 14:30

3.4.1 has been released! (Ignore 3.4, it's exactly the same, I just forgot to update the maxVersion target for Pale Moon in the install.rdf before submitting the xpi...)

It's a simple update that adds a context menu for right-clicking on the toolbar's items. Currently the only action is copying a link to the clipboard.
Off-topic:
It was a pain to figure out how to add the context menu especially after being in hiatus from XUL add-on development for so long. I tried just adding placesContext but I never got that to work, so I simply created my own with this ancient Bookmarks menu (caa:addon/bookmarks-menu) as my reference. It's all worth it though because I found myself in a situation where I really needed to copy a canonical link to the clipboard, and as a bonus I can now also copy the linked RSS/Atom feeds as well...
And just in case people are wondering, yes I did make sure the change applied to the overlay for Borealis too. I had to download an unbranded copy from MSFN since I don't have an official copy for Windows... :coffee:
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2025-11-04, 07:51

3.5 has been released! In this update:
  • Canonical is now a separate, permanent menu item under the More menu. It has been localized too!
  • Finally added tooltips to the link menuitems of the Document, More, and Subscribe menus. (If you're reading this @vinipsmaker I hope you find this useful!)
    • Tooltip text will be the link's title if it exists, otherwise it's href. Canonical is an exception where it's always href.
    • Document menu has not been tested against this change, but it's probably working as intended. If you know where I can find a webpage that uses stuff like <link rel="toc"> please let me know!
  • Fixed bug where the access key doesn't copy the link (a in Pale Moon and Basilisk, L in Borealis)
  • Changed labels of menuitems to use href instead of rel when a title couldn't be found. If it has an hreflang then it becomes "<language>: href".
  • rel="license" now appears under the Copyright item of the More menu. (section 4.6.7.10 of the HTML Living Standard mandates rel="copyright" to be a synonym of rel="license".
  • Ignored more rel values: dns-prefetch, preconnect, preload, modulepreload, prerender, apple-touch*
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2025-11-05, 11:58

3.6 has been released! In this update:
  • The link's title and href now always appear together in its tooltip, consistent with the Bookmarks Toolbar's behavior with its own link items (title on top, URL on bottom).
  • The link's href now appears in the status panel (either the status bar text in Borealis and Pale Moon, or the little bottom popup in Basilisk), consistent with the behavior of the Bookmarks Toolbar as well as the History and Bookmarks Menus.
  • When a menu is popped up and the cursor hovers to another menu, the other menu now opens up automatically while the previous menu is closed, consistent with how folders in the Bookmarks Toolbar are handled with the same scenario.
  • Ignored rel="mw-deduplicated-inline-style". It appears a lot in Wikipedia and they're all not navigable (scheme is mw-data:)
I learned a lot about how the Bookmarks Toolbar interacts with the status panel and does it quick opening trick with its folders for this update. Hopefully this add-on can be a useful future reference to people trying to create their own toolbar add-ons! :)
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2025-11-12, 08:43

3.7 has been released! This update now makes the add-on listen for DOMLinkChanged and DOMLinkRemoved events, updating the toolbar's items for every time either of those events fire. Currently the toolbar update for those two events works by rebuilding it entirely, which also happens when loading a webpage and switching tabs (and therefore enabling each tab to truly have its own toolbar state). After some lengthy testing, I didn't notice the increased possibility of the toolbar rebuilding itself slowing down the browser (probably because it's rare for websites to change and remove <link> elements anyway), so I've decided to publish this change for everyone else to enjoy.

If you'd like to see a usecase for this update, install this userscript:

Code: Select all

// ==UserScript==
// @name        Website Navigation Bar: Dynasty Reader
// @namespace   job.tilde.team
// @include     https://dynasty-scans.com/chapters/*
// @version     2.0
// @grant       none
// ==/UserScript==

const pages = document.querySelectorAll(".pages-list > a:not(#prev_link, #next_link)")
const lp = document.createElement("link");
lp.rel = "prev";
const ln = document.createElement("link");
ln.rel = "next";
const prevChap = document.querySelector("a#prev_link");
const nextChap = document.querySelector("a#next_link");

function chapExistCheck(tChap, tLink) {
  if (tChap.href.split("#").length == 1) {
    tLink.href = tChap.href;
    tLink.title = tChap.innerText;
  } else {
    tLink.remove();
  }
}

if (pages.length > 1) {
  const lf = document.createElement("link");
  lf.rel = "first";
  lf.title = "Page 1";
  lf.href = "#1";
  const ll = document.createElement("link");
  ll.rel = "last";
  ll.title = "Page " + pages.length;
  ll.href = "#" + pages.length;
  
  var currentPage;
  function updatePagination() {
    currentPage = Number(window.location.hash.split("#")[1]);
    if (!currentPage) currentPage = 1;
    
    const cLinks = [lf, lp, ln, ll];
    cLinks.forEach((tLink) => {
      if (tLink.parentElement != document.head) document.head.appendChild(tLink);
    });

    if (currentPage > 1) {
      lp.title = "Page " + (currentPage - 1);
      lp.href = "#" + (currentPage - 1);
      if (currentPage == pages.length) {
        ll.remove();
        chapExistCheck(nextChap, ln);
      }
    }
    if (currentPage < pages.length) {
      ln.title = "Page " + (currentPage + 1);
      ln.href = "#" + (currentPage + 1);
      if (currentPage == 1) {
        lf.remove();
        chapExistCheck(prevChap, lp);
      }
    }
  }
  updatePagination();
  window.addEventListener("hashchange", () => {
    updatePagination();
  });
} else if (pages.length == 1) {
  chapExistCheck(prevChap, lp);
  chapExistCheck(nextChap, ln);
}
And read a doujin or manga from Dynasty Reader, like this one: https://dynasty-scans.com/chapters/touh ... atori_ch01

As you can see the Website Navigation Bar now updates its page navigation items quite nicely, even if a new webpage is not loaded each navigation (since the website is using URI fragments to paginate their chapters' contents)!
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1082
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Website Navigation Bar

Post by jobbautista9 » 2025-11-13, 12:29

3.8 has been released! This update finally fixes the longstanding bug of the "Show Only As Needed" visibility option not working in Pale Moon and Basilisk. It also adds the context menu for the toolbar's visibility to other places, namely:
  • The toolbar context menu in Borealis, toolbar-context-menu
    • It was already available there in Pale Moon and Basilisk, due to the fact that the context menu in (from the menubar) View => Toolbars does not have an id, unlike the Mozilla/SeaMonkey Suite's navigator's equivalent (which is view_toolbars_popup)
      • However this will be changing in a future version of Pale Moon (PR Issue #1999). This update has an overlay ready for that, so it should automatically apply the visibility context menu there even if the add-on doesn't get another update. If Basilisk merges the equivalent PR as well the overlay will be applied there as well.
  • The appmenu button's Preferences context menu, appmenu_customizeMenu (Pale Moon)
  • The context menu of the Website Navigation Bar itself, linkToolbarItemPopup (Pale Moon, Basilisk, Borealis)
This update also ensures that the item of the visibility menu always appears below the item for the Bookmarks Toolbar. This is done by extending (or hijacking) the popupshowing event listener for each of the mentioned above (except the context menu of the Link Toolbar itself which is not necessary). Hopefully that wouldn't come back to bite me (I might not be worried about the browser changing their onpopupshowings but I am worried that other add-ons might've gotten the same idea for their toolbars...) :think:
Image

Tired of creating stuff!

Avatar artwork by Shinki669: https://www.pixiv.net/artworks/113645617

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.