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

#1134: code review to fix unwanted side effect if previous fix

This commit is contained in:
gorhill 2015-03-31 07:51:01 -04:00
parent 91e143008f
commit 12fc8faf3a

View File

@ -319,10 +319,21 @@ var is3rdParty = function(srcHostname, desHostname) {
if ( desHostname === '*' ) {
return false;
}
// This case occurs for matrix rendering
if ( srcHostname === '*' ) {
return false;
}
var srcDomain = domainFromHostname(srcHostname);
// This can very well occurs, for examples:
// - localhost
// - file-scheme
// etc.
if ( srcDomain === '' ) {
srcDomain = srcHostname !== '' ? srcHostname : desHostname;
}
if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) {
return true;
}