File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ export class AddEditV2Component implements OnInit, OnDestroy {
220220
221221 ngOnDestroy ( ) {
222222 if ( this . messageListener ) {
223- chrome . runtime . onMessage . removeListener ( this . messageListener ) ;
223+ BrowserApi . removeListener ( chrome . runtime . onMessage , this . messageListener ) ;
224224 }
225225 }
226226
Original file line number Diff line number Diff line change @@ -97,11 +97,6 @@ async function openAddEditVaultItemPopout(
9797 let singleActionKey = VaultPopoutType . addEditVaultItem ;
9898 let addEditCipherUrl = "popup/index.html#/edit-cipher" ;
9999 let queryParamToken = "?" ;
100- const extensionUrl = chrome . runtime . getURL ( "popup/index.html" ) ;
101- const existingPopupTabs = await BrowserApi . tabsQuery ( { url : `${ extensionUrl } *` } ) ;
102- const existingPopup = existingPopupTabs . find ( ( tab ) =>
103- tab . url ?. includes ( `singleActionPopout=${ singleActionKey } ` ) ,
104- ) ;
105100 const formatQueryString = ( key : string , value : string ) => {
106101 const queryString = `${ queryParamToken } ${ key } =${ value } ` ;
107102 queryParamToken = "&" ;
@@ -120,6 +115,11 @@ async function openAddEditVaultItemPopout(
120115 addEditCipherUrl += formatQueryString ( "uri" , url ) ;
121116 }
122117
118+ const extensionUrl = chrome . runtime . getURL ( "popup/index.html" ) ;
119+ const existingPopupTabs = await BrowserApi . tabsQuery ( { url : `${ extensionUrl } *` } ) ;
120+ const existingPopup = existingPopupTabs . find ( ( tab ) =>
121+ tab . url ?. includes ( `singleActionPopout=${ singleActionKey } ` ) ,
122+ ) ;
123123 // Check if the an existing popup is already open
124124 if ( existingPopup ) {
125125 await chrome . runtime . sendMessage ( {
You can’t perform that action at this time.
0 commit comments