Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
fixes guestViewInternal.destroy console error
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver committed Apr 12, 2017
1 parent e4a13bf commit 9f78288
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions atom/common/api/resources/web_view_api_bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
// This module implements the public-facing API functions for the <webview> tag.

const GuestViewInternal = require('guest-view-internal').GuestViewInternal
const TabViewInternal = require('tabViewInternal').TabViewInternal;
const WebViewInternal = require('webViewInternal').WebViewInternal;
const WebViewImpl = require('webView').WebViewImpl;
const TabViewInternal = require('tabViewInternal').TabViewInternal
const WebViewInternal = require('webViewInternal').WebViewInternal
const WebViewImpl = require('webView').WebViewImpl
const GuestViewImpl = require('guestView').GuestViewImpl
const remote = require('remote')
const GuestViewContainer = require('guestViewContainer').GuestViewContainer;
const GuestView = require('guestView').GuestView;
const GuestViewContainer = require('guestViewContainer').GuestViewContainer
const GuestView = require('guestView').GuestView

const asyncMethods = [
'loadURL',
Expand Down Expand Up @@ -109,13 +109,13 @@ WebViewImpl.prototype.attachWindow$ = function (opt_guestInstanceId) {

if (opt_guestInstanceId) {
if (this.guest.getState() === GuestViewImpl.GuestState.GUEST_STATE_ATTACHED) {
this.guest.detach();
this.guest.detach()
}

this.guest = new GuestView('webview', guestInstanceId);
this.guest = new GuestView('webview', guestInstanceId)
}

const attached = GuestViewContainer.prototype.attachWindow$.call(this);
const attached = GuestViewContainer.prototype.attachWindow$.call(this)

if (attached) {
WebViewInternal.getWebContents(guestInstanceId, (webContents) => {
Expand All @@ -128,7 +128,9 @@ WebViewImpl.prototype.attachWindow$ = function (opt_guestInstanceId) {

WebViewImpl.prototype.detachGuest = function () {
if (this.guest.getState() === GuestViewImpl.GuestState.GUEST_STATE_ATTACHED) {
this.guest.detach()
this.guest.detach(() => {
this.guest = new GuestView('webview')
})
}
}

Expand Down Expand Up @@ -161,5 +163,5 @@ WebViewImpl.prototype.getURL = function () {
// -----------------------------------------------------------------------------

WebViewImpl.getApiMethods = function () {
return WEB_VIEW_API_METHODS;
};
return WEB_VIEW_API_METHODS
}

0 comments on commit 9f78288

Please sign in to comment.