Code style cleanup, remove redundant comments
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
module.exports = function(el) {
|
||||
// console.log("going to execute script", el)
|
||||
|
||||
var code = (el.text || el.textContent || el.innerHTML || "")
|
||||
var src = (el.src || "");
|
||||
var src = (el.src || "")
|
||||
var parent = el.parentNode || document.querySelector("head") || document.documentElement
|
||||
var script = document.createElement("script")
|
||||
|
||||
@@ -14,8 +16,8 @@ module.exports = function(el) {
|
||||
script.type = "text/javascript"
|
||||
|
||||
if (src !== "") {
|
||||
script.src = src;
|
||||
script.async = false; // force synchronous loading of peripheral js
|
||||
script.src = src
|
||||
script.async = false // force asynchronous loading of peripheral js
|
||||
}
|
||||
|
||||
if (code !== "") {
|
||||
@@ -29,11 +31,11 @@ module.exports = function(el) {
|
||||
}
|
||||
|
||||
// execute
|
||||
parent.appendChild(script);
|
||||
parent.appendChild(script)
|
||||
// avoid pollution only in head or body tags
|
||||
if (["head", "body"].indexOf(parent.tagName.toLowerCase()) > 0) {
|
||||
parent.removeChild(script)
|
||||
}
|
||||
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user