Clean Links - disappearing button
Moderators: FranklinDM, Lootyhoof
Re: Clean Links - disappearing button
It would be great to toggle extensions.cleanlinks.enabled state by a CustomButton script, but as far as I know, it affects only on/off state, i.e. yellow/grey icon.
Pale Moon 32-bit on Win 7 x64
Re: Clean Links - disappearing button
Try changing line 34 of browser.js. ("cleanlinks = {" does not look like a constant to me).
Change from:
Change to:
Note that the Clean Links toolbar button is stable (doesn't disappear) on my installation of PM28. However, I had not used the Clean Links extension, prior to today and prior to this change. Accordingly, this change may not continue to work long-term or for other users.
Change from:
Code: Select all
const cleanlinks = {
Code: Select all
var cleanlinks = {
Re: Clean Links - disappearing button
Thanks ...this works for me on PM v 28.1 32 bit running on GNU/Linux and same for 64 bit (on toolbar)riiis wrote:Try changing line 34 of browser.js. ("cleanlinks = {" does not look like a constant to me).
Change from:Change to:Code: Select all
const cleanlinks = {
Note that the Clean Links toolbar button is stable (doesn't disappear) on my installation of PM28. However, I had not used the Clean Links extension, prior to today and prior to this change. Accordingly, this change may not continue to work long-term or for other users.Code: Select all
var cleanlinks = {
Re: Clean Links - disappearing button
Kruppt, can you confirm that the disaeppering button problem disappeared for you after the code change?Kruppt wrote:Thanks ...this works for me on PM v 28.1 32 bit running on GNU/Linux and same for 64 bit (on toolbar)riiis wrote:Try changing line 34 of browser.js.
Having previously tested CleanLinks in conjunction with several other extensions, it was specifically the presence of the FoxyProxy extension that made the button disappear on startup persistently. If I disable FoxyProxy the CleanLinks button automatically appears at next browser startup.
Although it is this specific extension combination that causes a problem for CleanLinks, note that the combination of these two extensions (same versions) did not cause a problem in Firefox 45ESR. So, there is something in Pale Moon 28 that causes a difference at startup.
Note: that when the button that disappears at startup CleanLinks is in disabled state.
PS: I also tried this with Pale Mon 28.1.0: makes no difference.
Last edited by 50addons on 2018-09-22, 08:44, edited 3 times in total.
Re: Clean Links - disappearing button
The suggested fix indicates that the extension isn't taking into account that we now use a global JS scope. Using 'let' or 'const' at the top level will no longer work properly (if you expect isolation) as a result and if there are name conflicts they will not be resolved on a modular level, but globally (usually first come first serve). Foxyproxy may introduce a name conflict.
Last edited by Moonchild on 2018-09-22, 08:47, edited 1 time in total.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: Clean Links - disappearing button
Thanks for a great explanation. I'll check this out.Moonchild wrote:The suggested fix indicates that the extension isn't taking into account that we now use a global JS scope. [...] Foxyproxy may introduce a name conflict.
Off-topic:
Everytime I see your avatar I wonder: do you actually have a dog?
Everytime I see your avatar I wonder: do you actually have a dog?
Re: Clean Links - disappearing button
Off-topic:
For most of my life. Currently I don't since my dog passed away earlier this year.50addons wrote:Everytime I see your avatar I wonder: do you actually have a dog?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: Clean Links - disappearing button
Off-topic:
Och, thats' sad. They really are our best friends.Moonchild wrote:For most of my life. Currently I don't since my dog passed away earlier this year.50addons wrote:Everytime I see your avatar I wonder: do you actually have a dog?
If there was a name conflict, why then is it possible to manually enable CleanLinks after startup so both extensions work concurrently?Moonchild wrote:The suggested fix indicates that the extension isn't taking into account that we now use a global JS scope. [...] Foxyproxy may introduce a name conflict.
I tried the suggested fix but it didn't work.
Re: Clean Links - disappearing button
The "cleanlinks" variable is a "wrapper". It wraps lines 34 through 645 of "browser.js" into a single variable name (effectively preventing variable or function names (enclosed within lines 34 through 645) from conflicting with names used by other extensions).50addons wrote:If there was a name conflict, why then is it possible to manually enable CleanLinks after startup so both extensions work concurrently? I tried the suggested fix but it didn't work.
Sorry the suggested fix, above, did not work for you. Following is another possible fix you might try.
I found 3 instances where the Clean Links code checks for browser version. The following code changes remove these version checks, removing a possible source of the errors you're experiencing.
Change lines 25 through 32 of browser.js (removes check for versions > 29 ).
Change from:
Code: Select all
try {
let {XPIProvider:xS} = Cu.import('resource://gre/modules/'
+('')+'XPIProvider.jsm', {});
if((xS = xS.bootstrapScopes['{c9d31470-81c6-4e3e-9a37-46eb9237ed3a}']))
handledElsewhere = function(n) !!xS.getProvider(n,xS.getPrefs());
} catch(e) {
Cu.reportError(e);
}
Change from:
Code: Select all
: (
new copyLinkController(window)
);
Change from:
Code: Select all
XPCOMUtils.defineLazyGetter(this, 'aUI', function() {
});
Re: Clean Links - disappearing button
@riiis, thank you very much for all your help!riiis wrote:Sorry the suggested fix, above, did not work for you. Following is another possible fix you might try.
I just applied these changes and installed the new CleanLinks in my test profile, which only contains the two extensions (CleanLinks + FoxyProxy).
As before, I can bring CleanLinks and its button back with the disable/enable sequence.
The error message on startup has indeed disappeared. However, after startup CleanLinks is deactivated and the button is not there.
I am not convinced that the error messages I posted above have anything to do with the startup problem.
Re: Clean Links - disappearing button
I looked at this issue one more time. IMO it would probably be easier to write a new extension from scratch, to do what Clean Links does, than to fix Clean Links for FoxyProxy.50addons wrote:I just applied these changes and installed the new CleanLinks in my test profile, which only contains the two extensions (CleanLinks + FoxyProxy).
As before, I can bring CleanLinks and its button back with the disable/enable sequence.
As an alternative add-on to Clean Links, you might try Pure URL (version 1.2.6). Pure URL 1.2.6 appears to be compatible with Pale Moon 28, even though AMO lists Pure URL 1.2.6 as not compatible. To install, first download Pure URL 1.2.6 from AMO. Then install Pure URL from the downloaded xpi file. Note that "Pure URL Version 1.2.4.1-signed.1-signed" is shown as compatible with Pale Moon, but really isn't compatible. Pale Moon 28 actually installed version 1.2.4 on my computer, even though it contains a "harness-options.json" file (i.e. old sdk no longer supported by Pale Moon).
The Clean Links website states that Clean Links "Converts obfuscated/nested links to genuine clean links". Ironically, Clean Links can not be easily fixed for FoxyProxy, primarily because the Clean Links xpi file includes vast quantities of obfuscated/nested javascript (rather than genuine "clean" javascript).
Re: Clean Links - disappearing button
It's a shame because CleanLinks had a few good features but it does seem rather convoluted.riiis wrote:I looked at this issue one more time. IMO it would probably be easier to write a new extension from scratch, to do what Clean Links does, than to fix Clean Links for FoxyProxy.
Many thanks for all your help.