1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

context provided in title attr of URL in logger (until I figure a better way)

This commit is contained in:
gorhill 2015-06-04 19:27:03 -04:00
parent 4528122268
commit 53a78ceb39
4 changed files with 69 additions and 7 deletions

View File

@ -181,6 +181,7 @@ var createCellAt = function(tr, index) {
} }
if ( td ) { if ( td ) {
td.removeAttribute('colspan'); td.removeAttribute('colspan');
td.removeAttribute('title');
td.textContent = ''; td.textContent = '';
} else { } else {
td = document.createElement('td'); td = document.createElement('td');
@ -299,7 +300,11 @@ var renderNetLogEntry = function(tr, entry) {
} }
tr.cells[4].textContent = (prettyRequestTypes[type] || type); tr.cells[4].textContent = (prettyRequestTypes[type] || type);
tr.cells[5].appendChild(nodeFromURL(url, filter)); td = tr.cells[5];
td.appendChild(nodeFromURL(url, filter));
if ( entry.d4 ) {
td.setAttribute('title', entry.d4);
}
}; };
/******************************************************************************/ /******************************************************************************/

View File

@ -58,6 +58,7 @@ LogEntry.prototype.init = function(args) {
this.d1 = args[3]; this.d1 = args[3];
this.d2 = args[4]; this.d2 = args[4];
this.d3 = args[5]; this.d3 = args[5];
this.d4 = args[6];
return this; return this;
}; };
@ -66,7 +67,7 @@ LogEntry.prototype.init = function(args) {
LogEntry.prototype.dispose = function() { LogEntry.prototype.dispose = function() {
this.tstamp = 0; this.tstamp = 0;
this.tab = this.cat = ''; this.tab = this.cat = '';
this.d0 = this.d1 = this.d2 = this.d3 = undefined; this.d0 = this.d1 = this.d2 = this.d3 = this.d4 = undefined;
if ( logEntryJunkyard.length < logEntryJunkyardMax ) { if ( logEntryJunkyard.length < logEntryJunkyardMax ) {
logEntryJunkyard.push(this); logEntryJunkyard.push(this);
} }

View File

@ -513,6 +513,7 @@ vAPI.tabs.onPopup = function(details) {
result, result,
'popup', 'popup',
targetURL, targetURL,
openerHostname,
openerHostname openerHostname
); );

View File

@ -92,7 +92,18 @@ var onBeforeRequest = function(details) {
// Possible outcomes: blocked, allowed-passthru, allowed-mirror // Possible outcomes: blocked, allowed-passthru, allowed-mirror
pageStore.logRequest(requestContext, result); pageStore.logRequest(requestContext, result);
µb.logger.writeOne(tabId, 'net', result, requestType, requestURL, requestContext.rootHostname);
if ( µb.logger.isEnabled() ) {
µb.logger.writeOne(
tabId,
'net',
result,
requestType,
requestURL,
requestContext.rootHostname,
requestContext.pageHostname
);
}
// Not blocked // Not blocked
if ( µb.isAllowResult(result) ) { if ( µb.isAllowResult(result) ) {
@ -187,7 +198,18 @@ var onBeforeRootFrameRequest = function(details) {
if ( pageStore ) { if ( pageStore ) {
pageStore.logRequest(context, result); pageStore.logRequest(context, result);
} }
µb.logger.writeOne(tabId, 'net', result, 'main_frame', requestURL, context.rootHostname);
if ( µb.logger.isEnabled() ) {
µb.logger.writeOne(
tabId,
'net',
result,
'main_frame',
requestURL,
requestHostname,
requestHostname
);
}
// Not blocked // Not blocked
if ( µb.isAllowResult(result) ) { if ( µb.isAllowResult(result) ) {
@ -279,7 +301,18 @@ var onBeforeBehindTheSceneRequest = function(details) {
} }
pageStore.logRequest(context, result); pageStore.logRequest(context, result);
µb.logger.writeOne(vAPI.noTabId, 'net', result, details.type, details.url, context.rootHostname);
if ( µb.logger.isEnabled() ) {
µb.logger.writeOne(
vAPI.noTabId,
'net',
result,
details.type,
details.url,
context.rootHostname,
context.rootHostname
);
}
// Not blocked // Not blocked
if ( µb.isAllowResult(result) ) { if ( µb.isAllowResult(result) ) {
@ -328,7 +361,18 @@ var onHeadersReceived = function(details) {
var result = pageStore.filterRequestNoCache(context); var result = pageStore.filterRequestNoCache(context);
pageStore.logRequest(context, result); pageStore.logRequest(context, result);
µb.logger.writeOne(tabId, 'net', result, 'inline-script', details.url, context.rootHostname);
if ( µb.logger.isEnabled() ) {
µb.logger.writeOne(
tabId,
'net',
result,
'inline-script',
details.url,
context.rootHostname,
context.pageHostname
);
}
// Don't block // Don't block
if ( µb.isAllowResult(result) ) { if ( µb.isAllowResult(result) ) {
@ -368,7 +412,18 @@ var onRootFrameHeadersReceived = function(details) {
var result = pageStore.filterRequestNoCache(context); var result = pageStore.filterRequestNoCache(context);
pageStore.logRequest(context, result); pageStore.logRequest(context, result);
µb.logger.writeOne(tabId, 'net', result, 'inline-script', details.url, context.rootHostname);
if ( µb.logger.isEnabled() ) {
µb.logger.writeOne(
tabId,
'net',
result,
'inline-script',
details.url,
context.rootHostname,
context.pageHostname
);
}
// Don't block // Don't block
if ( µb.isAllowResult(result) ) { if ( µb.isAllowResult(result) ) {