diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
index effb6e395b..5aa0d98b96 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Web Clipper.html
@@ -7,13 +7,9 @@
Supported browsers
Trilium Web Clipper officially supports the following web browsers:
-
- Mozilla Firefox, using Manifest v2.
-
-
- Google Chrome, using Manifest v3. Theoretically the extension should work
- on other Chromium-based browsers as well, but they are not officially supported.
-
+ Mozilla Firefox, using Manifest v2.
+ Google Chrome, using Manifest v3. Theoretically the extension should work
+ on other Chromium-based browsers as well, but they are not officially supported.
Obtaining the extension
@@ -68,5 +64,48 @@
It's also possible to configure the server address
if you don't run the desktop application, or want it to work without the
desktop application running.
+Testing development versions
+Development versions are version pre-release versions, generally meant
+ for testing purposes. These are not available in the Google or Firefox
+ web stores, but can be downloaded from either:
+
+ GitHub Releases by
+ looking for releases starting with Web Clipper.
+
+ Artifacts in GitHub Actions, by looking for the Deploy web clipper extension workflow .
+ Once a workflow run is selected, the ZIP files are available in the Artifacts section,
+ under the name web-clipper-extension.
+
+For Chrome
+
+ Download trilium-web-clipper-[x.y.z]-chrome.zip.
+ Extract the archive.
+ In Chrome, navigate to chrome://extensions/
+
+ Toggle Developer Mode in top-right of the page.
+ Press the Load unpacked button near the header.
+ Point to the extracted directory from step (2).
+
+For Firefox
+
+ Firefox prevents installation of unsigned packages in the “retail” version.
+ To be able to install extensions from disk, consider using Firefox Developer Edition or
+ a non-branded version of Firefox (e.g. GNU IceCat ).
+ One time, go to about:config and change
+ xpinstall.signatures.requiredto false.
+
+
+ Navigate to about:addons.
+ Select Extensions in the left-side navigation.
+ Press the Gear icon on the right of the Manage Your Extensions title.
+ Select Install Add-on From File…
+
+ Point it to trilium-web-clipper-[x.y.z]-firefox.zip.
+ Press the Add button to confirm.
+
Credits
Some parts of the code are based on the Joplin Notes browser extension .
\ No newline at end of file
diff --git a/apps/web-clipper/entrypoints/background/context_menu.ts b/apps/web-clipper/entrypoints/background/context_menu.ts
new file mode 100644
index 0000000000..967466a0ad
--- /dev/null
+++ b/apps/web-clipper/entrypoints/background/context_menu.ts
@@ -0,0 +1,41 @@
+const CONTEXT_MENU_ITEMS: Browser.contextMenus.CreateProperties[] = [
+ {
+ id: "trilium-save-selection",
+ title: "Save selection to Trilium",
+ contexts: ["selection"]
+ },
+ {
+ id: "trilium-save-cropped-screenshot",
+ title: "Crop screenshot to Trilium",
+ contexts: ["page"]
+ },
+ {
+ id: "trilium-save-whole-screenshot",
+ title: "Save whole screenshot to Trilium",
+ contexts: ["page"]
+ },
+ {
+ id: "trilium-save-page",
+ title: "Save whole page to Trilium",
+ contexts: ["page"]
+ },
+ {
+ id: "trilium-save-link",
+ title: "Save link to Trilium",
+ contexts: ["link"]
+ },
+ {
+ id: "trilium-save-image",
+ title: "Save image to Trilium",
+ contexts: ["image"]
+ }
+];
+
+export default async function setupContextMenu() {
+ // Context menu items need to be registered only once.
+ // https://stackoverflow.com/questions/64318529/cannot-create-item-with-duplicate-context-menu-id-in-extension
+ await browser.contextMenus.removeAll();
+ for (const item of CONTEXT_MENU_ITEMS) {
+ browser.contextMenus.create(item);
+ }
+}
diff --git a/apps/web-clipper/entrypoints/background/index.ts b/apps/web-clipper/entrypoints/background/index.ts
index 8657ee5117..7d99abc997 100644
--- a/apps/web-clipper/entrypoints/background/index.ts
+++ b/apps/web-clipper/entrypoints/background/index.ts
@@ -1,5 +1,6 @@
import { randomString, Rect } from "@/utils";
+import setupContextMenu from "./context_menu";
import TriliumServerFacade from "./trilium_server_facade";
type BackgroundMessage = {
@@ -40,6 +41,8 @@ export default defineBackground(() => {
}
});
+ setupContextMenu();
+
function cropImageManifestV2(newArea: Rect, dataUrl: string) {
return new Promise((resolve, reject) => {
const img = new Image();
@@ -115,42 +118,6 @@ export default defineBackground(() => {
return await browser.tabs.captureVisibleTab({ format: 'png' });
}
- browser.contextMenus.create({
- id: "trilium-save-selection",
- title: "Save selection to Trilium",
- contexts: ["selection"]
- });
-
- browser.contextMenus.create({
- id: "trilium-save-cropped-screenshot",
- title: "Crop screen shot to Trilium",
- contexts: ["page"]
- });
-
- browser.contextMenus.create({
- id: "trilium-save-whole-screenshot",
- title: "Save whole screen shot to Trilium",
- contexts: ["page"]
- });
-
- browser.contextMenus.create({
- id: "trilium-save-page",
- title: "Save whole page to Trilium",
- contexts: ["page"]
- });
-
- browser.contextMenus.create({
- id: "trilium-save-link",
- title: "Save link to Trilium",
- contexts: ["link"]
- });
-
- browser.contextMenus.create({
- id: "trilium-save-image",
- title: "Save image to Trilium",
- contexts: ["image"]
- });
-
async function getActiveTab() {
const tabs = await browser.tabs.query({
active: true,
diff --git a/apps/web-clipper/entrypoints/options/index.html b/apps/web-clipper/entrypoints/options/index.html
index 331a36a02e..abe09d4458 100644
--- a/apps/web-clipper/entrypoints/options/index.html
+++ b/apps/web-clipper/entrypoints/options/index.html
@@ -54,7 +54,6 @@
Note that the entered password is not stored anywhere, it will be only used to retrieve an authorization token from the server instance which will be then used to send the clipped notes.
-