Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8933: adds mousedown handler to solve document mousedown handler bug #8931

Merged
merged 3 commits into from
Jul 26, 2024
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
7 changes: 7 additions & 0 deletions src/contentScript/focusCaptureDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ async function rawFocusCaptureDialog({
dialog.showModal();

const anyPromiseWillCloseTheDialog = [
// In Chrome 127.0.6533.73, the `chrome.sidePanel.open()` API started throwing user gesture errors
// when a message from the content script was sent to the background script.
// The root cause appears to be a registered mousedown handler on the document that sends a message
// Adding `mousedown` here ensures that the sidePanel.open call is made before the message for the mousedown
// handler on the document is sent.
// See https://issues.chromium.org/issues/355266358 for more details.
Comment on lines +66 to +71
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed, concise explanation!

oneEvent(button, "mousedown"),
oneEvent(button, "click"),
oneEvent(dialog, "cancel"),
onContextInvalidated.promise,
Expand Down
Loading