CleanLinks2

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

Moderators: Lootyhoof, FranklinDM

0strodamus
Fanatic
Fanatic
Posts: 143
Joined: 2014-11-19, 19:48

CleanLinks2

Unread post by 0strodamus » 2020-10-04, 03:32

I just released a fork of Clean Links 2.0. You can find it on github.

This fork came into existence partially due to my frustration with overly aggressive tagging as outline here. :D

I forked 2.0 because later versions were bootstrapped or had features that I did not use. I added a working Skip Domains setting (which I couldn't get to work using the original extension). I also either removed or altered the code that was triggering the "FUEL is deprecated" warning (I've been working on this for so long I forget which).

I've also added some new features such as:
  • site-specific, trusted, and untrusted domain settings
  • a cleaning delay (to help with frames and embedded items)
  • link attribute mutation and http-on-modify-request observers
  • full cleaned link logging capabilities
  • ability to enable a tooltip when hovering over cleaned links
  • ability to disable cleaned link dotted-underline decoration if desired
  • ability to highlight cleaned links and customize if desired
  • a settings reset button
Every setting has a detailed tooltip explaining it, so if you try this extension and have questions, start there. I've attached some informational screenshots to this post.

I hope someone out there has enjoyed using Clean Links in the past as much as I have and finds this fork useful. I would be remiss to not thank the original developer for providing Clean Links and all their other wonderful extensions.

Off-topic:
For the help vampires, please don't start opening Issues requesting that I back-port any features from later versions of Clean Links. I don't plan to spend much more time on this extension, unless there is something glaringly wrong that I overlooked or totally bungled. I'm just another end-user of Pale Moon like you are, not a developer, and certainly not sharing this to put myself in service to your every need.
You do not have the required permissions to view the files attached to this post.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 37531
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: CleanLinks2

Unread post by Moonchild » 2020-10-04, 03:42

Note, if you fork an extension you MUST change its extension ID.
"A dead end street is a place to turn around and go into a new direction" - Anonymous
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: CleanLinks2

Unread post by New Tobin Paradigm » 2020-10-04, 08:25

Not a note.. A big massive do it properly or consequence will be abundant.

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

Re: CleanLinks2

Unread post by moonbat » 2020-10-04, 09:02

While you're at it, you could try rewriting it as an overlay(XUL) extension. The original is bootstrapped and has the same shitty problem of screwing up the toolbar and buttons vanishing that plague all bootstrap extensions.
"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

letmeindude

Re: CleanLinks2

Unread post by letmeindude » 2020-10-04, 09:27

He clearly said he forked 2.0 because later versions were bootstrapped.

User avatar
biopsin
Fanatic
Fanatic
Posts: 128
Joined: 2016-02-07, 17:15

Re: CleanLinks2

Unread post by biopsin » 2020-11-05, 16:30

Heya,
thank you for the extension, it work nicely.

Just some feedback when ever cold starting Pale Moon, I see this entries in error log..

Code: Select all

** Preference parsing warning (line 1) = preserving unexpected JS escape sequence **
** Preference parsing warning (line 2) = preserving unexpected JS escape sequence **
** Preference parsing warning (line 6) = preserving unexpected JS escape sequence **
I did look thru the pref code, but could not find any issues with it..so dunno
voidlinux_x64 glibc-2.41 / compiled latest Palemoon (gcc-14.2.1) / GTK3

0strodamus
Fanatic
Fanatic
Posts: 143
Joined: 2014-11-19, 19:48

Re: CleanLinks2

Unread post by 0strodamus » 2020-11-06, 04:58

You're welcome, I'm glad it is working nicely for you.
I know about the warnings and I also don't know why they are generated. As I recall when creating the extension and quickly looking at it now, it is due to 3 regex preferences that are loaded by the following code.

Code: Select all

this.prefValues[p] = new RegExp('\\b(' + this.prefValues[p] + ')=.+?(&|$)', 'gi');

User avatar
biopsin
Fanatic
Fanatic
Posts: 128
Joined: 2016-02-07, 17:15

Re: CleanLinks2

Unread post by biopsin » 2020-11-06, 07:50

Thank you for the reply,
ok I got it after reading over https://forums.informaction.com/viewtopic.php?f=7&t=22186#p84525.
Seems there is a parsing escape issue in pref after looking at it.

6 instances (line 1) which means line 2 :

Code: Select all

pref('extensions.cleanlinks.skipwhen','auth\?client_id|bing\.com/widget|imgres\?|([Ll]og|[Ss]ign)(in|off|on|out|up)|magnet:|oauth2?|register|ServiceLogin|searchbyimage\?|subscribe|submit\?url=|sVidLoc|verification|watch\?v');
counting the backslashes equals 6

5 instances (line 2) which means line 3 :

Code: Select all

pref('extensions.cleanlinks.removewhen','(?:ref|aff)\w*|_+(?:ga|mk|nc|openstat|share|tn|trk|twitter_|xts)\w*|(?:ad|at|fb|ga|gs|hc|hmb|ns|otm|pk|sc|tt|utm)_\w+|action_\w+_map|(?:algo_(exp|pv)|bts|cmp|coli?|c(r|u|v)?|(d|e)|fb|(d|fb|g|y)cl|igsh|k_click|mb|merchant|(nc|pv|rn)|programme|media|oc|s(hare.?|m|r)?|track|wtr|_(request|trks)|(_branch_match|can|correlation|hsa_cr|int|link)_)id|mr:\w+|mrfcachebuster');
counting the backslashes equals 5

1 instance (line 6) which means line 7 :

Code: Select all

pref('extensions.cleanlinks.baddoms','blabbermouth.net(885fm|search\?[qs])');
counting the backslashes equals 1

However have not manage to resolve these warnings yet..
voidlinux_x64 glibc-2.41 / compiled latest Palemoon (gcc-14.2.1) / GTK3

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2866
Joined: 2012-08-19, 20:32

Re: CleanLinks2

Unread post by back2themoon » 2020-11-06, 17:38

Thank you for this. What are the main differences with Pure URL i.e. can they be used at the same time? Sounds like there's some overlapping, at least on certain features. Or not...?

User avatar
Konrad
Fanatic
Fanatic
Posts: 142
Joined: 2018-11-17, 18:19

Re: CleanLinks2

Unread post by Konrad » 2020-11-06, 17:39

0strodamus, thank you for the add-on!

CleanLinks2 adds the hash symbol “#” at the end of cleaned links. Can a user turn off that option?
For instance, when I open pages on the Pale Moon forum not being logged in, sometimes I see that links contain gibberish. The extension cleans the links but inserts the mentioned symbol that also persists in the address bar.

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

Re: CleanLinks2

Unread post by moonbat » 2020-11-07, 03:34

back2themoon wrote:
2020-11-06, 17:38
Thank you for this. What are the main differences with Pure URL i.e. can they be used at the same time? Sounds like there's some overlapping, at least on certain features. Or not...?
Both perform the same function with a few differences, so there will be some overlap.
"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

0strodamus
Fanatic
Fanatic
Posts: 143
Joined: 2014-11-19, 19:48

Re: CleanLinks2

Unread post by 0strodamus » 2020-11-07, 05:42

back2themoon wrote:
2020-11-06, 17:38
Thank you for this. What are the main differences with Pure URL i.e. can they be used at the same time? Sounds like there's some overlapping, at least on certain features. Or not...?
You're welcome. I would say the biggest difference is being able to harness the power of using regular expressions. You could use them at the same time, but I don't know what the point would be.

Note that if you already are using the original Clean Links, installing CleanLinks2 will replace that extension and use your existing regex preferences.

0strodamus
Fanatic
Fanatic
Posts: 143
Joined: 2014-11-19, 19:48

Re: CleanLinks2

Unread post by 0strodamus » 2020-11-07, 05:48

Konrad wrote:
2020-11-06, 17:39
0strodamus, thank you for the add-on!

CleanLinks2 adds the hash symbol “#” at the end of cleaned links. Can a user turn off that option?
For instance, when I open pages on the Pale Moon forum not being logged in, sometimes I see that links contain gibberish. The extension cleans the links but inserts the mentioned symbol that also persists in the address bar.
No, but you're welcome to fork the code and make whatever changes you like! There are no hidden options.