From eb3abef4520d17dbd9957f5d23ada74b853133e4 Mon Sep 17 00:00:00 2001 From: glacambre Date: Sat, 2 Oct 2021 16:29:53 +0200 Subject: [PATCH] Add link to troubleshooting guide to browserAction --- src/background.ts | 1 + src/browserAction.html | 1 + src/browserAction.ts | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/background.ts b/src/background.ts index 63dbff05..3388e36b 100644 --- a/src/background.ts +++ b/src/background.ts @@ -304,6 +304,7 @@ Object.assign(window, { }, toggleDisabled: () => toggleDisabled(), updateSettings: () => updateSettings(), + openTroubleshootingGuide: () => browser.tabs.create({ active: true, url: "https://github.com/glacambre/firenvim/blob/master/TROUBLESHOOTING.md" }), } as any); browser.runtime.onMessage.addListener(async (request: any, sender: any, _sendResponse: any) => { diff --git a/src/browserAction.html b/src/browserAction.html index 8518c4db..8034cb9e 100644 --- a/src/browserAction.html +++ b/src/browserAction.html @@ -17,6 +17,7 @@ +
diff --git a/src/browserAction.ts b/src/browserAction.ts index 4bd57c9e..f847cea9 100644 --- a/src/browserAction.ts +++ b/src/browserAction.ts @@ -42,6 +42,9 @@ addEventListener("DOMContentLoaded", () => { browser.runtime.sendMessage( { funcName: ["toggleDisabled"] }) .then(updateDisableButton); }); + document.getElementById("troubleshooting").addEventListener("click", () => { + browser.runtime.sendMessage( { funcName: ["openTroubleshootingGuide"] }); + }) displayErrorsAndWarnings(); updateDisableButton(); });