mirror of https://github.com/gorhill/uBlock.git
fix
This commit is contained in:
parent
4290b4b065
commit
6e916efb0a
|
@ -969,12 +969,21 @@ vAPI.domCollapser = (function() {
|
|||
var send = function() {
|
||||
vAPI.executionCost.start();
|
||||
timer = null;
|
||||
// https://github.com/gorhill/uBlock/issues/1927
|
||||
// Normalize hostname to avoid trailing dot of FQHN.
|
||||
var pageHostname = window.location.hostname || '';
|
||||
if (
|
||||
pageHostname.length &&
|
||||
pageHostname.charCodeAt(pageHostname.length - 1) === 0x2e
|
||||
) {
|
||||
pageHostname = pageHostname.slice(0, -1);
|
||||
}
|
||||
messaging.send(
|
||||
'contentscript',
|
||||
{
|
||||
what: 'filterRequests',
|
||||
pageURL: window.location.href,
|
||||
pageHostname: window.location.hostname,
|
||||
pageHostname: pageHostname,
|
||||
requests: roundtripRequests
|
||||
}, onProcessed
|
||||
);
|
||||
|
@ -1016,10 +1025,8 @@ vAPI.domCollapser = (function() {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// Some data: URI can be quite large: no point in taking into account
|
||||
// the whole URI.
|
||||
if ( src.lastIndexOf('data:', 0) === 0 ) {
|
||||
src = src.slice(0, 255);
|
||||
if ( src.lastIndexOf('http', 0) !== 0 ) {
|
||||
return;
|
||||
}
|
||||
var key = tag + ' ' + prop + ' ' + src,
|
||||
entry = pendingRequests[key];
|
||||
|
|
|
@ -477,13 +477,8 @@ var filterRequests = function(pageStore, details) {
|
|||
var i = requests.length;
|
||||
while ( i-- ) {
|
||||
request = requests[i];
|
||||
if ( request.url.startsWith('data:') ) {
|
||||
context.requestURL = request.url;
|
||||
context.requestHostname = context.pageHostname;
|
||||
} else {
|
||||
context.requestURL = punycodeURL(request.url);
|
||||
context.requestHostname = hostnameFromURI(context.requestURL);
|
||||
}
|
||||
context.requestType = tagNameToRequestTypeMap[request.tag];
|
||||
r = pageStore.filterRequest(context);
|
||||
if ( typeof r !== 'string' || r.charAt(1) !== 'b' ) {
|
||||
|
|
Loading…
Reference in New Issue