|
|
@ -1,42 +1,33 @@
|
|
|
|
(function() {
|
|
|
|
(function() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
var i, environmentVars = '', e = document.createEvent('Events');
|
|
|
|
var i, environmentVars = '', eEnv = document.createEvent('Events'), container = document.getElementById('wappalyzerData');
|
|
|
|
|
|
|
|
|
|
|
|
e.initEvent('wappalyzerEvent', true, false);
|
|
|
|
eEnv.initEvent('wappalyzerEnvEvent', true, false);
|
|
|
|
|
|
|
|
|
|
|
|
for ( i in window ) {
|
|
|
|
for ( i in window ) {
|
|
|
|
environmentVars += i + ' ';
|
|
|
|
environmentVars += i + ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
container.appendChild(document.createComment(environmentVars));
|
|
|
|
|
|
|
|
container.dispatchEvent(eEnv);
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('wappalyzerData').appendChild(document.createComment(environmentVars));
|
|
|
|
window.addEventListener('message', (event => {
|
|
|
|
document.getElementById('wappalyzerData').dispatchEvent(e);
|
|
|
|
if (event.data.patterns === undefined)
|
|
|
|
|
|
|
|
return;
|
|
|
|
// Handle property match
|
|
|
|
var properties = event.data.patterns;
|
|
|
|
browser.runtime.sendMessage({
|
|
|
|
|
|
|
|
id: 'JS_ready',
|
|
|
|
|
|
|
|
subject: { },
|
|
|
|
|
|
|
|
source: 'inject.js'
|
|
|
|
|
|
|
|
}, response => {
|
|
|
|
|
|
|
|
var properties = response.patterns;
|
|
|
|
|
|
|
|
var js = {};
|
|
|
|
var js = {};
|
|
|
|
Object.keys(properties).forEach(app => {
|
|
|
|
Object.keys(properties).forEach(appname => {
|
|
|
|
Object.keys(properties[app]).forEach(property => {
|
|
|
|
Object.keys(properties[appname]).forEach(property => {
|
|
|
|
var content = false;
|
|
|
|
var content = false;
|
|
|
|
if( content = JSdetection(property) ){
|
|
|
|
if( content = JSdetection(property) ){
|
|
|
|
if ( js[appname] === undefined ) {
|
|
|
|
if ( js[appname] === undefined )
|
|
|
|
js[appname] = {};
|
|
|
|
js[appname] = {};
|
|
|
|
}
|
|
|
|
js[appname][property] = properties[appname][property];
|
|
|
|
js[appname][property] = properties[app][property];
|
|
|
|
|
|
|
|
js[appname][property]["content"] = content;
|
|
|
|
js[appname][property]["content"] = content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
browser.runtime.sendMessage({
|
|
|
|
window.postMessage({js: js}, "*");
|
|
|
|
id: 'analyze',
|
|
|
|
}), false);
|
|
|
|
subject: { js },
|
|
|
|
|
|
|
|
source: 'inject.js'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch(e) {
|
|
|
|
} catch(e) {
|
|
|
|
// Fail quietly
|
|
|
|
// Fail quietly
|
|
|
|
}
|
|
|
|
}
|
|
|
|