Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Sleipnir]No Click Jacking
// ==UserScript==
// @name No Click Jacking
// @include http*
// ==/UserScript==
(function(){
var deep = true;
var opacityCancel = function(node){
var filter = node.currentStyle['filter'];
if (filter.indexOf('opacity') != -1)
node.style.filter = 'alpha(opacity=100)';
};
var iframes = document.getElementsByTagName('iframe');
for (var i = 0, l = iframes.length; i < l; i++) {
var filter = iframes[i].currentStyle['filter'];
if (deep)
(function(node){
while(node && node.nodeName != 'BODY' && node.currentStyle){
opacityCancel(node);
node = node.parentNode;
}
})(iframes[i]);
else
opacityCancel(iframes[i]);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment