parent
ccb04dde94
commit
aea6135586
@ -1,31 +1,33 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var lastEnv = [];
|
var lastEnv = [];
|
||||||
|
|
||||||
if ( document.contentType === 'text/html' ) {
|
try {
|
||||||
var
|
if ( document && document.documentElement && document.contentType === 'text/html' ) {
|
||||||
html = document.documentElement.outerHTML
|
var
|
||||||
env = [];
|
html = document.documentElement.outerHTML
|
||||||
|
env = [];
|
||||||
|
|
||||||
self.port.emit('log', 'init');
|
self.port.emit('log', 'init');
|
||||||
|
|
||||||
if ( html.length > 50000 ) {
|
if ( html.length > 50000 ) {
|
||||||
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
|
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.port.emit('analyze', {
|
|
||||||
hostname: location.hostname,
|
|
||||||
url: location.href,
|
|
||||||
analyze: { html: html }
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
var env = Object.keys(unsafeWindow).slice(0, 500);
|
|
||||||
|
|
||||||
self.port.emit('analyze', {
|
self.port.emit('analyze', {
|
||||||
hostname: location.hostname,
|
hostname: location.hostname,
|
||||||
url: location.href,
|
url: location.href,
|
||||||
analyze: { env: env }
|
analyze: { html: html }
|
||||||
});
|
});
|
||||||
}, 1000);
|
|
||||||
}
|
setTimeout(function() {
|
||||||
|
var env = Object.keys(unsafeWindow).slice(0, 500);
|
||||||
|
|
||||||
|
self.port.emit('analyze', {
|
||||||
|
hostname: location.hostname,
|
||||||
|
url: location.href,
|
||||||
|
analyze: { env: env }
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
}());
|
}());
|
||||||
|
Reference in new issue