This repository has been archived by the owner on Jan 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Removing <webview> from DOM destroys most-recently-attached WebContents #510
Labels
Comments
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Mar 1, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Mar 2, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Mar 20, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
Will this get merged? I have an app that uses muon and am currently stuck. The workaround referenced after the fix is brilliant and I'm gonna use it for now. |
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Mar 31, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 1, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 2, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 4, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 4, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 10, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 10, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 10, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 10, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 10, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 11, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 11, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 11, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 30, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
Apr 30, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
May 1, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
petemill
added a commit
to brave/browser-laptop
that referenced
this issue
May 2, 2018
If a <webview> is removed from DOM, it will force the last-previously-attached WebContents to be destroyed, even if detachGuest is called, so we create a new WebContents and attach it to the tab's previous <webview> so that now when the element is removed, the temporary WebContents is destroyed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
...even if the WebContents has been detached from the webview via
<webview>.detachGuest()
This issue can be demonstrated through browser-laptop using the
--debug-tab-events
flag, and affects the single-webview2 branch, where once a webview is detached from a tab, the tab has no more attachments remaining. Perhaps there is some logic somewhere that looks to see if the WebContents is embedded anywhere currently, after its last embbeder gets removed, and destroys it if not.STR:
find the guestInstanceId of one of the tabs through adding debug output (probably
1
or2
- I added a data-guest-instance-id attribute to the Tab component), or just guess.Create a webview attached to one of those tabs:
var w = createAttachedWebview(1)
.Observe that a new webview is created and displays the tab's contents.
Detach from the WebContents:
w.detachGuest()
.Observe that the webview does not display any contents anymore.
Remove the webview from the DOM:
w.remove()
.Problem: The WebContents is destroyed (as evidenced by the tab also being removed from the tab bar).
Expected: The WebContents is unaffected and can continue being attached to a different
<webview>
Note that if a
<webview>
is attached to multiple Tab/WebContents, when it removed from the DOM, it will only cause the most-recently attached WebContents to be destroyed.Why do we need this?
In the single-webview2 branch, I have started to use a new
<webview>
for each active tab and ta preview, for the following reasons:attachGuest(x)
calls (i.e. switching active tabs).The text was updated successfully, but these errors were encountered: