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 ) {
|
||||
return;
|
||||
}
|
||||
var i = scripts.length, scriptTag;
|
||||
while ( i-- ) {
|
||||
scriptTag = document.createElement('script');
|
||||
scriptTag.appendChild(document.createTextNode(scripts[i]));
|
||||
parent.appendChild(scriptTag);
|
||||
}
|
||||
var scriptTag = document.createElement('script');
|
||||
scriptTag.appendChild(document.createTextNode(scripts));
|
||||
parent.appendChild(scriptTag);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -156,7 +153,7 @@ var filteringHandler = function(details) {
|
|||
if ( details.netHide.length !== 0 ) {
|
||||
netFilters(details);
|
||||
}
|
||||
if ( Array.isArray(details.scripts) ) {
|
||||
if ( details.scripts ) {
|
||||
injectScripts(details.scripts);
|
||||
}
|
||||
// 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