forked from mirrors/gecko-dev
Bug 1860375 - Add check for if tabs are not undefined to getTabsForWindow method. r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D191632
This commit is contained in:
parent
a26eafe5c3
commit
31fd0bf54b
1 changed files with 8 additions and 2 deletions
|
|
@ -309,11 +309,17 @@ export var TabManager = {
|
||||||
* Window whose <code>tabs</code> need to be returned.
|
* Window whose <code>tabs</code> need to be returned.
|
||||||
*
|
*
|
||||||
* @returns {Array<Tab>}
|
* @returns {Array<Tab>}
|
||||||
* The list of tabs. Will return an empty list if tab browser is not available.
|
* The list of tabs. Will return an empty list if tab browser is not available
|
||||||
|
* or tabs are undefined.
|
||||||
*/
|
*/
|
||||||
getTabsForWindow(win) {
|
getTabsForWindow(win) {
|
||||||
const tabBrowser = this.getTabBrowser(win);
|
const tabBrowser = this.getTabBrowser(win);
|
||||||
return tabBrowser ? tabBrowser.tabs : [];
|
// For web-platform reftests a faked tabbrowser is used,
|
||||||
|
// which does not actually have tabs.
|
||||||
|
if (tabBrowser && tabBrowser.tabs) {
|
||||||
|
return tabBrowser.tabs;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
},
|
},
|
||||||
|
|
||||||
getWindowForTab(tab) {
|
getWindowForTab(tab) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue