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

Draft implementation of chrome.tabs.duplicate, #7458. #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

riastradh
Copy link

@riastradh riastradh commented Oct 24, 2017

May not duplicate everything one might want duplicated -- it is a first-order approximation.

brave/browser-laptop#7458

const duplicateTab = function (tabId, cb) {
try {
let tab = getWebContentsForTab(tabId)
// XXX What to do if not there?
Copy link
Collaborator

Choose a reason for hiding this comment

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

set error to 'chrome.tabs.duplicate could not find tabId ' + tabId - I haven't actually verified that message against Chrome, but that would be consistent with the others

evt.sender.send('chrome-tabs-duplicate-response-' + responseId, dtabValue, error)
}
}
try {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need both try/catch blocks (duplicateTab and this one)?

try {
let tab = getWebContentsForTab(tabId)
// XXX What to do if not there?
tab._clone(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should use clone instead of _clone. _clone is an internal method that is only meant to be used by web-contents.js

@jonathansampson
Copy link
Collaborator

@riastradh @bridiver Anything (other than the requested changes) holding this PR back?

@riastradh
Copy link
Author

Heh. Mostly that I don't check this github account! Paging my alter ego @riastradh-brave when it wakes up during work hours on Monday...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants