fix: open no approval window for a site-connection prompt already answered (closes #287)
When a site-connection prompt was decided before the toolbar popup raised for it had loaded, that popup was torn down, chrome.action.openPopup() rejected, and the background opened its fallback window for the answered approval and only then removed it. In the Chrome end-to-end suite the next test could take that window for its own prompt and lose it under its wait. openApprovalWindow() now returns before creating a window when the approval is no longer pending. The blocklist test clicked its self-closing Reject with a plain click; it now clicks it as the other site Reject does, with the click witnessed. Model: opus-5-5
This commit is contained in:
@@ -413,7 +413,7 @@ function releaseApproval(approval) {
|
||||
}
|
||||
}
|
||||
|
||||
// Open approval in a separate popup window.
|
||||
// Open approval in a separate popup window, unless it is no longer pending.
|
||||
// This is the primary mechanism for tx/sign approvals (triggered programmatically,
|
||||
// not from a user gesture) and the fallback for site-connection approvals.
|
||||
// Never rejects. Its callers raise it from inside a Promise executor and drop
|
||||
@@ -446,6 +446,10 @@ async function openApprovalWindow(id) {
|
||||
);
|
||||
}
|
||||
|
||||
// Already answered: a site-connection prompt decided before the toolbar
|
||||
// popup raised for it had loaded, whose openPopup() rejects only now.
|
||||
if (!pendingApprovals[id]) return;
|
||||
|
||||
let win = null;
|
||||
try {
|
||||
win = await windowsCreate(opts);
|
||||
|
||||
Reference in New Issue
Block a user