|
@ -130,17 +130,11 @@ var extractFirstPartyDesDomain = function(srcHostname, desHostname) { |
|
|
if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) { |
|
|
if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) { |
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|
var srcLength = srcHostname.length; |
|
|
|
|
|
var desLength = desHostname.length; |
|
|
|
|
|
var len = srcLength < desLength ? srcLength : desLength; |
|
|
|
|
|
if ( srcHostname.slice(-len) !== desHostname.slice(-len) ) { |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
var desDomain = µm.URI.domainFromHostname(desHostname); |
|
|
var desDomain = µm.URI.domainFromHostname(desHostname); |
|
|
if ( desDomain === '' ) { |
|
|
if ( desDomain === '' ) { |
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|
var pos = srcLength - desDomain.length; |
|
|
|
|
|
|
|
|
var pos = srcHostname.length - desDomain.length; |
|
|
if ( pos < 0 || srcHostname.slice(pos) !== desDomain ) { |
|
|
if ( pos < 0 || srcHostname.slice(pos) !== desDomain ) { |
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|