Google Search tracking link removal?

knightnet

New Member
Hi all, first post here.

I have a bookmarklet that I've written that removes all of the tracking data from links on the Google Search page.

JavaScript:
const items = document.getElementsByTagName('a'); for (const i of items) { if ( i.onmousedown || i.getAttribute('data-ved') ) {i.removeAttribute("onmousedown");i.removeAttribute("data-ved")} }
I would love to be able to use Adguard to automatically run that on google.com and google.co.uk only. Is there a way to do that?

Many thanks. J.
 

Alex302

Filters Developer
Staff member
Administrator
Hi
Please try
Code:
google.com,google.co.uk#%#(function() { try { const items = document.getElementsByTagName('a'); for (const i of items) { if ( i.onmousedown || i.getAttribute('data-ved') ) {i.removeAttribute("onmousedown");i.removeAttribute("data-ved")} }
} catch (ex) {} })();
 

knightnet

New Member
Please try
Amazing, thanks for that :) Tested and working.

I have to say that I continue to be amazed by the capabilities of AdGuard and that takes a lot after 40+ years in IT
You will be glad to know that it is so good, I actually purchased a family license and now it protects us on desktops and mobiles.

This is my first look at scripts in it though so thanks for the response - I didn't want to get it wrong and mess up my machine. If I get any more requirements like this, I'll know how to approach it now.

Also you can try scriptlets for removing attributes
And I wasn't aware of that, thanks. Also very useful.
 
Top