File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ class ChromeService implements AdapterBrowser<chrome.tabs.Tab> {
66 constructor ( ) { }
77
88 private async getActiveTab ( ) : Promise < chrome . tabs . Tab > {
9- const tabs = await new Promise < chrome . tabs . Tab [ ] > ( resolve => {
10- chrome . tabs . query ( { active : true , currentWindow : true } , resolve ) ;
11- } ) ;
9+ const tabs = await chrome . tabs . query ( { active : true , currentWindow : true } ) ;
1210 if ( tabs . length ) {
1311 return tabs [ 0 ] ;
1412 } else {
Original file line number Diff line number Diff line change @@ -6,10 +6,8 @@ class FirefoxService implements AdapterBrowser<browser.tabs.Tab> {
66 constructor ( ) { }
77
88 private async getActiveTab ( ) : Promise < browser . tabs . Tab > {
9- const tabs = await new Promise < browser . tabs . Tab [ ] > ( ( ) => {
10- browser . tabs . query ( { active : true , currentWindow : true } ) ;
11- } ) ;
12- if ( tabs . length ) {
9+ const tabs = await browser . tabs . query ( { active : true , currentWindow : true } ) ;
10+ if ( tabs . length > 0 ) {
1311 return tabs [ 0 ] ;
1412 } else {
1513 throw new Error ( 'No active tab found' ) ;
You can’t perform that action at this time.
0 commit comments