mirror of
https://github.com/zadam/trilium.git
synced 2026-07-19 23:02:19 +02:00
fix(web-clipper): integrate trilium server facade
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import TriliumServerFacade, { isDevEnv } from "./trilium_server_facade";
|
||||
|
||||
export default defineBackground(() => {
|
||||
const triliumServerFacade = new TriliumServerFacade();
|
||||
|
||||
// Keyboard shortcuts
|
||||
chrome.commands.onCommand.addListener(async function (command) {
|
||||
if (command == "saveSelection") {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const PROTOCOL_VERSION_MAJOR = 1;
|
||||
|
||||
function isDevEnv() {
|
||||
export function isDevEnv() {
|
||||
const manifest = browser.runtime.getManifest();
|
||||
|
||||
return manifest.name.endsWith('(dev)');
|
||||
}
|
||||
|
||||
class TriliumServerFacade {
|
||||
export default class TriliumServerFacade {
|
||||
constructor() {
|
||||
this.triggerSearchForTrilium();
|
||||
|
||||
@@ -221,5 +221,3 @@ class TriliumServerFacade {
|
||||
(absoff % 60).toString().padStart(2,'0'));
|
||||
}
|
||||
}
|
||||
|
||||
window.triliumServerFacade = new TriliumServerFacade();
|
||||
@@ -2,6 +2,7 @@ console.log("Popup script loaded");
|
||||
|
||||
async function sendMessage(message) {
|
||||
try {
|
||||
console.log("Sending message", message);
|
||||
return await browser.runtime.sendMessage(message);
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
"background": {
|
||||
"scripts": [
|
||||
"lib/browser-polyfill.js",
|
||||
"utils.js",
|
||||
"trilium_server_facade.js"
|
||||
"utils.js"
|
||||
]
|
||||
},
|
||||
"commands": {
|
||||
|
||||
Reference in New Issue
Block a user