File tree 1 file changed +12
-2
lines changed
Extension/src/common/api/extension 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 18
18
import browser , { type Tabs } from 'webextension-polyfill' ;
19
19
20
20
import { Prefs } from '../../../background/prefs' ;
21
+ import { UserAgent } from '../../user-agent' ;
21
22
22
23
/**
23
24
* Helper class for browser.tabs API.
@@ -45,9 +46,18 @@ export class TabsApi {
45
46
const { id, windowId } = tab ;
46
47
47
48
await browser . tabs . update ( id , { active : true } ) ;
48
- if ( windowId ) {
49
- await browser . windows . update ( windowId , { focused : true } ) ;
49
+
50
+ // browser.windows is not available in Firefox for Android
51
+ // TODO: check how it works in Edge on Android
52
+ if ( UserAgent . isFirefox && ( await UserAgent . getIsAndroid ( ) ) ) {
53
+ return ;
54
+ }
55
+
56
+ if ( ! windowId ) {
57
+ return ;
50
58
}
59
+
60
+ await browser . windows . update ( windowId , { focused : true } ) ;
51
61
}
52
62
53
63
/**
You can’t perform that action at this time.
0 commit comments