|
|
@@ -28,21 +28,15 @@ const fs = require("fs");
|
|
|
const SCRIPTS = [
|
|
|
"lib/single-file.js",
|
|
|
"lib/single-file-bootstrap.js",
|
|
|
- "/lib/single-file-hooks.js",
|
|
|
- "/lib/single-file-hooks-frames.js",
|
|
|
- "lib/extension-infobar.js"
|
|
|
+ "lib/single-file-hooks.js",
|
|
|
+ "lib/single-file-hooks-frames.js"
|
|
|
];
|
|
|
|
|
|
-const INFOBAR_SCRIPT = "/lib/single-file-infobar.js";
|
|
|
-
|
|
|
exports.get = async options => {
|
|
|
const basePath = "../../../";
|
|
|
let scripts = "let _singleFileDefine; if (typeof define !== 'undefined') { _singleFileDefine = define; define = null }";
|
|
|
scripts += await readScriptFiles(SCRIPTS, basePath);
|
|
|
- scripts += await readScriptFiles([INFOBAR_SCRIPT], basePath);
|
|
|
- if (options.includeInfobar) {
|
|
|
- scripts += await readScriptFiles(options && options.browserScripts ? options.browserScripts : [], "");
|
|
|
- }
|
|
|
+ scripts += await readScriptFiles(options && options.browserScripts ? options.browserScripts : [], "");
|
|
|
if (options.browserStylesheets && options.browserStylesheets.length) {
|
|
|
scripts += "addEventListener(\"load\",()=>{const styleElement=document.createElement(\"style\");styleElement.textContent=" + JSON.stringify(await readScriptFiles(options.browserStylesheets, "")) + ";document.body.appendChild(styleElement);});";
|
|
|
}
|