File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,11 +2,21 @@ import browser from 'webextension-polyfill';
22
33const getText = browser . i18n . getMessage ;
44
5- function createTab ( url , { index, active = true } = { } ) {
5+ async function createTab (
6+ url ,
7+ { index = null , active = true , openerTabId = null } = { }
8+ ) {
69 const props = { url, active} ;
7- if ( typeof index !== 'undefined' ) {
10+ if ( index !== null ) {
811 props . index = index ;
912 }
13+ if (
14+ openerTabId !== null &&
15+ openerTabId !== browser . tabs . TAB_ID_NONE &&
16+ ! ( await isAndroid ( ) )
17+ ) {
18+ props . openerTabId = openerTabId ;
19+ }
1020 return browser . tabs . create ( props ) ;
1121}
1222
@@ -18,4 +28,9 @@ async function getActiveTab() {
1828 return tab ;
1929}
2030
31+ async function isAndroid ( ) {
32+ const { os} = await browser . runtime . getPlatformInfo ( ) ;
33+ return os === 'android' ;
34+ }
35+
2136export { getText , createTab , getActiveTab } ;
You can’t perform that action at this time.
0 commit comments