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);
}
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