Skip to content

Commit

Permalink
Add link to troubleshooting guide to browserAction
Browse files Browse the repository at this point in the history
  • Loading branch information
glacambre committed Oct 3, 2021
1 parent 76aa726 commit eb3abef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions src/browserAction.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<body style="padding: 2pt; width: 135pt">
<button id="reloadSettings">Reload settings</button>
<button id="disableFirenvim">Disable in this tab</button>
<button id="troubleshooting">Troubleshooting guide</button>
<div id="errors"></div>
<div id="warnings"></div>
</body>
Expand Down
3 changes: 3 additions & 0 deletions src/browserAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit eb3abef

Please sign in to comment.