Skip to content

Commit

Permalink
Vivaldi: don't assume a tab was opened (#123)
Browse files Browse the repository at this point in the history
This fix permits opening the settings page on Vivaldi.
  • Loading branch information
Chris White committed Aug 6, 2018
1 parent 76cced4 commit ec2f6fd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tabfern/src/view/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,19 @@
})
.then(function open_tab(done, new_win){
win_id = new_win.id;
tab0_id = new_win.tabs[0].id;
// Chrome automatically creates a tab in a window, but
// Vivaldi does not. Handle either.
if(new_win.tabs && new_win.tabs.length) {
tab0_id = new_win.tabs[0].id;
}
chrome.tabs.create({windowId: win_id, url: url}, ASQH.CC(done));
})
.then(function remove_old_tab(done){
chrome.tabs.remove(tab0_id, ASQH.CC(done));
if(tab0_id) {
chrome.tabs.remove(tab0_id, ASQH.CC(done));
} else {
done();
}
})
.or(function(err){log_orig.error({'Load error':err, url});})
;
Expand Down

0 comments on commit ec2f6fd

Please sign in to comment.