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:
parent
91e143008f
commit
12fc8faf3a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user