-
-
Save Loskir/12a70bd0143bd51d2c64245b3e859a73 to your computer and use it in GitHub Desktop.
Prevent Google from mangling links on the search results when clicking or copying on Firefox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Prevent link mangling on Google and Yandex | |
// @namespace LordBusiness.LMG | |
// @match https://www.google.com/search | |
// @match https://yandex.ru/search* | |
// @version 1.2 | |
// @author radiantly | |
// @description Prevent Google and Yandex from mangling the link when copying or clicking the link | |
// ==/UserScript== | |
/* | |
* To install this script, you'll need a user script manager like ViolentMonkey, after which you | |
* can click the Raw button (gist.github.com) to install. | |
*/ | |
(function() { | |
/* | |
* The following 3 lines simply prevent the mousedown event from propagating to the respective | |
* event listeners attached to the various link elements. | |
* | |
* On testing, this does not seem to break any actual functionality on the site. | |
*/ | |
window.addEventListener("mousedown", (event) => { | |
event.stopImmediatePropagation(); | |
}, true); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment