-
Notifications
You must be signed in to change notification settings - Fork 1
/
getiframe.js
31 lines (31 loc) · 961 Bytes
/
getiframe.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
(function () {
var _0x4e2fd8 = document.querySelectorAll("iframe");
if (_0x4e2fd8.length > 0) {
var _0x51b146 = [];
_0x4e2fd8.forEach(_0x11e95c => {
try {
var _0x55afa6 = _0x11e95c.contentDocument || _0x11e95c.contentWindow.document;
var _0x258abf = _0x55afa6.documentElement.innerHTML;
_0x51b146.push({
src: _0x11e95c.src,
content: _0x258abf
});
} catch (_0x59fae9) {
console.error("Unable to access iframe contents:", _0x59fae9);
_0x51b146.push({
src: _0x11e95c.src,
content: "Content not accessible"
});
}
});
chrome.runtime.sendMessage({
action: "sendIframeContents",
data: _0x51b146
});
} else {
chrome.runtime.sendMessage({
action: "sendIframeContents",
data: "iframe not found."
});
}
})();