aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-06-28 16:09:50 +1000
committerYuchen Pei <id@ypei.org>2025-06-28 16:09:50 +1000
commitf15b6b384fde7aa3f65ff766eed0a98a4bea4327 (patch)
treece3358d0ed98b601a3de460d5fa2bfa3e432368a
parentf118bd0b13d580e529a28ab2caa6ead78ab18d5d (diff)
[emacs][firefox] Archive webpages
firefox: add SingleFile settings emacs: use separate dir for downloading webpages
-rw-r--r--emacs/.emacs.d/lisp/my/my-net.el1
-rw-r--r--emacs/.emacs.d/lisp/my/my-web.el4
-rw-r--r--manual/singlefile-settings.json185
3 files changed, 188 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-net.el b/emacs/.emacs.d/lisp/my/my-net.el
index 6212b50..b19ce68 100644
--- a/emacs/.emacs.d/lisp/my/my-net.el
+++ b/emacs/.emacs.d/lisp/my/my-net.el
@@ -29,6 +29,7 @@
;;; net utilities
(defvar my-download-dir "~/Downloads")
+(defvar my-webpage-download-dir "~/Downloads")
(defmacro my-url-as-googlebot (&rest body)
"Run BODY while spoofing as googlebot"
diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el
index d1eacb6..7c9c567 100644
--- a/emacs/.emacs.d/lisp/my/my-web.el
+++ b/emacs/.emacs.d/lisp/my/my-web.el
@@ -146,10 +146,10 @@ Useful for bypassing \"Enable JavaScript and cookies to continue\"."
(if no-overwrite
(my-make-unique-file-name
(my-make-file-name-from-url url)
- my-download-dir)
+ my-webpage-download-dir)
(expand-file-name
(my-make-file-name-from-url url "html")
- my-download-dir))))
+ my-webpage-download-dir))))
(url-copy-file url file-name (not no-overwrite))
(browse-url-firefox (format "file://%s" file-name))))
diff --git a/manual/singlefile-settings.json b/manual/singlefile-settings.json
new file mode 100644
index 0000000..67c8cd6
--- /dev/null
+++ b/manual/singlefile-settings.json
@@ -0,0 +1,185 @@
+{
+ "profiles": {
+ "__Default_Settings__": {
+ "removeHiddenElements": true,
+ "removeUnusedStyles": true,
+ "removeUnusedFonts": true,
+ "removeFrames": true,
+ "blockScripts": true,
+ "blockVideos": true,
+ "blockAudios": true,
+ "blockFonts": false,
+ "blockStylesheets": false,
+ "blockImages": false,
+ "acceptHeaders": {
+ "document": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
+ "script": "*/*",
+ "audio": "audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5",
+ "video": "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
+ "font": "application/font-woff2;q=1.0,application/font-woff;q=0.9,*/*;q=0.8",
+ "stylesheet": "text/css,*/*;q=0.1",
+ "image": "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"
+ },
+ "saveRawPage": false,
+ "insertMetaCSP": true,
+ "saveToClipboard": false,
+ "addProof": false,
+ "woleetKey": "",
+ "saveToGDrive": false,
+ "saveToDropbox": false,
+ "saveWithWebDAV": false,
+ "webDAVURL": "",
+ "webDAVUser": "",
+ "webDAVPassword": "",
+ "saveToGitHub": false,
+ "githubToken": "",
+ "githubUser": "",
+ "githubRepository": "SingleFile-Archives",
+ "githubBranch": "main",
+ "saveWithCompanion": false,
+ "sharePage": false,
+ "compressHTML": true,
+ "insertTextBody": false,
+ "insertEmbeddedImage": false,
+ "insertEmbeddedScreenshotImage": false,
+ "compressCSS": false,
+ "groupDuplicateStylesheets": false,
+ "moveStylesInHead": false,
+ "loadDeferredImages": true,
+ "loadDeferredImagesMaxIdleTime": 1500,
+ "loadDeferredImagesKeepZoomLevel": false,
+ "loadDeferredImagesDispatchScrollEvent": false,
+ "loadDeferredImagesBeforeFrames": false,
+ "contextMenuEnabled": true,
+ "filenameTemplate": "%if-empty<{page-title}|No title> ({date-locale} {time-locale}).{filename-extension}",
+ "filenameMaxLength": "192",
+ "filenameMaxLengthUnit": "bytes",
+ "filenameReplacementCharacter": "_",
+ "replaceEmojisInFilename": false,
+ "saveFilenameTemplateData": false,
+ "shadowEnabled": true,
+ "maxResourceSizeEnabled": true,
+ "maxResourceSize": 10,
+ "networkTimeout": 0,
+ "confirmFilename": false,
+ "filenameConflictAction": "uniquify",
+ "displayInfobar": true,
+ "displayStats": false,
+ "backgroundSave": true,
+ "autoSaveDelay": 1,
+ "autoSaveLoad": false,
+ "autoSaveUnload": false,
+ "autoSaveDiscard": false,
+ "autoSaveRemove": false,
+ "autoSaveLoadOrUnload": true,
+ "autoSaveRepeat": false,
+ "autoSaveRepeatDelay": 10,
+ "autoSaveExternalSave": false,
+ "removeAlternativeFonts": true,
+ "removeAlternativeImages": true,
+ "removeAlternativeMedias": true,
+ "saveCreatedBookmarks": false,
+ "passReferrerOnError": false,
+ "replaceBookmarkURL": true,
+ "allowedBookmarkFolders": [
+ ""
+ ],
+ "ignoredBookmarkFolders": [
+ ""
+ ],
+ "compressContent": false,
+ "createRootDirectory": false,
+ "preventAppendedData": false,
+ "selfExtractingArchive": false,
+ "extractDataFromPage": false,
+ "password": "",
+ "groupDuplicateImages": true,
+ "infobarTemplate": "",
+ "blockMixedContent": true,
+ "saveOriginalURLs": false,
+ "includeInfobar": false,
+ "openInfobar": false,
+ "removeSavedDate": false,
+ "confirmInfobarContent": false,
+ "autoClose": false,
+ "openEditor": false,
+ "openSavedPage": false,
+ "autoOpenEditor": false,
+ "defaultEditorMode": "normal",
+ "applySystemTheme": true,
+ "warnUnsavedPage": true,
+ "displayInfobarInEditor": false,
+ "saveToRestFormApi": false,
+ "saveToRestFormApiUrl": "",
+ "saveToRestFormApiToken": "",
+ "saveToRestFormApiFileFieldName": "",
+ "saveToRestFormApiUrlFieldName": "",
+ "saveToS3": false,
+ "S3Domain": "s3.amazonaws.com",
+ "S3Region": "",
+ "S3Bucket": "",
+ "S3AccessKey": "",
+ "S3SecretKey": "",
+ "loadDeferredImagesBlockCookies": false,
+ "loadDeferredImagesBlockStorage": false,
+ "filenameReplacedCharacters": [
+ "~",
+ "+",
+ "?",
+ "%",
+ "*",
+ ":",
+ "|",
+ "\"",
+ "<",
+ ">",
+ "\\\\",
+ "\u0000-\u001f",
+ ""
+ ],
+ "filenameReplacementCharacters": [
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_",
+ "_"
+ ],
+ "tabMenuEnabled": true,
+ "browserActionMenuEnabled": true,
+ "logsEnabled": true,
+ "progressBarEnabled": true,
+ "maxSizeDuplicateImages": 524288,
+ "forceWebAuthFlow": false,
+ "resolveFragmentIdentifierURLs": false,
+ "userScriptEnabled": false,
+ "saveFavicon": true,
+ "includeBOM": false,
+ "insertMetaNoIndex": false,
+ "insertSingleFileComment": true,
+ "blockAlternativeImages": true,
+ "delayBeforeProcessing": 0,
+ "_migratedTemplateFormat": true,
+ "resolveLinks": true,
+ "infobarPositionAbsolute": false,
+ "infobarPositionTop": "16px",
+ "infobarPositionRight": "16px",
+ "infobarPositionBottom": "",
+ "infobarPositionLeft": ""
+ }
+ },
+ "rules": [
+ {
+ "url": "file:",
+ "profile": "__Default_Settings__",
+ "autoSaveProfile": "__Disabled_Settings__"
+ }
+ ],
+ "maxParallelWorkers": 12,
+ "processInForeground": false
+}