Skip to content

Instantly share code, notes, and snippets.

@michaelmob
Last active March 25, 2016 23:09
Show Gist options
  • Save michaelmob/26fbdb110b72327357b2 to your computer and use it in GitHub Desktop.
Save michaelmob/26fbdb110b72327357b2 to your computer and use it in GitHub Desktop.
Removes Google's Click Hijacking from search results.
// ==UserScript==
// @name Google Click Hijacking Killer
// @version 1
// @namespace GCHK
// @description Remove Google's Click Hijacking
// @include http://www.google.com/search*
// @include https://www.google.com/search*
// @grant none
// ==/UserScript==
function removeHijack(e) {
for (var i = e.length - 1; i >= 0; i--)
e[i].childNodes[0].removeAttribute("onmousedown");
};
/*function onStyleChange(e, fx) {
var observer = new MutationObserver(function(mutations) {
mutations.forEach(fx);
}).observe(e, { attributes : true, attributeFilter : ["style"] });
};*/
window.onload = function() {
removeHijack(document.getElementsByClassName("r"));
/*onStyleChange(document.getElementById("irc_cc"), function() {
// Remove Image View Clickjacking
});*/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment