-
Notifications
You must be signed in to change notification settings - Fork 114
Draft implementation of chrome.tabs.duplicate, #7458. #359
base: master
Are you sure you want to change the base?
Draft implementation of chrome.tabs.duplicate, #7458. #359
Conversation
const duplicateTab = function (tabId, cb) { | ||
try { | ||
let tab = getWebContentsForTab(tabId) | ||
// XXX What to do if not there? |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
@riastradh @bridiver Anything (other than the requested changes) holding this PR back? |
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... |
May not duplicate everything one might want duplicated -- it is a first-order approximation.
brave/browser-laptop#7458