|
|
@@ -23,10 +23,6 @@
|
|
|
|
|
|
/* global globalThis, window, document, fetch, DOMParser, getComputedStyle, setTimeout, clearTimeout, NodeFilter, Readability, isProbablyReaderable, matchMedia, TextDecoder, Node, URL, MouseEvent, Blob, prompt, MutationObserver, FileReader, Worker, navigator, alert */
|
|
|
|
|
|
-import * as zip from "single-file-core/vendor/zip/zip.js";
|
|
|
-import { extract } from "single-file-core/processors/compression/compression-extract.js";
|
|
|
-import { display } from "single-file-core/processors/compression/compression-display.js";
|
|
|
-
|
|
|
(globalThis => {
|
|
|
|
|
|
const IS_NOT_SAFARI = !/Safari/.test(navigator.userAgent) || /Chrome/.test(navigator.userAgent) || /Vivaldi/.test(navigator.userAgent) || /OPR/.test(navigator.userAgent);
|
|
|
@@ -982,7 +978,7 @@ pre code {
|
|
|
let selectedNote, anchorElement, maskNoteElement, maskPageElement, highlightSelectionMode, removeHighlightMode, resizingNoteMode, movingNoteMode, highlightColor, collapseNoteTimeout, cuttingOuterMode, cuttingMode, cuttingTouchTarget, cuttingPath, cuttingPathIndex, previousContent;
|
|
|
let removedElements = [], removedElementIndex = 0, initScriptContent, pageResources, pageUrl, pageCompressContent, includeInfobar;
|
|
|
|
|
|
- globalThis.zip = zip;
|
|
|
+ globalThis.zip = singlefile.helper.zip;
|
|
|
window.onmessage = async event => {
|
|
|
const message = JSON.parse(event.data);
|
|
|
if (message.method == "init") {
|
|
|
@@ -1144,7 +1140,7 @@ pre code {
|
|
|
delete zipOptions.workerScripts;
|
|
|
}
|
|
|
zipOptions.useWebWorkers = IS_NOT_SAFARI;
|
|
|
- const { docContent, origDocContent, resources, url } = await extract(content, {
|
|
|
+ const { docContent, origDocContent, resources, url } = await singlefile.helper.extract(content, {
|
|
|
password,
|
|
|
prompt,
|
|
|
shadowRootScriptURL: new URL("/lib/single-file-extension-editor-init.js", document.baseURI).href,
|
|
|
@@ -1155,7 +1151,7 @@ pre code {
|
|
|
pageCompressContent = true;
|
|
|
const contentDocument = (new DOMParser()).parseFromString(docContent, "text/html");
|
|
|
if (detectSavedPage(contentDocument)) {
|
|
|
- await display(document, docContent, { disableFramePointerEvents: true });
|
|
|
+ await singlefile.helper.display(document, docContent, { disableFramePointerEvents: true });
|
|
|
const infobarElement = document.querySelector(singlefile.helper.INFOBAR_TAGNAME);
|
|
|
if (infobarElement) {
|
|
|
infobarElement.remove();
|