-
Notifications
You must be signed in to change notification settings - Fork 78
/
main.js
33 lines (28 loc) · 870 Bytes
/
main.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
/**
* Chrome AppSniffer
*
* Detect apps run on current page and send back to background page.
* Some part of this script was refered from Wappalyzer Firefox Addon.
*
* @author Bao Nguyen <[email protected]>
* @license GPLv3
**/
(function () {
var head = document.getElementsByTagName('head')[0];
if (head) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = chrome.extension.getURL('detector.js');
var meta = document.createElement('meta');
meta.name = 'chromesniffer';
meta.id = 'chromesniffer_meta';
head.appendChild(meta);
head.appendChild(script);
meta.addEventListener('ready', function () {
var apps = JSON.parse(meta.content);
if (Object.keys(apps).length > 0) {
chrome.extension.sendMessage({msg: "result", apps: apps});
}
});
}
})();