single-file-cli 2.9.2 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.sh +1 -1
- package/deno.json +1 -1
- package/lib/bidi-client.js +2 -3
- package/lib/single-file-archive.js +4 -4
- package/lib/single-file-bundle.js +1 -1
- package/lib/single-file-script.js +6 -5
- package/lib/version.js +1 -1
- package/options.js +3 -2
- package/package.json +1 -1
- package/single-file-cli-api.js +22 -22
- package/test/e2e/browser-script.test.js +40 -0
- package/test/e2e/canvas-round-trip.test.js +5 -1
- package/test/e2e/font-face-source-order.test.js +118 -0
- package/test/e2e/html-at-media-url.test.js +3 -1
- package/test/e2e/max-appended-data-length.test.js +100 -0
- package/test/unit/archive-options.test.js +51 -0
package/build.sh
CHANGED
package/deno.json
CHANGED
package/lib/bidi-client.js
CHANGED
|
@@ -67,8 +67,7 @@ const PRINT_TO_PDF_FUNCTION_NAME = "printToPDF";
|
|
|
67
67
|
const SET_SCREENSHOT_FUNCTION_NAME = "setScreenshot";
|
|
68
68
|
const SET_PDF_FUNCTION_NAME = "setPDF";
|
|
69
69
|
const SET_PAGE_DATA_FUNCTION_NAME = "setPageData";
|
|
70
|
-
const
|
|
71
|
-
const SINGLE_FILE_GLOBAL_ASSIGNMENT = "globalThis.singlefile=window.singlefile=";
|
|
70
|
+
const SINGLE_FILE_GLOBAL_ASSIGNMENT = "globalThis.singlefile=window.singlefile=singlefile;";
|
|
72
71
|
const SERVER_CONNECT_TIMEOUT = 30000;
|
|
73
72
|
const SESSION_TIMEOUT = 120000;
|
|
74
73
|
const SERVER_SESSION_PATH = "/session";
|
|
@@ -406,7 +405,7 @@ async function setupCookies(pageContext) {
|
|
|
406
405
|
|
|
407
406
|
async function setupScriptInjection(pageContext) {
|
|
408
407
|
const { options, context, preloadScripts } = pageContext;
|
|
409
|
-
const scriptSource =
|
|
408
|
+
const scriptSource = await getScriptSource(options, SINGLE_FILE_GLOBAL_ASSIGNMENT);
|
|
410
409
|
const hookScript = await session.send("script.addPreloadScript", {
|
|
411
410
|
functionDeclaration: "() => {" + getHookScriptSource() + "}",
|
|
412
411
|
contexts: [context]
|