single-file-core 1.2.0 → 1.2.1
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/package.json
CHANGED
|
@@ -55,7 +55,7 @@ async function display(document, docContent, { disableFramePointerEvents } = {})
|
|
|
55
55
|
document.querySelectorAll("link[rel*=icon]").forEach(element => element.parentElement.replaceChild(element, element));
|
|
56
56
|
document.open = document.write = document.close = () => { };
|
|
57
57
|
for (let element of Array.from(document.querySelectorAll("script"))) {
|
|
58
|
-
await new Promise(
|
|
58
|
+
await new Promise(resolve => {
|
|
59
59
|
const scriptElement = document.createElement("script");
|
|
60
60
|
Array.from(element.attributes).forEach(attribute => scriptElement.setAttribute(attribute.name, attribute.value));
|
|
61
61
|
const async = element.getAttribute("async") == "" || element.getAttribute("async") == "async";
|
|
@@ -63,7 +63,7 @@ async function display(document, docContent, { disableFramePointerEvents } = {})
|
|
|
63
63
|
scriptElement.textContent = element.textContent;
|
|
64
64
|
} else if (!async) {
|
|
65
65
|
scriptElement.addEventListener("load", resolve);
|
|
66
|
-
scriptElement.addEventListener("error",
|
|
66
|
+
scriptElement.addEventListener("error", () => resolve());
|
|
67
67
|
}
|
|
68
68
|
element.parentElement.replaceChild(scriptElement, element);
|
|
69
69
|
if (element.textContent || async) {
|
|
@@ -80,8 +80,8 @@ async function process(pageData, options) {
|
|
|
80
80
|
pageContent += "<div id='sfz-wait-message'>Please wait...</div>";
|
|
81
81
|
pageContent += "<div id='sfz-error-message'><strong>Error</strong>: Cannot open the page from the filesystem.";
|
|
82
82
|
pageContent += "<ul style='line-height:20px;'>";
|
|
83
|
-
pageContent += "<li style='margin-bottom:10px'><strong>Chrome</strong>: Install <a href='https://chrome.google.com/webstore/detail/
|
|
84
|
-
pageContent += "<li style='margin-bottom:10px'><strong>Microsoft Edge</strong>: Install <a href='https://microsoftedge.microsoft.com/addons/detail/
|
|
83
|
+
pageContent += "<li style='margin-bottom:10px'><strong>Chrome</strong>: Install <a href='https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (chrome://extensions/?id=offkdfbbigofcgdokjemgjpdockaafjg).</li>";
|
|
84
|
+
pageContent += "<li style='margin-bottom:10px'><strong>Microsoft Edge</strong>: Install <a href='https://microsoftedge.microsoft.com/addons/detail/singlefile/efnbkdcfmcmnhlkaijjjmhjjgladedno'>SingleFile</a> and enable the option \"Allow access to file URLs\" in the details page of the extension (edge://extensions/?id=gofneaifncimeglaecpnanbnmnpfjekk).</li>";
|
|
85
85
|
pageContent += "<li><strong>Safari</strong>: Select \"Security > Disable Local File Restrictions\" in the \"Develop > Developer settings\" menu.</li></ul></div>";
|
|
86
86
|
if (options.insertTextBody) {
|
|
87
87
|
const doc = (new DOMParser()).parseFromString(pageData.content, "text/html");
|