Created
April 18, 2018 02:47
-
-
Save xujenna/86cd8dbeec5066d6fa3783e1e26fed0a to your computer and use it in GitHub Desktop.
decoded bookmarklet + analysis
This file contains 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
This bookmarklet selects all object, embed, applet, and iframe elements on a webpage, and replaces them with a div that that contains crossed-out text of the tag name that was removed. |
This file contains 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
'use strict'; | |
javascript: { | |
(function() { | |
/** | |
* @param {!Object} view | |
* @return {?} | |
*/ | |
function create(view) { | |
try { | |
var document = view.document; | |
var j; | |
var i; | |
var event; | |
var args; | |
var target; | |
var b; | |
/** @type {number} */ | |
var $processing = 1; | |
var proto; | |
/** @type {number} */ | |
j = 0; | |
for (; event = ["object", "embed", "applet", "iframe"][j]; ++j) { | |
args = document.getElementsByTagName(event); | |
/** @type {number} */ | |
i = args.length - 1; | |
for (; i + 1 && (target = args[i]); --i) { | |
if (j != 3 || !create((proto = target.contentWindow) ? proto : target.contentDocument.defaultView)) { | |
b = document.createElement("div"); | |
b.style.width = target.width; | |
b.style.height = target.height; | |
/** @type {string} */ | |
b.innerHTML = "<del>" + (j == 3 ? "third-party " + event : event) + "</del>"; | |
target.parentNode.replaceChild(b, target); | |
} | |
} | |
} | |
} catch (E) { | |
/** @type {number} */ | |
$processing = 0; | |
} | |
return $processing; | |
} | |
create(self); | |
var i; | |
var child; | |
/** @type {number} */ | |
i = 0; | |
for (; child = frames[i]; ++i) { | |
create(child); | |
} | |
})(); | |
} | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment