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

Work better with Google Docs #2604

Closed
wants to merge 3 commits into from

Conversation

mrmr1993
Copy link
Contributor

@mrmr1993 mrmr1993 commented Aug 18, 2017

This makes <esc> blur out of frames whose body is an editable element.

Fixes #2075.

Notes:

  • The focused frame for Google Docs is not what it appears to be: a hidden iframe collects the typing events, but the content is rendered in the main frame.
  • I can't find an obvious element that clicking should be enabled for to return focus to the editor, so you have to use the mouse to continue editing.
  • Any bindings that use modifier keys will drop focus back into the editor: Docs captures the events for them and uses them to refocus it.

@mrmr1993
Copy link
Contributor Author

Updated.

@gdh1995
Copy link
Contributor

gdh1995 commented Aug 18, 2017

This new PR breaks my original purpose of preventing the official Vimium from grabbing Esc events on my custom Vimium - my custom Vimium use about:blank as its FindMode iframe. Fortunately, I've dispatched a fake unload event to iframes to force Vimium to exit itself ^_^ , so up to now my custom Vimium is still safe.

@mrmr1993
Copy link
Contributor Author

I've dispatched a fake unload event to iframes to force Vimium to exit itself

I've been meaning to add a check for event.isTrusted for some time, but I hadn't made a move on it because I couldn't think of a way it would leak data or give privileged access to the page. I'd forgotten that this was a possibility, and this is definitely something pages shouldn't be able to do, as much as the people in #2399 and #2532 might want to.

Thanks for the heads up, I'll throw together a PR now.

@mrmr1993
Copy link
Contributor Author

I'll throw together a PR now.

Done: #2605.

gdh1995 added a commit to gdh1995/vimium-c that referenced this pull request Sep 9, 2017
gdh1995 added a commit to gdh1995/vimium-c that referenced this pull request Sep 14, 2017
@philc
Copy link
Owner

philc commented Jan 10, 2020

@mrmr1993 this is well-written and well-documented. It solves a valid use case, but adds non-trivial complexity. I'm going to close this due to age and lack of interest.

@philc philc closed this Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs.google.com completely steals the focus
3 participants