Pure URL for Palemoon

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!
0strodamus
Fanatic
Fanatic
Posts: 142
Joined: 2014-11-19, 19:48

Re: Pure URL for Palemoon

Unread post by 0strodamus » 2020-07-16, 01:58

First off, thanks to @moonbat for creating and maintaining this fork. I had a couple of suggestions for Pure URL and I have come prepared with the necessary code changes. I would also be remiss to not mention Diego Casorran and the CleanLinks extension for the inspiration and code that I was able to use as an example of how to do this.

The first is to add highlighting to cleaned URLs. The following code change adds a subtle dotted underline to cleaned URLs. It also adds a tag that can be used to detect cleaned URLs using a CSS userstyle (for example, I change the cursor when hovering over a cleaned URL using Stylish/Stylem).

Code: Select all

diff '--color=auto' -aur a/content/common.jsm b/content/common.jsm
--- a/content/common.jsm	2020-07-09 10:25:58.000000000 -0700
+++ b/content/common.jsm	2020-07-15 18:24:02.714901742 -0700
@@ -216,6 +216,10 @@
 						if(cleaned)
 							href += '?'+cleaned;
 						el.href = href;
+						// show dotted line under cleaned URLs
+						el.style.setProperty('border-bottom', '1px dotted #9f9f8e', 'important');
+						// set link attribute that can be used for CSS userstyle
+						el.setAttribute('data-cleanedurl', orig);
 						Common.linkcount++;
 						Common.printlog("Original link: "+orig+"\nCleaned link:"+href);
 					}
The second is to change the toolbar icon when any cleaned URLs exist on a page. Of course, this change needs a relevant large and small icon added to the extension.

Code: Select all

diff '--color=auto' -aur a/content/init.js b/content/init.js
--- a/content/init.js	2020-07-09 10:26:09.000000000 -0700
+++ b/content/init.js	2020-07-15 18:30:33.004911991 -0700
@@ -377,6 +377,12 @@
 		tabSwitchListener : {
 			QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener","nsISupportsWeakReference"]),
 			onStateChange: function(aWebProgress, aRequest, aFlag, aStatus) {
+                                // change toolbar icon to indicate if any URLs have been cleaned or expanded
+                                if (PureURL.Common.linkcount > 0 || PureURL.Common.expandcount > 0) {
+                                        PureURL.Launch.btnPureURL.setAttribute('trigger',true);
+                                } else {
+                                        PureURL.Launch.btnPureURL.setAttribute('trigger',false);
+                                }
 			},
 			onLocationChange: function(aProgress, aRequest, aURI) {
 				PureURL.Launch.checkURI(aURI);
diff '--color=auto' -aur a/skin/overlay.css b/skin/overlay.css
--- a/skin/overlay.css	2020-07-03 23:44:31.000000000 -0700
+++ b/skin/overlay.css	2020-07-15 18:31:58.651580950 -0700
@@ -48,4 +48,13 @@
 }
 toolbarbutton.button-pureurl4pm,window:not([active="true"]) toolbarbutton.button-pureurl4pm{
 	list-style-image:url('chrome://pureurl4pm/skin/icon-green-small.png');
+}
+
+/* toolbar icon on pages with cleaned URLs */
+
+[iconsize="small"] #button-pureurl4pm[active="true"][trigger="true"] {
+  list-style-image:url('chrome://pureurl4pm/skin/icon16-active.png');
+}
+#button-pureurl4pm[active="true"][trigger="true"] {
+  list-style-image:url('chrome://pureurl4pm/skin/icon24-active.png');
 }
\ No newline at end of file
I have been using the extension with these changes for a few days now and haven't detected any issues. I just thought I would share if anyone else finds them useful, regardless of whether they make it into the official extension or not. I would also welcome any suggested improvements.

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-16, 04:18

Great idea! I could directly add these patches but if you'd like to co contribute on Gitlab where it's hosted, I can add you there as well.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by 0strodamus » 2020-07-16, 05:18

Thanks for your generous offer, but I'm not ready to become a Gitlab contributor. If that changes, I'll let you know. Feel free to use the patches, just make sure to vet them well! ;)

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-16, 06:38

0strodamus wrote:
2020-07-16, 01:58
The second is to change the toolbar icon when any cleaned URLs exist on a page.
This is covered by the tooltip - it has to indicate processed requests and expanded shortlinks as well after all so just one icon change won't cut it.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-16, 07:01

Changelog for 3.1
  • Highlight cleaned links on page with grey dotted line. (Thanks 0strodamus!)
  • Add 0strodamus as contributor in install.rdf.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-17, 13:59

Changelog for 3.1.1
  • Fix for options dialog not resizing with Milestone 10 theme on Mac OS (thanks FranklinDM)
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-24, 06:31

Changelog for 3.1.2
  • Fix incorrect call to unregister.
  • Added fbrefresh,pcampaignid to garbage field list.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-07-30, 13:46

Changelog for 3.1.4
  • Fix menu icons not showing if using custom theme.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
bawldiggle
Lunatic
Lunatic
Posts: 446
Joined: 2013-02-22, 21:16
Location: East Coast Australia

Re: Pure URL for Palemoon

Unread post by bawldiggle » 2020-08-20, 00:25

"Pure URL" button/dropdown v3.1.4
I am vision impaired
On addons page; btn/ddn is blank leaving a big gap on the extensions bar. Missing teeth.
A bit disconcerting at first ... until my screenshot revealed very pale 'disabled" state.
I appreciate there is a difference between disabled and hidden states.
disappears on Addons page.png
disappears on Addons page.png (19.16 KiB) Viewed 1004 times
I am using default Pale Moon theme.

Any chance of making the "disabled" state a bit more obvious for sight impaired ... ?
I have problems with contrast detection ... dark grey on light grey.
My problem I know ... any suggestions would be appreciated.

Thank you :thumbup:
Win-7 PRO 64-bit
Palemoon; auto updates current version (32-bit)

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-20, 01:31

The button gets disabled when you're not on a webpage, like an about page or an FTP site since it doesn't make sense there.
Try this build, I've hiked opacity to 50%.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-20, 07:08

bawldiggle wrote:
2020-08-20, 00:25
My problem I know ... any suggestions would be appreciated
So did you try it out? If it works for you I'll make a release.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-20, 12:05

Changelog for 3.2.1
  • Toolbar button enable/disable works correctly now when added manually from the
    toolbar customization window depending on the currently open page.
  • Add fields guccounter,guce_referrer,guce_referrer_sig.
  • Change cleaned link attribute to 'pureurl-cleaned'.
  • Add uninstall listener to clean up settings after uninstall.
Changelog for 3.2
  • Increased opacity of disabled icon to 50%.
  • NEW FEATURE: Filter 'friendly' URLs without ? for query parameters, as seen
    on Amazon.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

glaurung

Re: Pure URL for Palemoon

Unread post by glaurung » 2020-08-21, 01:44

As of today's update, trying to search on google.com gets a 404 error, with the message
"The requested URL /https://www.google.com/ was not found on this server."

This happens even with all other add ons disabled. Turning off pureurl makes Google work normally again.

I tried removing the three new filters mentioned in the release notes for the new version, that didn't help.

User avatar
zelea2
Apollo supporter
Apollo supporter
Posts: 34
Joined: 2019-02-02, 00:56
Location: UK

Re: Pure URL for Palemoon

Unread post by zelea2 » 2020-08-21, 02:19

Pure URL 3.2.1 breaks google searches for me. Actually the search itself works but any links you click the page doesn't open.

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-21, 04:23

I'll take a look. Haven't used Google to search in more than a decade.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
fatboy
Astronaut
Astronaut
Posts: 556
Joined: 2017-12-19, 08:03
Location: Canada

Re: Pure URL for Palemoon

Unread post by fatboy » 2020-08-21, 08:07

zelea2 wrote:
2020-08-21, 02:19
Pure URL 3.2.1 breaks google searches for me. Actually the search itself works but any links you click the page doesn't open.
Could this breakages be due to Google inserting tracking code in the url?
Systemd Free - MX Linux, Antix Linux & Artix Linux

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-21, 08:14

No, it's a problem with the update. I'd recommend going back to 3.1.4 and disabling auto update for it until it's sorted - you can find it on the previous versions link on the addon page.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
billmcct
Keeps coming back
Keeps coming back
Posts: 954
Joined: 2012-09-04, 15:19
Location: Costa Rica & Union City Georgia USA

Re: Pure URL for Palemoon

Unread post by billmcct » 2020-08-21, 09:34

It not only affects Google search but about 20 other search engines I tested.
--------------------------------------------------------------------------------------------------------------
The difference between the Impossible and the Possible lies in a man's Determination.
Tommy Lasorda

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

Re: Pure URL for Palemoon

Unread post by moonbat » 2020-08-21, 13:45

Changelog for 3.2.2
  • Backed out friendly URL filtering till there's a proper fix.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

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

Re: Pure URL for Palemoon

Unread post by _yuyu_ » 2020-08-21, 14:06

@moonbat
Can you please also take a look at the Options... item in the drop-down menu. It is grayed out now if Show in Tools Menu is not checked. It was OK in 3.1.4.
Pale Moon 32-bit on Win 7 x64

Post Reply