Show approval in browser-action popup instead of a separate window
Some checks failed
check / check (push) Has been cancelled
Some checks failed
check / check (push) Has been cancelled
Use action.openPopup() to show the approval in the toolbar popup, which is anchored to the browser window and cannot trigger a macOS Space switch. Falls back to a separate window if openPopup() is unavailable. A port connection detects when the popup is dismissed without a response, and the popup URL is reset to the main UI after every approval resolution.
This commit is contained in:
@@ -8,6 +8,9 @@ let approvalId = null;
|
||||
|
||||
function show(id) {
|
||||
approvalId = id;
|
||||
// Connect a port so the background detects if the popup closes
|
||||
// without an explicit response (e.g. user clicks away).
|
||||
runtime.connect({ name: "approval:" + id });
|
||||
runtime.sendMessage({ type: "AUTISTMASK_GET_APPROVAL", id }, (details) => {
|
||||
if (!details) {
|
||||
window.close();
|
||||
|
||||
Reference in New Issue
Block a user