Skip to content

Instantly share code, notes, and snippets.

@958
Created March 4, 2009 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 958/73702 to your computer and use it in GitHub Desktop.
Save 958/73702 to your computer and use it in GitHub Desktop.
[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