Skip to content

Commit

Permalink
feat: add button to open extension in a browser page
Browse files Browse the repository at this point in the history
  • Loading branch information
heeckhau committed Sep 17, 2024
1 parent 25f35d0 commit 332f385
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/pages/Options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ export default function Options(): ReactElement {
[onSave],
);

const openExtensionDetails = () => {
browser.tabs.create({ url: `chrome://extensions/?id=${chrome.runtime.id}` });

Check failure on line 80 in src/pages/Options/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `·url:·`chrome://extensions/?id=${chrome.runtime.id}`` with `⏎······url:·`chrome://extensions/?id=${chrome.runtime.id}`,⏎···`
};

const openExtensionInPage = () => {
browser.tabs.create({ url: `chrome-extension://${chrome.runtime.id}/popup.html` });

Check failure on line 84 in src/pages/Options/index.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `·url:·`chrome-extension://${chrome.runtime.id}/popup.html`` with `⏎······url:·`chrome-extension://${chrome.runtime.id}/popup.html`,⏎···`
};

const onAdvanced = useCallback(() => {
setAdvanced(!advanced);
}, [advanced]);
Expand Down Expand Up @@ -152,6 +160,14 @@ export default function Options(): ReactElement {
Save
</button>
</div>
<div className="flex flex-row justify-start gap-2 p-2">
<button onClick={openExtensionDetails} className="button">
View Extension Details
</button>
<button onClick={openExtensionInPage} className="button">
Open Extension in Browser Page
</button>
</div>
</div>
);
}
Expand Down

0 comments on commit 332f385

Please sign in to comment.