Prevent adding URLs to history

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
adoxa
Astronaut
Astronaut
Posts: 705
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Prevent adding URLs to history

Post by adoxa » 2026-07-13, 07:51

I would like to prevent certain URLs being added to history. CAA has "No History" (by Tito Bouzout), but I'm unable to download it. Would someone be able to attach it, or suggest an alternative? TIA.

_yuyu_
Lunatic
Lunatic
Posts: 267
Joined: 2015-03-02, 14:18

Re: Prevent adding URLs to history

Post by _yuyu_ » 2026-07-13, 08:36

Pale Moon 64-bit on Win 7 x64

User avatar
adoxa
Astronaut
Astronaut
Posts: 705
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: Prevent adding URLs to history

Post by adoxa » 2026-07-13, 09:28

No, that doesn't look specific enough (and I use "History disable button 0.4.1-signed.1-let-fixed.1-signed" to toggle history).

Enobarbous
Fanatic
Fanatic
Posts: 122
Joined: 2022-12-06, 17:44

Re: Prevent adding URLs to history

Post by Enobarbous » 2026-07-13, 12:15

adoxa wrote:
2026-07-13, 07:51
Would someone be able to attach it?
Here. Didn't check how efficient it is
You do not have the required permissions to view the files attached to this post.
I am sorry for the use of auto-translator to post

User avatar
adoxa
Astronaut
Astronaut
Posts: 705
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: Prevent adding URLs to history

Post by adoxa » 2026-07-13, 14:29

Thank you! I'll have a play with it tomorrow. BTW, both files are identical.

User avatar
Moonchild
Project founder
Project founder
Posts: 39714
Joined: 2011-08-28, 17:27
Location: Sweden

Re: Prevent adding URLs to history

Post by Moonchild » 2026-07-13, 18:31

If you can't get it to work, you can always just use a new private window to go to the sites you don't want stored in history. That is precisely what private browsing is for.
"Sales hates anything that can't be turned into a confident sentence." - anonymous warehouse worker
"Why debate someone you fundamentally don't trust?" - Dario Amodei
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
adoxa
Astronaut
Astronaut
Posts: 705
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: Prevent adding URLs to history

Post by adoxa » 2026-07-15, 02:29

It works. The use case is to prevent "supplemental" URLs being added to history, such as this site's "unread&sid" and Cloudflare's "__cf".

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

Re: Prevent adding URLs to history

Post by moonbat » 2026-07-15, 09:08

My extension PermisionsPlus allows for this - you can prevent a given domain from being saved to history. Link in my sig.
"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
adoxa
Astronaut
Astronaut
Posts: 705
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: Prevent adding URLs to history

Post by adoxa » 2026-07-15, 09:44

I'm really not connecting with people on this. I don't want to block domains, I only want to block specific URLs. E.g. if an.example.url/some/page is behind Cloudflare it's redirected to an.example.url/some/page?__cf_chl... and that's what I want to block, keeping the original.

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

Re: Prevent adding URLs to history

Post by moonbat » 2026-07-15, 10:57

You want to remove the cloudflare parameters? Pure URL to the rescue, again in my sig :D
"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

Enobarbous
Fanatic
Fanatic
Posts: 122
Joined: 2022-12-06, 17:44

Re: Prevent adding URLs to history

Post by Enobarbous » 2026-07-16, 14:50

adoxa wrote:
2026-07-15, 09:44
I don't want to block domains, I only want to block specific URLs. E.g. if an.example.url/some/page is behind Cloudflare it's redirected to an.example.url/some/page?__cf_chl... and that's what I want to block, keeping the original.
Can I suggest a different approach? Essentially, given the task, you don't necessarily need to "prevent adding urls to history"; it's enough to simply automatically remove some urls from history. And that's much easier to achieve.
Example code for custom buttons, simply removing some sites from history when closing any tab:

Code: Select all

var deletedSites = ['https://example.com', 'https://example2.com', 'https://example3.com'];

function deleteHistory() {
  for (var i = 0; i < deletedSites.length; i++) {
    var site = deletedSites[i];
    var uri = NetUtil.newURI(site);
    PlacesUtils.history.removePage(uri);
    console.log(site + ' deleted from history')
  }
}

gBrowser.tabContainer.addEventListener('TabClose', deleteHistory, false);
The code is very basic; it doesn't handle edge cases or partial URL matches (perhaps, instead of a static list of sites, it is worth doing a history search and selecting all addresses containing '?__cf_' into an array?); for better performance, you could use 'removePages()' (https://xref.palemoon.org/goanna-centra ... istory.idl) and so on, but this is what I threw together in 5 minutes at work as an example.
Of course, this isn't a finished solution, but I know you've written at least one extension ;)
I am sorry for the use of auto-translator to post