fix: multi extension loading

This commit is contained in:
kyranjamie
2023-07-21 15:24:44 +02:00
committed by kyranjamie
parent a2598a9498
commit 03465c06fe
3 changed files with 24 additions and 23 deletions

View File

@@ -128,8 +128,9 @@ document.addEventListener(DomEventName.psbtRequest, ((event: PsbtRequestEvent) =
});
}) as EventListener);
// Inject inpage script (Stacks Provider)
const inpage = document.createElement('script');
inpage.src = chrome.runtime.getURL('inpage.js');
inpage.id = 'stacks-wallet-provider';
document.body.appendChild(inpage);
window.addEventListener('load', () => {
const inpage = document.createElement('script');
inpage.src = chrome.runtime.getURL('inpage.js');
inpage.id = 'stacks-wallet-provider';
document.body.appendChild(inpage);
});

View File

@@ -3,12 +3,12 @@
*/
export enum DomEventName {
request = 'request',
authenticationRequest = 'stacksAuthenticationRequest',
signatureRequest = 'signatureRequest',
structuredDataSignatureRequest = 'structuredDataSignatureRequest',
transactionRequest = 'stacksTransactionRequest',
profileUpdateRequest = 'profileUpdateRequest',
psbtRequest = 'psbtRequest',
authenticationRequest = 'hiroWalletStacksAuthenticationRequest',
signatureRequest = 'hiroWalletSignatureRequest',
structuredDataSignatureRequest = 'hiroWalletStructuredDataSignatureRequest',
transactionRequest = 'hiroWalletStacksTransactionRequest',
profileUpdateRequest = 'hiroWalletProfileUpdateRequest',
psbtRequest = 'hiroWalletPsbtRequest',
}
export interface AuthenticationRequestEventDetails {

View File

@@ -11,18 +11,18 @@ export const MESSAGE_SOURCE = 'stacks-wallet' as const;
export const CONTENT_SCRIPT_PORT = 'content-script' as const;
export enum ExternalMethods {
transactionRequest = 'transactionRequest',
transactionResponse = 'transactionResponse',
authenticationRequest = 'authenticationRequest',
authenticationResponse = 'authenticationResponse',
signatureRequest = 'signatureRequest',
signatureResponse = 'signatureResponse',
structuredDataSignatureRequest = 'structuredDataSignatureRequest',
structuredDataSignatureResponse = 'structuredDataSignatureResponse',
profileUpdateRequest = 'profileUpdateRequest',
profileUpdateResponse = 'profileUpdateResponse',
psbtRequest = 'psbtRequest',
psbtResponse = 'psbtResponse',
transactionRequest = 'hiroWalletTransactionRequest',
transactionResponse = 'hiroWalletTransactionResponse',
authenticationRequest = 'hiroWalletAuthenticationRequest',
authenticationResponse = 'hiroWalletAuthenticationResponse',
signatureRequest = 'hiroWalletSignatureRequest',
signatureResponse = 'hiroWalletSignatureResponse',
structuredDataSignatureRequest = 'hiroWalletStructuredDataSignatureRequest',
structuredDataSignatureResponse = 'hiroWalletStructuredDataSignatureResponse',
profileUpdateRequest = 'hiroWalletProfileUpdateRequest',
profileUpdateResponse = 'hiroWalletProfileUpdateResponse',
psbtRequest = 'hiroWalletPsbtRequest',
psbtResponse = 'hiroWalletPsbtResponse',
}
export enum InternalMethods {