-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathiframes.js
39 lines (38 loc) · 2.73 KB
/
iframes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
javascript: (function() {
function callback() {
function l() {
$("span").remove(".openSpan, .closeSpan, .inputSpan");
var iframes = $('iframe').not('iframe[aria-hidden=true]');
$(iframes).each(function() {
$(this).attr('style','outline:green 2px dashed;padding:2px;');
if(!$(this).attr('title')) {
if($(this).attr('name')) {
$(this).before("<span class=\"inputSpan\" style=\"padding:1px;color:black;font-weight:bold;font-family:sans-serif;font-size:small;outline:red 2px dotted;background-color:yellow;z-index:2147483647;\"><iframe❌NO TITLE name=\""+$(this).attr('name')+"\" src=\""+$(this).attr('src')+"\"></span>");
} else {
$(this).before("<span class=\"inputSpan\" style=\"padding:1px;color:black;font-weight:bold;font-family:sans-serif;font-size:small;outline:red 2px dotted;background-color:yellow;z-index:2147483647;\"><iframe❌NO TITLE src=\""+$(this).attr('src')+"\"></span>");
}
$(this).attr('style','outline:red 2px dotted;padding:2px;');
} else {
if($(this).attr('name')) {
$(this).before("<span class=\"inputSpan\" style=\"padding:1px;color:black;font-weight:bold;font-family:sans-serif;font-size:small;outline:green 2px solid;background-color:yellow;z-index:2147483647;\"><iframe👍title=\""+$(this).attr('title')+"\" name=\""+$(this).attr('name')+"\" src=\""+$(this).attr('src')+"\"></span>");
} else {
$(this).before("<span class=\"inputSpan\" style=\"padding:1px;color:black;font-weight:bold;font-family:sans-serif;font-size:small;outline:green 2px solid;background-color:yellow;z-index:2147483647;\"><iframe👍title=\""+$(this).attr('title')+"\" src=\""+$(this).attr('src')+"\"></span>");
}
}
});
if (!$(iframes).length) {
$('body').prepend('<strong style="color:black;font-weight:bold;font-family:sans-serif;font-size:small;background-color:yellow;margin:0 2px; padding:2px;" id="failure" role="status"></strong>');
$('#failure').html('No Iframes Found on Page: ' + document.title);
setTimeout(function(){ $('#failure').remove(); }, 6000);
} else {
$('body').append('<div id="success" role="alert" style="position:absolute; width:0; height:0; clip: rect(0,0,0,0);"></div>');
$('#success').html('Success! Iframes Found on Page: ' + document.title);
setTimeout(function(){ $('#success').remove(); }, 3000);
}
$("script[src$='iframes.js']").remove();s.remove();
}
l()
}
var s = document.createElement("script");
s.addEventListener ? s.addEventListener("load", callback, !1) : s.readyState && (s.onreadystatechange = callback), s.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", document.body.appendChild(s);
})()