Skip to content

Commit

Permalink
add hidden option delayBeforeProcessing
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Feb 6, 2024
1 parent 9fa04b4 commit 7cf910d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/bg/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const DEFAULT_CONFIG = {
blockScripts: true,
blockVideos: true,
blockAudios: true,
delayBeforeProcessing: 0,
_migratedTemplateFormat: true
};

Expand Down
5 changes: 4 additions & 1 deletion src/core/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Source.
*/

/* global browser, document, globalThis, location, URL, Blob, MouseEvent */
/* global browser, document, globalThis, location, URL, Blob, MouseEvent, setTimeout */

import * as download from "./../common/download.js";
import { fetch, frameFetch } from "./../../lib/single-file/fetch/content/content-fetch.js";
Expand Down Expand Up @@ -150,6 +150,9 @@ async function processPage(options) {
const frames = singlefile.processors.frameTree;
let framesSessionId;
options.keepFilename = options.saveToGDrive || options.saveToGitHub || options.saveWithWebDAV || options.saveToDropbox;
if (options.delayBeforeProcessing) {
await new Promise(resolve => setTimeout(resolve, options.delayBeforeProcessing * 1000));
}
singlefile.helper.initDoc(document);
ui.onStartPage(options);
processor = new singlefile.SingleFile(options);
Expand Down

0 comments on commit 7cf910d

Please sign in to comment.