mirror of https://github.com/gorhill/uBlock.git
minor code review: pass a string, not an array
This commit is contained in:
parent
24436b5d40
commit
cdfdb570bb
|
@ -133,12 +133,9 @@ var injectScripts = function(scripts) {
|
||||||
if ( !parent ) {
|
if ( !parent ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var i = scripts.length, scriptTag;
|
var scriptTag = document.createElement('script');
|
||||||
while ( i-- ) {
|
scriptTag.appendChild(document.createTextNode(scripts));
|
||||||
scriptTag = document.createElement('script');
|
parent.appendChild(scriptTag);
|
||||||
scriptTag.appendChild(document.createTextNode(scripts[i]));
|
|
||||||
parent.appendChild(scriptTag);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -156,7 +153,7 @@ var filteringHandler = function(details) {
|
||||||
if ( details.netHide.length !== 0 ) {
|
if ( details.netHide.length !== 0 ) {
|
||||||
netFilters(details);
|
netFilters(details);
|
||||||
}
|
}
|
||||||
if ( Array.isArray(details.scripts) ) {
|
if ( details.scripts ) {
|
||||||
injectScripts(details.scripts);
|
injectScripts(details.scripts);
|
||||||
}
|
}
|
||||||
// The port will never be used again at this point, disconnecting allows
|
// The port will never be used again at this point, disconnecting allows
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ FilterContainer.prototype.retrieveScriptTags = function(domain, hostname) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return out;
|
return out.join('\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue