Skip to content

Electron 3.0.x: Webview issues #56988

Closed
Closed

Description

Electron 3.0.0-beta.8 changed the <webview> implementation to "Out of Process Iframe". This issue tracks regressions found by that move.

Activity

  1. added
    upstream
    electron
    electron-blocker
    on Aug 22, 2018
  2. bpasero commented on Aug 29, 2018

    @bpasero
    ContributorAuthor

    Matt Bierner (@mjbvz) fyi see my change in 34a635e to bubble out keyboard events from <webview> to our keybinding service.

  3. bpasero commented on Sep 2, 2018

    @bpasero
    ContributorAuthor

    Matt Bierner (@mjbvz) fyi see my change in 135032b to workaround the new focus behaviour of webview.

  4. bpasero commented on Sep 3, 2018

    @bpasero
    ContributorAuthor

    There is still lots of flakiness in <webview> with regards to focus. It seems that the fact that we use an <iframe> within the <webview> makes proper focus/blur detection harder.

    I think the context key in webviewElement.ts should not work with focus/blur but rather just be enabled when the active editor is a <webview> editor. Ideally we do not have to rely on focus/blur at all for the commands (select all, find) to work.

    More things to test: use an extension such as negokaz.live-server-preview-0.1.2 that leverages HTMLPreviewPart and check if focus handling works properly. We should also let the MS SQL extension team do a test with Electron 3.0.x because they seem to rely most on the <webview> from all extensions.

  5. bpasero commented on Sep 5, 2018

    @bpasero
    ContributorAuthor

    I pushed another comment to move away from DOM.trackFocus() for the webview element and rather send an explicit event.

    There is still focus issues when doing this:

    • install negokaz.live-server-preview-0.1.2
    • open a empty HTML file and type some words
    • open preview to the side
    • click between editor and right hand preview

    => at one point focus is no longer detected

  6. removed
    electron-blocker
    on Sep 5, 2018
  7. bpasero commented on Sep 6, 2018

    @bpasero
    ContributorAuthor

    Another issue (macOS):

    • open one editor (markdown)
    • open preview to the side
    • hit Cmd+W to close
    • => both editors close

    It looks like both the Cmd+W is fired from within the webview as well as the File > Close Editor menu entry from the global menu.

    I opened electron/electron#14514

    Update: it looks like calling webContents.setIgnoreMenuShortcuts(true) (somewhere here) fixes this issue however has one downside: any menu item on macOS that has a role associated (cut, copy, paste for example) needs to be implemented manually in the webview, otherwise we loose that functionality.

  8. bpasero commented on Sep 10, 2018

    @bpasero
    ContributorAuthor

    c47790a changes to not rely on DOM focus/blur for context keys in the webview.

  9. bpasero commented on Oct 25, 2018

    @bpasero
    ContributorAuthor

    #61762 seems related, moving to November.

  10. bpasero commented on Dec 10, 2018

    @bpasero
    ContributorAuthor

    I have extracted #64724 into its own issue.

  11. locked and limited conversation to collaborators on Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

electronupstreamwebview

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions