This is a Chrome extension that allows users to save the current webpage as an MHTML file or upload it to an API server.
The extension adds two options to the context menu: "Save as MHTML" and "Upload as MHTML".
The extension requires the following permissions:
activeTab
: To access the current tab.contextMenus
: To add items to the context menu.downloads
: To download the MHTML file.pageCapture
: To capture the current webpage as MHTML.notifications
: To display notifications.To install the extension, follow the standard procedure for installing Chrome extensions.
chrome://extensions/
.Please note that the "Upload as MHTML" feature requires a server-side API to receive the POST request.
The API URL is currently set to 'http://localhost:3001/api/upload' and should be updated to your actual API URL.
The extension consists of three main JavaScript files:
background.js
: This file contains the main logic for creating the context menu and handling the user's selection. It also contains the functions for saving the webpage as MHTML and uploading it to the API.
content.js
: This file contains a message listener for hashing the URL path and title of the webpage.
manifest.json
: This file contains the metadata for the extension, including its name, version, description, permissions, and the paths to the JavaScript and icon files.
Contributions are welcome. Please open an issue or submit a pull request on GitHub.