|
@ -33,7 +33,8 @@ var tbody = document.querySelector('#content tbody'); |
|
|
var trJunkyard = []; |
|
|
var trJunkyard = []; |
|
|
var tdJunkyard = []; |
|
|
var tdJunkyard = []; |
|
|
var firstVarDataCol = 1; // currently, column 2 (0-based index)
|
|
|
var firstVarDataCol = 1; // currently, column 2 (0-based index)
|
|
|
var lastVarDataIndex = 4; // currently, 5 columns at most
|
|
|
|
|
|
|
|
|
var lastVarDataIndex = |
|
|
|
|
|
document.querySelector('#content colgroup').childElementCount - 1; |
|
|
var maxEntries = 0; |
|
|
var maxEntries = 0; |
|
|
var noTabId = ''; |
|
|
var noTabId = ''; |
|
|
var pageStores = new Map(); |
|
|
var pageStores = new Map(); |
|
@ -85,6 +86,44 @@ let prependChild = function(parent, child) { |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
// We will lookup domains locally.
|
|
|
|
|
|
|
|
|
|
|
|
let domainFromSrcHostname = (function() { |
|
|
|
|
|
let srcHn = '', srcDn = ''; |
|
|
|
|
|
return function(hn) { |
|
|
|
|
|
if ( hn !== srcHn ) { |
|
|
|
|
|
srcHn = hn; |
|
|
|
|
|
srcDn = publicSuffixList.getDomain(hn); |
|
|
|
|
|
} |
|
|
|
|
|
return srcDn; |
|
|
|
|
|
}; |
|
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
let domainFromDesHostname = (function() { |
|
|
|
|
|
let desHn = '', desDn = ''; |
|
|
|
|
|
return function(hn) { |
|
|
|
|
|
if ( hn !== desHn ) { |
|
|
|
|
|
desHn = hn; |
|
|
|
|
|
desDn = publicSuffixList.getDomain(hn); |
|
|
|
|
|
} |
|
|
|
|
|
return desDn; |
|
|
|
|
|
}; |
|
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
let is3rdParty = function(srcHn, desHn) { |
|
|
|
|
|
return domainFromSrcHostname(srcHn) !== domainFromDesHostname(desHn); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
vAPI.messaging.send( |
|
|
|
|
|
'logger-ui.js', |
|
|
|
|
|
{ what: 'getPublicSuffixListData' }, |
|
|
|
|
|
response => { |
|
|
|
|
|
publicSuffixList.fromSelfie(response); |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
// Emphasize hostname and cookie name.
|
|
|
// Emphasize hostname and cookie name.
|
|
|
|
|
|
|
|
|
var emphasizeCookie = function(s) { |
|
|
var emphasizeCookie = function(s) { |
|
@ -249,7 +288,7 @@ var renderLogEntry = function(entry) { |
|
|
tr.cells[fvdc].textContent = details.info; |
|
|
tr.cells[fvdc].textContent = details.info; |
|
|
} |
|
|
} |
|
|
} else if ( details.srcHn !== undefined && details.desHn !== undefined ) { |
|
|
} else if ( details.srcHn !== undefined && details.desHn !== undefined ) { |
|
|
tr = createRow('1111'); |
|
|
|
|
|
|
|
|
tr = createRow('11111'); |
|
|
tr.classList.add('canMtx'); |
|
|
tr.classList.add('canMtx'); |
|
|
tr.classList.add('cat_net'); |
|
|
tr.classList.add('cat_net'); |
|
|
tr.setAttribute('data-srchn', details.srcHn); |
|
|
tr.setAttribute('data-srchn', details.srcHn); |
|
@ -267,14 +306,17 @@ var renderLogEntry = function(entry) { |
|
|
} else { |
|
|
} else { |
|
|
tr.cells[fvdc+1].textContent = ''; |
|
|
tr.cells[fvdc+1].textContent = ''; |
|
|
} |
|
|
} |
|
|
tr.cells[fvdc+2].textContent = (prettyRequestTypes[details.type] || details.type); |
|
|
|
|
|
|
|
|
tr.cells[fvdc+2].textContent = |
|
|
|
|
|
prettyRequestTypes[details.type] || details.type; |
|
|
if ( dontEmphasizeSet.has(details.type) ) { |
|
|
if ( dontEmphasizeSet.has(details.type) ) { |
|
|
tr.cells[fvdc+3].textContent = details.desURL; |
|
|
tr.cells[fvdc+3].textContent = details.desURL; |
|
|
} else { |
|
|
} else { |
|
|
tr.cells[fvdc+3].appendChild(emphasizeHostname(details.desURL)); |
|
|
tr.cells[fvdc+3].appendChild(emphasizeHostname(details.desURL)); |
|
|
} |
|
|
} |
|
|
|
|
|
tr.cells[fvdc+4].textContent = |
|
|
|
|
|
is3rdParty(details.srcHn, details.desHn) ? '3p' : ''; |
|
|
} else if ( details.header ) { |
|
|
} else if ( details.header ) { |
|
|
tr = createRow('1111'); |
|
|
|
|
|
|
|
|
tr = createRow('11111'); |
|
|
tr.classList.add('canMtx'); |
|
|
tr.classList.add('canMtx'); |
|
|
tr.classList.add('cat_net'); |
|
|
tr.classList.add('cat_net'); |
|
|
tr.cells[fvdc+0].textContent = details.srcHn || ''; |
|
|
tr.cells[fvdc+0].textContent = details.srcHn || ''; |
|
@ -286,6 +328,7 @@ var renderLogEntry = function(entry) { |
|
|
} |
|
|
} |
|
|
tr.cells[fvdc+2].textContent = details.header.name; |
|
|
tr.cells[fvdc+2].textContent = details.header.name; |
|
|
tr.cells[fvdc+3].textContent = details.header.value; |
|
|
tr.cells[fvdc+3].textContent = details.header.value; |
|
|
|
|
|
tr.cells[fvdc+4].textContent = ''; |
|
|
} else { |
|
|
} else { |
|
|
tr = createRow('1'); |
|
|
tr = createRow('1'); |
|
|
tr.cells[fvdc].textContent = 'huh?'; |
|
|
tr.cells[fvdc].textContent = 'huh?'; |
|
@ -1033,40 +1076,6 @@ window.addEventListener('beforeunload', releaseView); |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
// We will lookup domains locally.
|
|
|
|
|
|
|
|
|
|
|
|
let domainFromSrcHostname = (function() { |
|
|
|
|
|
let srcHn = '', srcDn = ''; |
|
|
|
|
|
return function(hn) { |
|
|
|
|
|
if ( hn !== srcHn ) { |
|
|
|
|
|
srcHn = hn; |
|
|
|
|
|
srcDn = publicSuffixList.getDomain(hn); |
|
|
|
|
|
} |
|
|
|
|
|
return srcDn; |
|
|
|
|
|
}; |
|
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
let domainFromDesHostname = (function() { |
|
|
|
|
|
let desHn = '', desDn = ''; |
|
|
|
|
|
return function(hn) { |
|
|
|
|
|
if ( hn !== desHn ) { |
|
|
|
|
|
desHn = hn; |
|
|
|
|
|
desDn = publicSuffixList.getDomain(hn); |
|
|
|
|
|
} |
|
|
|
|
|
return desDn; |
|
|
|
|
|
}; |
|
|
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
vAPI.messaging.send( |
|
|
|
|
|
'logger-ui.js', |
|
|
|
|
|
{ what: 'getPublicSuffixListData' }, |
|
|
|
|
|
response => { |
|
|
|
|
|
publicSuffixList.fromSelfie(response); |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
readLogBuffer(); |
|
|
readLogBuffer(); |
|
|
|
|
|
|
|
|
uDom('#pageSelector').on('change', pageSelectorChanged); |
|
|
uDom('#pageSelector').on('change', pageSelectorChanged); |
|
|