File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 33// This is used to mock these values for Storybook so you can develop your components
44// outside the Web Extension environment provided by a compatible browser
55// See .storybook/main.js to see how this module is swapped in for `webextension-polyfill`
6- export const browser : any = {
6+ const browser : any = {
77 tabs : {
88 executeScript ( currentTabId : number , details : any ) {
99 return Promise . resolve ( { done : true } ) ;
@@ -18,6 +18,7 @@ export const browser: any = {
1818 } ,
1919 } ,
2020} ;
21+ export default browser ;
2122
2223interface Tab {
2324 id : number ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function scrollWindow(position: number) {
2020 */
2121function executeScript ( position : number ) : void {
2222 // Query for the active tab in the current window
23- browser ? .tabs
23+ browser . tabs
2424 . query ( { active : true , currentWindow : true } )
2525 . then ( ( tabs : Tabs . Tab [ ] ) => {
2626 // Pulls current tab from browser.tabs.query response
@@ -52,9 +52,7 @@ function executeScript(position: number): void {
5252export function Popup ( ) {
5353 // Sends the `popupMounted` event
5454 React . useEffect ( ( ) => {
55- // NOTE - we use conditional chaining on `browser`import
56- // because it doesn't load up in Storybook
57- browser ?. runtime . sendMessage ( { popupMounted : true } ) ;
55+ browser . runtime . sendMessage ( { popupMounted : true } ) ;
5856 } , [ ] ) ;
5957
6058 // Renders the component tree
You can’t perform that action at this time.
0 commit comments