Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions packages/extension/src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,18 @@ async function requestConsent(args: {
settle(false, false);
return;
}
// A window id proves creation succeeded; it does NOT prove the window is
// visible. `consentWindowBounds` derives left/top from
// `chrome.windows.getLastFocused()`, so a minimised window, a second
// display, or an undocked DevTools window can place the prompt somewhere
// the user never looks — and that is indistinguishable from no prompt at
// all, which is precisely the ambiguity that made the silent hang above
// so hard to find. Log where it went so "I see no popup" is answerable.
console.info(
"[pnm consent] consent window opened",
"id=", winId,
"bounds=", JSON.stringify(bounds),
);
// Closing the window without a decision is a denial.
const onClosed = (closedId: number) => {
if (closedId === winId) {
Expand Down Expand Up @@ -678,6 +690,18 @@ async function requestTaskConsent(
settle(false);
return;
}
// A window id proves creation succeeded; it does NOT prove the window is
// visible. `consentWindowBounds` derives left/top from
// `chrome.windows.getLastFocused()`, so a minimised window, a second
// display, or an undocked DevTools window can place the prompt somewhere
// the user never looks — and that is indistinguishable from no prompt at
// all, which is precisely the ambiguity that made the silent hang above
// so hard to find. Log where it went so "I see no popup" is answerable.
console.info(
"[pnm consent] consent window opened",
"id=", winId,
"bounds=", JSON.stringify(bounds),
);
// Closing the window without deciding is a denial. Never assent: silence
// is not agreement, and a task-consent prompt that timed out into an
// approval would be the single worst bug in this system.
Expand Down