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

fix: navigator.keyboard.lock() not working #31572

Merged
merged 2 commits into from
Oct 28, 2021
Merged

fix: navigator.keyboard.lock() not working #31572

merged 2 commits into from
Oct 28, 2021

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Oct 25, 2021

Description of Change

Closes #31420.

Fixes an issue where navigator.keyboard.lock() did not work. The patch surface here is fairly small, and might be best combined with another similar patch. I considered potentially subclassing, but the maintenance burden there I felt to be greater since that would require subclassing and pulling in huge swathes of chrome/browser/ui/exclusive_access.

Please leave general thoughts or if you have them, alternative approaches to minimize change surface!

Checklist

Release Notes

Notes: Enables support for navigator.keyboard.lock().

@codebytere codebytere added the semver/patch backwards-compatible bug fixes label Oct 25, 2021
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Oct 25, 2021
@codebytere
Copy link
Member Author

Should be rebased when #31573 is merged.

@codebytere codebytere marked this pull request as ready for review October 25, 2021 19:54
@codebytere codebytere requested a review from a team as a code owner October 25, 2021 19:55
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Oct 26, 2021
@jkleinsc jkleinsc merged commit 639f442 into main Oct 28, 2021
@jkleinsc jkleinsc deleted the keyboard-lock branch October 28, 2021 14:23
@release-clerk
Copy link

release-clerk bot commented Oct 28, 2021

Release Notes Persisted

Enables support for navigator.keyboard.lock().

@trop
Copy link
Contributor

trop bot commented Oct 28, 2021

I was unable to backport this PR to "15-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Oct 28, 2021

I have automatically backported this PR to "16-x-y", please check out #31621

@trop
Copy link
Contributor

trop bot commented Nov 17, 2021

@codebytere has manually backported this PR to "15-x-y", please check out #31846

@@ -1346,6 +1389,18 @@ void WebContents::FindReply(content::WebContents* web_contents,
Emit("found-in-page", result.GetHandle());
}

void WebContents::RequestKeyboardLock(content::WebContents* web_contents,
bool esc_key_locked) {
exclusive_access_manager_->keyboard_lock_controller()->RequestKeyboardLock(
Copy link
Member

Choose a reason for hiding this comment

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

We should allow the browser process to deny this; does this go through existing permissions stuff or do we need to add something new?

t57ser pushed a commit to t57ser/electron that referenced this pull request Jan 25, 2022
* fix: navigator.keyboard.lock() not working

* chore: address review feedback
@trop trop bot removed the in-flight/15-x-y label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: navigator.keyboard.lock() not work
4 participants