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 authored and 0xtsukino committed Oct 8, 2024
1 parent 21ebcd1 commit 7b4256e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pages/Options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export default function Options(): ReactElement {
[onSave],
);

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

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

const onAdvanced = useCallback(() => {
setAdvanced(!advanced);
}, [advanced]);
Expand Down Expand Up @@ -152,6 +164,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 7b4256e

Please sign in to comment.