## SingleFile

#### Save a complete page into a single HTML file

Getting started - Additional notes - Options description - Annotation editor - Technical notes - Template variables - Template functions - Integration with other extensions - Known issues - Troubleshooting unknown issues - Contributors

1. Getting started
   - Wait until the page is fully loaded.
   - Click on the SingleFile button in the extension toolbar to process and save the page.
   - You can click again on the button to cancel the action when processing a page.
2. Additional notes
   - To save multiple tabs, select them first and click on the SingleFile button .
   - Open the context menu by right-clicking the SingleFile button in the extension toolbar or on the webpage. It allows you to save:
     - the current tab,
     - or the selected content,
     - or the selected frame.
   - You can also process multiple tabs in one click and save:
     - the selected tabs,
     - or the unpinned tabs,
     - or all the tabs.
   - The context menu also allows you to activate the auto-save of:
     - the current tab,
     - or the unpinned tabs,
     - or all the tabs.
   - You can highlight text, add notes, format and remove content before saving the page with the Annotation editor by selecting "Annotate and save the page..." in the context menu
   - With auto-save active, pages are automatically saved every time after being loaded (or before being unloaded if not).
   - Select "Save Selection" from the context menu without selecting any content first to display a selector that will help you choose content by hovering over it with the mouse.
   - Right-click on the SingleFile button and select "Options" to open the options page.
   - Enable the option "Destination > upload to Google Drive" to upload pages to Google Drive
   - You can use the customizable shortcut Ctrl+Shift+Y to save the current tab or the selected tabs. Go to about:addons and select "Manage extension shortcuts" in the cogwheel menu to change it in Firefox. Go to chrome://extensions/shortcuts to change it in Chrome..
   - The default save folder is the download folder configured in your browser, cf. about:preferences in Firefox, chrome://settings in Chrome, and Settings > General > File download location in Safari.
3. Options description

   You can customize SingleFile through the options page. Right-click on SingleFile button in the browser toolbar and select "Options"/"Manage extension" in the context menu to open the options page.

   Profiles

   - A profile is a set of user-defined options associated to a unique name.

     The drop-down list in the upper right of the options page allows you to select a profile and modify the associated options. The buttons next to the drop-down list allows you respectively to create, delete and rename a profile.

   - You can select the default profile through the context menu of SingleFile. The selection is persistent and applied to all tabs.

   - You can also override the default profile by associating a profile to a complete or partial URL. See the description of the Auto-settings rules feature for more info.

   User interface

   - Option: add entry in the context menu of the webpage

     Check this option to display an entry for SingleFile in the context menu of the webpage. The context menu of the SingleFile button in the extension toolbar is displayed whether this option is checked or not.

     It is recommended to check this option

   - Option: overlay a shadow on the page during processing

     Check this option to overlay a shadow on the page when SingleFile is retrieving page resources. This reminds you that you should not close the tab.

     It is recommended to check this option

   - Option: open saved pages in a new tab

     Check this option to display the saved page in a new tab. This option can be useful, for example, in order to check the page is properly saved.

   - Option: auto-close the tab after the page is saved

     Check this option to automatically close the tab after saving the page displayed inside.

   File name

   - Option: template

     The template allows you to customize the file name of saved pages. You can use any valid character and "/" to create sub-folders (with the option "save pages in background" active). You can also use any variables from this list and functions from this list anywhere in the template.

     Invalid characters are automatically transformed and collapsed to underscores. File names cannot exceed 192 characters and are truncated if longer. The invalid characters are: `[` `~` `+` `\` `?` `%` `*` `:` `|` `"` `<` `>` and control characters from 0 to 31 in the ASCII table. When you want to customize the infobar, you can prefix the special characters `%`, `<`, `>`, `{`, `}` and `|` with `\` (e.g. `\>`) to keep them in the infobar content.

     Template examples:

     - `{page-title} ({date-iso} {time-locale}).html` will produce filenames like "Introduction to SingleFile (2018-09-15 11_06_03 PM).html" for a page having "Introduction to SingleFile" as title.
     - `archives/{url-last-segment} - {date-iso}` will produce filenames like "welcome - 2018-09-15" for a page hosted on https://example.com/welcome.html. The saved files will be saved in the sub-directory "archives".
     - `archives/{year-locale}/{month-locale}/{day-locale}/{page-title}.html` will produce filenames like "Introduction to SingleFile.html" stored into 3 sub-directories in the "archives" folder, one for each part of the save date (e.g. "2018/9/15/Introduction to SingleFile.html").
   - Option: max length

     Enter the maximum length of the filename (without the extension) and its unit (bytes or characters).

   - Option: replacement character

     Enter the character used to replace invalid characters in the filename.

   - Option: replace emojis with text

     Check this option to replace emojis in the file name with their unicode text representation.

   - Option: save the filename template data into the page

     Check this option to save the template file data to the page. This allows you to recover template data previously used when saving the page and, for example, to ensure that the file is saved in the same directory as the original file when saving the page again.

   - Option: open the "Save as" dialog to confirm the file name

     Check this option to display the "Save as" dialog in order to confirm the file name before saving the page. If the option "save pages in background" is unchecked then a prompt dialog will be displayed instead of the "Save as" dialog.

   - Option: file name conflict resolution

     Choose the most appropriate action when the filename of the saved page is conflicting with existing ones on the filesystem. The "skip duplicate files" action only detects duplicates among files downloaded during the current browsing session.

   File format

   - Option: format

     Select the output format of the saved file:

     - `"HTML"`: HTML file (default format). This format produces HTML files that do not depend on JavaScript to be opened.
     - `"self-extracting ZIP (universal)"`: self-extracting ZIP file that can be opened on any platform. This format produces files smaller than the "HTML" format but requires JavaScript to be enabled to open the file.
     - `"self-extracting ZIP"`: self-extracting ZIP file that can be opened on any platform from HTTP but not from the filesystem in some browsers (e.g. in browsers based on Chromium or WebKit) without SingleFile to be installed. This format produces files smaller (approx. 1%) than the "self-extracting ZIP (universal)" format.
     - `"ZIP"`: ZIP file. This format produces ZIP files that cannot be opened in a browser but can be opened in the annotation editor.
   - Option: password

     Type a password to encrypt the ZIP file with AES-256 (compatible with Winzip). Be careful, if you lose the password, it will be impossible to open the file. Enabling this option increases the CPU consumption and the time needed to save or read a page.

   - Option: embed image

     Check one of the options to embed an image when saving the page as a ZIP file (self-extracting or not). This allows you to display the saved page as a PNG image when the filename extension is changed to ".png".

   - Option: create a root directory

     Check this option to create a root directory in the ZIP file. The directory name consists of a timestamp and the identifier of the tab where the saved page is displayed.

   - Option: do not append data after the ZIP data

     Check this option to remove the data appended after the ZIP data. The resulting file may be easier to open with some archive managers that do not support ZIP files with appended data. Enabling this option increases the time needed to save a page.

   - Option: make text searchable

     Check this option to insert the text content of the saved page into the self-extracting ZIP file. This makes it possible, for example, to search for pages from the text. Note that if the selected format is "self-extracting ZIP (universal)", the text content is encoded in UTF-8 but the page is declared in ISO-8859-1.

   HTML content

   - Option: compress HTML content

     Check this option to remove all HTML comments and unneeded tags, spaces, quotes and whitespace characters. Checking this option helps to reduce the size of the file without altering the document.

     It is recommended to check this option

   - Option: remove hidden elements

     Check this option to remove all hidden elements. Checking this option can help to reduce the size of the file without altering the document. It may also increase the CPU consumption and the time needed to save a page.

     It is recommended to check this option

   - Option: set content security policy

     Check this option to add a meta tag with a policy to block any external resources from being loaded.

     It is recommended to check this option

   - Option: remove frames

     Check this option to remove all frame and iframe elements. Checking this option can considerably reduce the size of the file without altering the document most of the time. It may also decrease the time needed to save a page.

   - : save original URLs of embedded resources

     Check this option to save the URLs of the resources embedded into the saved page. URLs are stored in attributes with a name prefixed with "data-sf-original-" and suffixed with the original attribute name (e.g. "data-sf-original-src", "data-sf-original-href") for HTML contents. For CSS contents, URLs are stored as comments beginning with "original URL:".

   - Option: do not include the saved date

     Check this option to remove the saved date included in the saved page and displayed in the infobar.

   - Option: save raw page

     Check this option to save the raw HTML file that the browser received. When this option is checked, the page will be saved as if JavaScript was disabled. Checking this option may alter the document.

     It is recommended to uncheck this option

   Infobar

   - Option: display an infobar when viewing a saved page

     Check this option to display the ℹ button at the top right of the page when viewing a saved page. By clicking this button, you can get more information about the saved date and open the original URL.

     It is recommended to check this option

   - Option: template of the infobar content

     The template allows you to customize the content displayed in the infobar. You can use any valid character, `\n` for new lines or `\t` for tabs. You can also use any variables from this list anywhere in the template. If the template or the resulting content is empty, the infobar will display the saved date by default.

     Template examples:

     - `{url-href} ({date-iso})` will produce contents like "https://www.example.com (2018-09-15 11 06 03 PM)".
     - `Title: {page-title}` will produce contents like "Title: Example Domain" for a page having "Example Domain" as title.
   - Option: open a prompt dialog to edit the infobar content

     Check this option to display a prompt dialog in order to confirm the infobar content before saving the page.

   - Option: include infobar in the saved page

     Check this option to display the ℹ button at the top right of the page when viewing a saved page in a browser where SingleFile is not installed.

   - Option: keep infobar open

     Check this option to keep the infobar open when viewing a saved page.

   Stylesheets

   - Option: remove unused styles

     Check this option to remove all the CSS rules and styles that do not match any element in the saved page. Checking this option will not alter the document and can considerably reduce the size of the file. It will also increase the CPU consumption and the time needed to save a page.

     It is recommended to check this option

   - Option: remove stylesheets for alternative devices to screens

     Check this option to remove stylesheets that are not used for the screen display like stylesheets for print preview and speech synthesizers. Checking this option can help to reduce the size of the file.

   - Option: compress CSS content

     Check this option to minify CSS stylesheets. Checking this option can reduce size of the file without altering the document. It may also increase the CPU consumption and the time needed to save a page.

     It is recommended to uncheck this option

   - Option: group duplicate stylesheets together

     Check this option to group together all the duplicate inline stylesheets. Checking this option should not alter the document and can considerably reduce the size of the file. This option is ignored with archive formats based on ZIP files. Please note that this option requires JavaScript to be enabled in order to function properly.

     It is recommended to uncheck this option

   - Option: move in the head element the styles found outside of it

     Check this option to move all the style elements found outside the head element into the head element. This can be useful to avoid a FOUC ("flash of unstyled content") when displaying a saved page.

     It is recommended to uncheck this option

   Images

   - Option: group duplicate images together

     Check this option to avoid saving multiple times duplicate images. Checking this option should not alter the document in modern browsers and can considerably reduce the size of the file. This option is ignored with archive formats based on ZIP files.

     It is recommended to check this option

   - Option: save deferred images

     Check this option to save all the deferred images (or frames) that are not yet displayed. This may help to save all the images without scrolling the page. This feature does its best effort and is not guaranteed to work on all sites. It will also increase the time needed to save a page.

     It is recommended to check this option

   - Option: maximum idle time (ms)

     Enter the maximum delay of time to wait for deferred images. You can increase this value if for example the network or system conditions are degraded. You can also decrease this value otherwise.

   - Option: dispatch "scroll" event

     Check this option to dispatch the "scroll" event when waiting for deferred images. This can improve the loading of images on some sites but it can also cause unexpected scrolling problems on some other sites.

     It is recommended to uncheck this option

   - Option: zoom out the page

     Check this option to save the entire content of a page by zooming out the page. This can help saving pages using infinite virtual lists for example.

     It is recommended to uncheck this option

   - Option: load deferred frames

     Check this option to load deferred frames and images before saving frame contents. It will increase the time needed to save a page.

     It is recommended to uncheck this option

   - Option: remove images for alternative screen resolutions

     Check this option to remove images that are alternatives in lower and/or higher resolutions to the ones displayed by default. Checking this option can considerably reduce the size of the file.

   Fonts

   - Option: remove unused fonts

     Check this option to remove all font CSS rules that do not match any content. Checking this option should not alter the document and can considerably reduce the size of the file.

     It is recommended to check this option

   - Option: remove alternative fonts

     Check this option to remove fonts that are alternatives to the ones used. Checking this option should not alter the document and can considerably reduce the size of the file.

     It is recommended to check this option

   Destination

   - Option: save to filesystem

     Check this option to save the downloaded page on the filesystem of your computer.

     It is recommended to check this option

   - Option: share page

     Check this option to share the page with other applications. This option is only available in browsers supporting the Web Share API.

     It is recommended to uncheck this option

   - Option: copy to clipboard

     Check this option to copy the page to the clipboard. This option does not work with archive formats based on ZIP files.

     It is recommended to uncheck this option

   - Option: upload to GitHub

     Check this option to save the page on GitHub. See the documentation page to learn how to configure SingleFile to save pages on GitHub. Warning: once a page saved on GitHub, it is complicated to delete it, see the documentation page on GitHub for more information.

     It is recommended to uncheck this option

   - Option: access token

     Enter your personal access token on GitHub, see the documentation page on GitHub for more information.

   - Option: user name

     Enter your user name on GitHub.

   - Option: repository name

     Enter the name of the repository on GitHub where the saved pages will be archived, see the documentation page on GitHub for more information on how to create a repository.

   - Option: branch name

     Enter the repository branch name where pages will be archived. The branch must exist on GitHub, see the documentation page on GitHub for more information on how to publish the branch on github.io.

   - Option: upload to a WebDAV server

     Check this option to save the page on a WebDAV server.

     It is recommended to uncheck this option

   - Option: URL

     Enter the URL of the WebDAV server.

   - Option: user identifier

     Enter your user identifier on the WebDAV server.

   - Option: password

     Enter your password.

   - Option: upload to Google Drive

     Check this option to save the page on Google Drive.

     The permissions requested by SingleFile allow it to access only to the files and folders it has created. When you uncheck this option, SingleFile revokes automatically its access to your Google Drive account.

     It is recommended to uncheck this option

   - Option: upload to Amazon S3

     Check this option to save the page on Amazon S3. You must configure the bucket policy to include the permission `s3:PutObject`, and `s3:HeadObject` or `s3:ListObjects`, or `s3:GetObject` if you do not want to overwrite or skip existing files in the event of a filename conflict.

     It is recommended to uncheck this option

   - Option: domain

     Enter the domain of the Amazon S3 server (e.g. `s3.amazonaws.com`).

   - Option: region

     Enter the region of the Amazon S3 server (e.g. `us-east-1`).

   - Option: bucket name

     Enter the name of the bucket on Amazon S3 where the saved pages will be archived. Pages will be uploaded to `<bucket name>.<domain>`

     .
   - Option: access key

     Enter your access key on Amazon S3 (e.g. `AKDO525K84LJTH4SFAKE`).

   - Option: secret key

     Enter your secret key on Amazon S3.

   - Option: upload to Dropbox

     Check this option to save the page on Dropbox.

     The permissions requested by SingleFile allow it to access only to the files and folders it has created.

     It is recommended to uncheck this option

   - Option: save with SingleFile Companion

     Check this option to delegate the saving process to SingleFile Companion. It is a program that runs outside the browser and can help to make the saving process more transparent. It also allows the pages to be saved in another directory than the download directory. You can find more info here

     It is recommended to uncheck this option

   - Option: upload to a REST Form API

     Check this option to save the page on an API endpoint accepting form data.

     It is recommended to uncheck this option

   - Option: URL

     Enter the URL of the API endpoint.

   - Option: authorization token

     Provide the the value of the "Bearer" token to authenticate the request.

   - Option: archive data field name

     Enter the name of the field that will contain the data of the saved page.

   - Option: archive URL field name

     Enter the name of the field that will contain the URL of the saved page.

   Network

   - Option: blocked resources

     Check the options below to block the download of the corresponding resource types.

   - Option: block mixed contents

     Check this option to block active content served from HTTP when viewing a page in HTTPS. You can find more information about mixed content pages here.

   - Option: "Accept" headers

     Enter the "Accept" HTTP header values below to adjust support for the corresponding resource types.

     It is recommended to leave these values as they are

   - Option: set maximum size (MB)

     Check this option to remove from the saved page embedded resources (i.e. images, stylesheets, scripts and iframes) that exceeds a given size.

   - Option: maximum size (MB)

     Enter the maximum size in megabytes.

   - Option: set maximum download delay (s)

     Check this option to remove from the saved page embedded resources (i.e. images, stylesheets, scripts and iframes) that exceeds a given download time.

   - Option: maximum download delay (s)

     Enter the maximum download delay in seconds.

   - Option: pass \"Referer\" header on cross-origin errors

     Check this option to pass the HTTP header "Referer" with the "origin" policy after an 401, 403, or 404 HTTP error when downloading a cross-origin resource. You should enable this option if you cannot download resources blocked by a hotlink protection.

     It is recommended to uncheck this option

   Annotation editor

   - Option: default mode

     Select the default mode when opening the annotation editor. The available choices are:

     - `normal`: default value
     - `edit the page`: enable the button
     - `format the page`: enable the button if the page can be formatted
     - `remove elements`: enable the button
     - `remove external elements`: enable the button
   - Option: apply the system theme when formatting a page in the annotation editor

     Uncheck this option if you do not want to apply the theme of the operating system or the browser (e.g. dark or light) when you click on the button "Format the page for better readability" in the annotation editor.

   - Option: warn if leaving page with unsaved changes

     Check this option to display a blocking popup when you leave the annotation editor (e.g. close the tab) without saving the changes.

     It is recommended to check this option

   - Option: edit page before saving

     Check this option to open the annotation editor before saving any page. Checking this option removes the entry "Annotate and save the page..." from the context menu.

     It is recommended to uncheck this option

   - Option: open the annotation editor when viewing a page saved with SingleFile

     Check this option to open the annotation editor when displaying a page saved by SingleFile.

     It is recommended to uncheck this option

   - Option: display the infobar

     Check this option to display the infobar when displaying a page in the annotation editor.

     It is recommended to uncheck this option

   Bookmarks

   - Option: save the page of a newly created bookmark

     Check this option to save pages that you add into your bookmarks. Note that if the page is to be saved is not already displayed in a tab, SingleFile will open temporarily a new tab to save the page.

     It is recommended to uncheck this option

   - Option: link the new bookmark to the saved page

     Check this option to replace the URL of the page added into your bookmark with the file URI of the saved page on your disk.

     It is recommended to uncheck this option

   - Option: ignored folders

     Enter a list of bookmark folder names to ignore. The folder names must be separated with a comma. SingleFile will ignore bookmarks added in folders that contains these names.

   - Option: allowed folders

     Enter a list of bookmark folder names to allow. The folder names must be separated with a comma. SingleFile will only save pages added in folders that contains these names.

   Auto-save

   - Option: auto-save after page load or on page unload

     Check this option to auto-save pages after being loaded. If you browse to another page before the page is fully loaded then the page will be saved just before being unloaded. With this option active, you are guaranteed pages will always be saved. Some frame contents may be missing (if you checked "remove frames") when pages are saved before being unloaded.

   - Option: auto-save after page load

     Check this option to auto-save pages after being loaded.

   - Option: auto-save on page unload

     Check this option to auto-save pages before being unloaded instead of saving pages after being loaded. With this option active, you are guaranteed pages will always be saved but some frame contents may be missing (if you checked "remove frames").

   - Option: auto-save on tab discard

     Check this option to auto-save pages when discarding a tab. Some frame contents may be missing (if you checked "remove frames").

   - Option: auto-save on tab removal

     Check this option to auto-save pages when closing a tab. Some frame contents may be missing (if you checked "remove frames").

   - Option: auto-save waiting delay after load (s)

     Enter the delay in seconds to wait before saving a page when the "auto-save on page load or on page unload" or "auto-save on page load" is checked.

   - Option: auto-save periodically

     Check this option to auto-save pages periodically after load.

   - Option: period (s)

     Enter the delay in seconds to wait before each page saving when the "auto-save periodically" option is checked.

   - Option: save the page with SingleFile Companion

     Check this option to delegate the capturing and saving process to SingleFile Companion. It is a program that runs outside the browser and can help to make the saving process more transparent. It also allows the pages to be saved in another directory than the download directory. You can find more info here

   Misc.

   - Option: add proof of existence

     Check this option to create a worldwide proof of the existence of the page you want to save.

     - What is a proof of existence (data anchoring)?
       Data anchoring consists in building a time-stamped proof of existence for a data by linking it to a tamper resistant and time-stamped blockchain. Data anchoring implementation relies on the resilience and immutability of the Bitcoin blockchain to provide the best possible security level
     - How does this protect my data?
       The anchoring mechanism only handles data impressions. Your data remains where you calculate the fingerprints, i.e. in the browser. Their confidentiality is totally preserved.
     - The day after your backup you can get freely the proof receipt here: gildas-lormeau.github.io/singlefile-woleet/index.html. A proof receipt will be used to verify the validity of the evidence

     More information doc.woleet.io

   - Option: access token

     Enter your personal access token on Woleet, see the registration page on Woleet for more information.

   - Option: save pages in background

     Uncheck this option if you get invalid file names like "37bec68b-446a-46a5-8642-19a89c231b46.html" or interrupted downloads when saving pages. You can also uncheck this option if you want the "Save as" dialog to remember the last saved path. Unchecking this option prevent using sub-directories in filename templates.

     It is recommended to check this option

   - Option: display stats in the console after processing

     Check this option to display stats about processing in the JavaScript developer tools of your browser. Checking this option may increase the CPU consumption and the time needed to save a page.

     It is recommended to uncheck this option

   Auto-settings rules

   - The auto-settings rules let you associate a complete or partial URL with a profile. It also allows to associate a specific profile for the auto-save, or to disable it (check "display 'Auto-save profile' column"). When two or more rules match a URL of a page to save, the rule with the longest URL will be chosen. The special profile "-" means the current profile.
   - You can use the special value "*" as URL to create a rule that applies to all URLs
   - You can use regular expressions by prefixing the URL with "regexp:" (e.g. "regexp:.*\.com" to match all URLs containing ".com"). When zero or more rules based on URLs and one or more rules based on regular expressions match a URL, the longest rule based on regular expression will be chosen.

   Form buttons

   - synchronize options

     Check this option to synchronize your options and make them available in all instances of the browser you are logged into, on different devices.

   - Reset

     Reset all options to their default values.

4. Annotation editor

   The annotation editor can be opened by selecting "Annotate and save the page" in the context menu or by enabling the option "Annotation editor > edit page before saving". It allows you to:

   - add notes by clicking one of these buttons:
   - hide or show notes by clicking the button
   - highlight text by clicking one of these buttons:
   - hide or show highlighted text by clicking the button
   - remove text highlighting by clicking the button
   - edit the page by clicking the button
   - format the page to improve readability (when possible) by clicking the button
   - remove contents by clicking the button (inner elements) or (outer elements)
   - undo removes by clicking the button or the button (undo all)
   - redo removes by clicking the button
   - print the page by clicking the button or by pressing `Ctrl-P`
   - save the page by clicking the button or by pressing `Ctrl-S`

   You can use the following keyboard shortcuts when removing contents with or :

   - `Tab`: expand the selection
   - `Shift-Tab`: reduce the selection
   - `Space`: remove the selected element
   - `Ctrl-Z`: undo the last removal
   - `Ctrl-Shift-Z`: redo the last removal
   - `Ctrl`: select/unselect multiple elements, releasing the `Ctrl` key validates the selection
   - `Shift`: temporarily reverse the type of removal (i.e. removal of inner elements or removal of outer elements) on the last selected element and reset the other selected elements if any
   - `Escape`: reset selected elements
5. Template variables

   The template variables are used to customize the infobar content or the file name of a saved page. They help to insert dynamic values like the save date or the page title.

   You can limit the length of a dynamic value by adding `[maxByteSize]` or `[maxCharSizech]` just after the variable name. The `maxByteSize` value is the maximum length of the value in bytes (e.g. `{page-title}[20]` to limit the title to 20 bytes). The `maxCharSize` value is the maximum length in characters (e.g. `{page-title}[10ch]` to limit the title to 10 characters).

   - `{navigator-language}`: the language of the browser
   - `{page-title}`: the title of the page
   - `{page-heading}`: the content of the H1 tag in the page
   - `{page-language}`: the language of the page
   - `{page-description}`: the description of the page
   - `{page-author}`: the author of the page
   - `{page-creator}`: the creator of the page
   - `{page-publisher}`: the publisher of the page
   - `{datetime-iso}`: the save date and time in the ISO format (e.g. "2018-09-15T22_38_26_317Z")
   - `{datetime-utc}`: the save date and time in UTC format (e.g. "Sat, 15 Sep 2018 22_38_26 GMT")
   - `{datetime-locale}`: the localized value of the date and time (e.g. "9_16_2018, 12_54_31 AM")
   - `{date-iso}`: the save date in the ISO format (e.g. "2018-09-15")
   - `{date-locale}`: the localized value of the save date (e.g. "16_09_2018")
   - `{time-iso}`: the save time in the ISO format (e.g. "22_38_26_317")
   - `{time-locale}`: the localized value of the save time (e.g. "00_38_26")
   - `{time-ms}`: the save time is ms since the Unix Epoch (e.g. 1563582018000)
   - `{day-utc}`: the day of the save date in UTC format (e.g. "15")
   - `{day-locale}`: the localized value of the day (e.g. "15")
   - `{month-utc}`: the month of the save date in UTC format (e.g. "09")
   - `{month-locale}`: the localized value of the month (e.g. "09")
   - `{year-utc}`: the year of the save date in UTC format (e.g. "2018")
   - `{year-locale}`: the localized value of the year (e.g. "2018")
   - `{hours-utc}`: the hour of the save date in UTC format (e.g. "20")
   - `{hours-locale}`: the localized value of the hour (e.g. "22")
   - `{minutes-utc}`: the minutes of the save date in UTC format (e.g. "38")
   - `{minutes-locale}`: the localized value of the minutes (e.g. "38")
   - `{seconds-utc}`: the seconds of the save date in UTC format (e.g. "31")
   - `{seconds-locale}`: the localized value of the seconds (e.g. "31")
   - `{visit-datetime-iso}`: the visit date and time in the ISO format (e.g. "2018-09-15T22_38_26_317Z")
   - `{visit-datetime-utc}`: the visit date and time in UTC format (e.g. "Sat, 15 Sep 2018 22_38_26 GMT")
   - `{visit-datetime-locale}`: the localized value of the date and time (e.g. "9_16_2018, 12_54_31 AM")
   - `{visit-date-iso}`: the visit date in the ISO format (e.g. "2018-09-15")
   - `{visit-date-locale}`: the localized value of the visit date (e.g. "16_09_2018")
   - `{visit-time-iso}`: the visit time in the ISO format (e.g. "22_38_26_317")
   - `{visit-time-locale}`: the localized value of the visit time (e.g. "00_38_26")
   - `{visit-time-ms}`: the visit time is ms since the Unix Epoch (e.g. 1563582018000)
   - `{visit-day-utc}`: the day of the visit date in UTC format (e.g. "15")
   - `{visit-day-locale}`: the localized value of the day (e.g. "15")
   - `{visit-month-utc}`: the month of the visit date in UTC format (e.g. "09")
   - `{visit-month-locale}`: the localized value of the month (e.g. "09")
   - `{visit-year-utc}`: the year of the visit date in UTC format (e.g. "2018")
   - `{visit-year-locale}`: the localized value of the year (e.g. "2018")
   - `{visit-hours-utc}`: the hour of the visit date in UTC format (e.g. "20")
   - `{visit-hours-locale}`: the localized value of the hour (e.g. "22")
   - `{visit-minutes-utc}`: the minutes of the visit date in UTC format (e.g. "38")
   - `{visit-minutes-locale}`: the localized value of the minutes (e.g. "38")
   - `{visit-seconds-utc}`: the seconds of the visit date in UTC format (e.g. "31")
   - `{visit-seconds-locale}`: the localized value of the seconds (e.g. "31")
   - `{url-href}`: the URL of the page (e.g. "http://example.com/category/index.html")
   - `{url-href-digest-sha-1}`: the SHA-1 hash value of the URL of the page (e.g. 4b826844d9f5c128533e4ff14d746334f3ac9e00)
   - `{url-href-flat}`: the URL of the page with replaced slashes (e.g. "http__example.com_category_index.html")
   - `{url-pathname}`: the path name of the URL (e.g. "category/index.html")
   - `{url-pathname-flat}`: the path name of the URL with replaced slashes (e.g. "category_index.html")
   - `{url-last-segment}`: the last part of the pathname (without the extension) or the host if not found (e.g. "index")
   - `{url-protocol}`: the protocol of the URL (e.g. "https")
   - `{url-host}`: the host name + the port of the URL (e.g. "example.com_8080")
   - `{url-hostname}`: the host name of the URL (e.g. "example.com")
   - `{url-hostname-suffix}`: the suffix of the host name of the URL (e.g. "com")
   - `{url-hostname-domain}`: the domain of the host name of the URL (e.g. "example")
   - `{url-hostname-root}`: the root of the host name of the URL (e.g. "example.com")
   - `{url-hostname-subdomains}`: the sub-domains of the host name of the URL (e.g. "sub" for "sub.example.com"), "www" is ignored
   - `{url-port}`: the port of the URL (e.g. "8080")
   - `{url-username}`: the user name of the URL (e.g. "john_doe")
   - `{url-password}`: the password of the URL (e.g. "qwerty123")
   - `{url-search}`: the search string of the URL (e.g. "order=ascending")
   - `{url-hash}`: the hash of the URL (e.g. "chapter-2")
   - `{url-referrer}`: the URI of the page that "linked" to the page (e.g. "http://example.com")
   - `{url-referrer-flat}`: the URI of the page that "linked" to the page with slashed replaced (e.g. "http_example.com")
   - `{url-original}`: the original URL of the page (e.g. "http://example.com/index.html")
   - `{bookmark-pathname}`: the path name of the newly created bookmark (e.g. "My Bookmarks/Last Month") when the option "Bookmarks > save the page of a newly created bookmark" is enabled
   - `{bookmark-pathname-flat}`: the path name of the newly created bookmark with replaced slashes (e.g. "My Bookmarks_Last Month") when the option "Bookmarks > save the page of a newly created bookmark" is enabled
   - `{tab-id}`: the unique identifier of the tab (e.g. "326")
   - `{tab-index}`: the index of the tab in the window (e.g. "1")
   - `{digest-sha-256}`: the SHA-256 hash value of the entire page content (e.g. e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
   - `{digest-sha-384}`: the SHA-384 hash value of the entire page content
   - `{digest-sha-512}`: the SHA-512 hash value of the entire page content
   - `{profile-name}`: the name of the profile used to save the page
   - `{filename-extension}`: the extension of the filename depending on the file format (i.e. "html", "u.zip.html", "zip.html", "zip")
   - `{save-action}`: the action used to save the page (i.e. "page", "selection")
   - `{options-json}`: the JSON representation of the options used to save the page. Each property name is written in camel case (e.g. "blockScripts")
   - `{options-text}`: the text representation of the options used to save the page. The text representation is formatted with a list of options and their values separated by a line break (e.g. "saveRawPage: false\includeInfobar: true...")
6. Template functions

   The template functions are used to format values in the template or to insert values depending on parameters.

   The syntax of a function call is `%function-name<parameter>`. You can pass multiple parameters separated with a pipe character (e.g. "%function-name<parameter1|parameter2>"). Like the template variables, you can limit the length of a dynamic value by adding `[maxByteSize]` or `[maxCharSizech]` just after the function name.

   - `%if-empty<value|default>`: returns the `default` value if `value` is empty (e.g. "%if-empty<{page-title}|Untitled>" to return "Untitled" if the page title is empty). You also can pass multiple values separated with a pipe character (e.g. "%if-empty<{page-title}|{page-heading}|Untitled>" to return the page heading if not empty, the page title if not empty or "Untitled" if both are empty).
   - `%if-not-empty<value|default>`: returns the `default` value if `value` is not empty (e.g. "%if-not-empty<{page-title}({page-title})> to return the page title surrounded by parentheses if the page title is not empty). You also can pass multiple values separated like with the function `%if-empty`.
   - `%if-equals<value|expected|trueValue|falseValue>`: returns the `trueValue` if `value` equals `expected` or the `falseValue` otherwise (e.g. "%if-equals<{page-title}|Untitled|{page-heading}|{page-title}>" to return the page heading if the page title equals "Untitled" or the page title otherwise).
   - `%if-not-equals<value|expected|trueValue|falseValue>`: returns the `trueValue` if `value` does not equal `expected` or the `falseValue` otherwise (e.g. "%if-not-equals<{page-title}|Untitled|{page-title}|{page-heading}>" to return the page title if the page title does not equal "Untitled" or the page heading otherwise).
   - `%if-contains<value|expected|trueValue|falseValue>`: returns the `trueValue` if `value` contains `expected` or the `falseValue` otherwise (e.g. "%if-contains<{page-title}|Untitled|{page-heading}|{page-title}>" to return the page heading if the page title contains "Untitled" or the page title otherwise).
   - `%if-not-contains<value|expected|trueValue|falseValue>`: returns the `trueValue` if `value` does not contain `expected` or the `falseValue` otherwise (e.g. "%if-not-contains<{page-title}|Untitled|{page-title}|{page-heading}>" to return the page title if the page title does not contain "Untitled" or the page heading otherwise).
   - `%substring<value|start|end>`: returns a substring of the `value` (e.g. "%substring<{page-title}|0|20>" to return the first 20 characters of the page title, "%substring<{page-title}|5>" to return the page title without the first 5 characters).
   - `%lowercase<value>`: returns the `value` in lowercase (e.g. "%lowercase<{page-title}>" to return the page title in lowercase).
   - `%uppercase<value>`: returns the `value` in uppercase (e.g. "%uppercase<{page-title}>" to return the page title in uppercase).
   - `%capitalize<value>`: returns the `value` with the first letter in uppercase (e.g. "%capitalize<{page-title}>" to return the page title with the first letter in uppercase).
   - `%replace<value|search|replacement>`: returns the `value` with all `search` values replaced by `replacement` (e.g. "%replace<{page-title}| |_>" to replace all spaces by underscores in the page title).
   - `%repeat<value|count>`: returns the `value` repeated `count` times (e.g. "%repeat<{page-title}|3>" to repeat the page title 3 times).
   - `%index-of<value|search|fromIndex>`: returns the index of the first occurrence of `search` in `value` (e.g. "%index-of<{page-title}|"Title">" to return the index of the first occurrence of the string "Title" in `page-title`).
   - `%last-index-of<value|search|fromIndex>`: returns the index of the last occurrence of `search` in `value` (e.g. "%last-index-of<{page-title}|"Title">" to return the index of the last occurrence of the string "Title" in `page-title`).
   - `%length<value>`: returns the length of the `value` (e.g. "%length<{page-title}>" to return the length of the page title).
   - `%trim<value>`: returns the `value` with all leading and trailing whitespace removed (e.g. "%trim<{page-title}>" to remove all leading and trailing whitespace in the page title).
   - `%trim-left<value>`: returns the `value` with all leading whitespace removed (e.g. "%trim-left<{page-title}>" to remove all leading whitespace in the page title).
   - `%trim-right<value>`: returns the `value` with all trailing whitespace removed (e.g. "%trim-right<{page-title}>" to remove all trailing whitespace in the page title).
   - `%pad-left<value|length|pad>`: returns the `value` with `pad` added to the left side so as to make the length of the `value` equal to `length` (e.g. "%pad-left<{page-title}|20|_>" to add underscores to the left side of the page title so as to make its length equal to 20).
   - `%pad-right<value|length|pad>`: returns the `value` with `pad` added to the right side so as to make the length of the `value` equal to `length` (e.g. "%pad-right<{page-title}|20|_>" to add underscores to the right side of the page title so as to make its length equal to 20).
   - `%url-search-name<index>`: the name of the search parameter at the specified index (e.g. "%url-search-name<0>" for the name of the first search parameter)
   - `%url-search-value<index>`: the value of the search parameter at the specified index (e.g. "%url-search-value<0>" for the value of the first search parameter)
   - `%url-search-named-value<name>`: the value of the search parameter with the specified name (e.g. "%url-search-named-value<id>" for the value of the search parameter "id")
   - `%url-segment<index>`: the segment of the pathname at the specified index (e.g. "%url-segment<0>" for the first segment of the pathname)
   - `%url-hostname-subdomain<index>`: the subdomain of the hostname at the specified index (e.g. "%url-hostname-subdomain<0>" for the first subdomain of the hostname)
   - `%stringify<value>`: the string representation of the specified value (e.g. "%stringify<{page-title}>" for the string representation of the page title)
   - `%encode-uri<value>`: the URI-encoded representation of the specified value (e.g. "%encode-uri<{page-title}>" for the URI-encoded representation of the page title)
   - `%decode-uri<value>`: the URI-decoded representation of the specified value (e.g. "%decode-uri<{page-title}>" for the URI-decoded representation of the page title)
   - `%encode-uri-component<value>`: the URI-encoded representation of the specified value (e.g. "%encode-uri-component<{page-title}>" for the URI-encoded representation of the page title)
   - `%decode-uri-component<value>`: the URI-decoded representation of the specified value (e.g. "%decode-uri-component<{page-title}>" for the URI-decoded representation of the page title)
   - `%page-element-text<selector>`: the text content of the first element matching the specified selector (e.g. "%page-element-text<h1>" for the text content of the first H1 element)
   - `%page-element-attribute<selector|attribute>`: the value of the specified attribute of the first element matching the specified selector (e.g. "%page-element-attribute<h1|class>" for the class attribute of the first H1 element)
   - `%date-locale<locales>`: the localized value of the date and time (e.g. "%date-locale<en-US>" for the date and time in the US English format)
   - `%time-locale<locales>`: the localized value of the time (e.g. "%time-locale<en-US>" for the time in the US English format)
   - `%datetime-locale<locales>`: the localized value of the date and time (e.g. "%datetime-locale<en-US>" for the date and time in the US English format)
   - `%datetime-custom<locale|year|month|day|weekday|hour|minute|second|hour12|time-zone|fractional-seconds-digits|time-zone-name|era|locale-matcher>`: the date and time formatted according to the specified locale and options. See below for the list of options. You can pass `` (space character) as a value to use the default value for an option. You can also omit options at the end of the list. For example, to format the date and time in the US English format with the year, day, and weekday, you can use "%datetime-custom<en-US|numeric| |numeric| |numeric>".
     - `locale`: the locale to use as a BCP 47 language tag (e.g. "en-US")
     - `year`: the year format (i.e. "numeric", "2-digit")
     - `month`: the month format (i.e. "numeric", "2-digit", "narrow", "short", "long")
     - `day`: the day format (i.e. "numeric", "2-digit")
     - `weekday`: the weekday format (i.e. "narrow", "short", "long")
     - `hour`: the hour format (i.e. "numeric", "2-digit")
     - `minute`: the minute format (i.e. "numeric", "2-digit")
     - `second`: the second format (i.e. "numeric", "2-digit")
     - `hour12`: whether to use 12-hour time (i.e. "true", "false")
     - `time-zone`: the time zone of the IANA Time Zone Database (e.g. "UTC", "GMT", "EST", "PST", "America/New_York")
     - `fractional-seconds-digits`: the number of fractional second digits (i.e. "1" to "3")
     - `time-zone-name`: the time zone name format (i.e. "short", "long", "shortOffset", "longOffset", "shortGeneric", "longGeneric")
     - `day-period`: the day period (i.e. "narrow", "short", "long")
     - `era`: the era (i.e. "narrow", "short", "long")
     - `locale-matcher`: the locale matcher (e.g. "lookup", "best fit")
     You can find more information about the options in the DateTimeFormat constructor documentation.
   - `%option-value<key>`: the value of the specified option (e.g. "%option-value<displayInfobar>" for the value of the "displayInfobar" option)
7. Integration with other extensions

   SingleFile can receive messages from other extensions. The messages must be sent to the extension ID of SingleFile and must be a string containing one of the following values:

   - `"save-page"`: save the current page
   - `"edit-and-save-page"`: edit the current page in the annotation editor and save it
   - `"save-selected-links"`: save all the links in the selected content
   - `"save-selected-content"`: save the selected content
   - `"save-selected-tabs"`: save the selected tabs
   - `"save-unpinned-tabs"`: save the unpinned tabs
   - `"save-all-tabs"`: save all the tabs
8. Technical notes
   - All images are converted into base64.
   - All resources except frame contents are injected in the document using data URI scheme.
   - Frame contents are injected as text in the document by using the srcdoc attribute.
9. Known issues
   - All browsers
     - For security reasons, you cannot save pages hosted on https://chrome.google.com, https://addons.mozilla.org and some other Mozilla domains. When this happens, 🚫 is displayed on top of the SingleFile icon.
     - For security reasons, SingleFile is sometimes unable to save the image representation of canvas and snapshots of video elements.
     - The last saved path cannot be remembered by default. To circumvent this limitation, disable the option "Misc. > Save pages in background".
     - The following characters are replaced by their full-width equivalent symbols in file names: ~, +, ?, %, *, :, |, ", <, >, \. The replacement characters are respectively: ～, ＋, ？, ％, ＊, ：, ｜, ＂, ＜, ＞, ＼. Other invalid charcaters are replaced by _. This is done to maintain compatibility with various OSs and file systems. If you don't need that level of compatibility and know what you are doing, you can change the list of forbidden characters and the replacement characters in the hidden options.
   - Chromium-based browsers
     - You must enable the option "Allow access to file URLs" in the extension page to display the infobar when viewing a saved page, to save or to annotate a page stored on the filesystem.
     - If the filename of a saved page looks like "56833935-156b-4d8c-a00f-19599c6513d3", disable the option "Misc. > Save pages in background". Reinstalling the browser may also fix this issue.
     - Disabling the option 'File name > open the "Save as" dialog to confirm the file name' will work if and only if "Ask where to save each file before downloading" is disabled in chrome://settings/downloads
   - Firefox
     - The "File name > file name conflict resolution" option does not work if set to "prompt for a name".
     - Sometimes, SingleFile is unable to save the contents of sandboxed iframes.
     - When processing a page from the filesystem, external resources (e.g. images, stylesheets, fonts etc.) will not be embedded into the saved page.
10. Troubleshooting unknown issues

    Please follow these steps if you find an unknown issue:

    - Save the page in incognito.
    - If saving page in incognito did not fix the issue, reset SingleFile options.
    - If resetting options did not fix the issue, restart the browser.
    - If restarting the browser did not fix the issue, try to disable all other extensions to see if there is a conflict.
    - If there is a conflict then try to determine against which extension(s).
    - Please report the issue here with a short description on how to reproduce it.

    Suggestions are welcome :)

11. Contributors
    - Chinese translation done by yfdyh000 (GitHub profile), KrasnayaPloshchad (GitHub profile), frostblazergit (GitHub profile), NightSharp (GitHub profile), lqzhgood (GitHub profile)
    - Traditional Chinese translation done by frostblazergit (GitHub profile), lqzhgood (GitHub profile)
    - Dutch translation done by jooleer (GitHub profile)
    - Dutch translation done by jooleer (GitHub profile)
    - German translation done by womotroll (GitHub profile), bannmann (GitHub profile)
    - Italian translation done by Fastbyte01 (GitHub profile)
    - Japanese translation, done by Shitennouji （四天王寺) (GitHub profile)
    - Polish translation done by xesarni (GitHub profile)
    - Portuguese translation done by @Blackspirits (GitHub profile)
    - Portuguese-Brazilian translation done by @mezysinc, Blackspirits (GitHub profile)
    - Russian translation done by rstp14 (GitHub profile), kramola-RU (GitHub profile), solokot (GitHub profile)
    - Spanish translation done by strel (GitHub profile)
    - Turkish translation done by hbaklan943 (GitHub profile)
    - Ukrainian translation done by perdolka (GitHub profile), gildas-lormeau
12. Icons
    - Icon made by Kiranshastry from www.flaticon.com is licensed by CC 3.0 BY