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

Commit

Permalink
use new api for "clone"
Browse files Browse the repository at this point in the history
auditors @bbondy
  • Loading branch information
bridiver committed Dec 15, 2016
1 parent 52c12cb commit b9ec9a5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,18 +430,9 @@ class Frame extends ImmutableComponent {
}

clone (args) {
const newGuest = this.webview.clone()
const newGuestInstanceId = newGuest.getWebPreferences().guestInstanceId
let cloneAction
if (args && args.get('back')) {
cloneAction = newGuest.goBack
} else if (args && args.get('forward')) {
cloneAction = () => newGuest.goForward
}
if (cloneAction) {
newGuest.once('did-attach', cloneAction.bind(newGuest))
}
windowActions.cloneFrame(this.frame, newGuestInstanceId, args && args.get('openInForeground'))
this.webview.clone((tab) => {
console.log(tab)

This comment has been minimized.

Copy link
@bbondy

bbondy Dec 15, 2016

Member

We should probably remove this log though pls.

This comment has been minimized.

Copy link
@bridiver

bridiver Dec 15, 2016

Author Collaborator

oops, I knew that was there and meant to remove it before I committed. It actually can't work anyway because the async webview proxies that use electron's remote interface don't handle callbacks. What I'd really like to do is change this to an action, handle it in tabs.js and remove the webview method

})
}

handleShortcut () {
Expand Down

1 comment on commit b9ec9a5

@bbondy
Copy link
Member

@bbondy bbondy commented on b9ec9a5 Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanup to frame.js thanks!

Please sign in to comment.