Skip to content

Reloading <webview> breaks Node integration #1820

Closed

Description

@mkscrg

Repro Gist

This is similar to #1766.

Repeatedly calling <webview>.reload() breaks node integration. After breaking, things like window.process are unavailable inside the <webview>. E.g.

var wv = document.createElement("webview");
// ...
wv.reload();
wv.reload();

Holding a keyboard accelerator wired to reload() (e.g. ⌘R) causes the same breakage. (See repro gist)

Activity

  1. mkscrg commented on May 29, 2015

    @mkscrg
    Author

    I have an imperfect workaround via dom-ready:

    // susceptible to this issue
    ipc.on("reload-webview", function() {
      wv.reload();
    });
    
    // avoids this issue
    wv.addEventListener("dom-ready", function() {
      ipc.once("reload-webview", function() {
        wv.reload();
      });
    });

    (I say "imperfect" because we should be able to reload before the DOM is ready.)

  2. mkscrg commented on May 29, 2015

    @mkscrg
    Author

    This is tested against 0.26.1 due to #1804.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions