changed targetOrigin and started qr buy order

This commit is contained in:
2024-11-03 16:10:28 +02:00
parent d50f928520
commit cf845cae1b
8 changed files with 184 additions and 75 deletions

View File

@@ -28,9 +28,9 @@ export const sendMessageBackground = (action, data = {}, timeout = 60000, isExte
return new Promise((resolve, reject) => {
const requestId = generateRequestId(); // Unique ID for each request
callbackMap.set(requestId, { resolve, reject }); // Store both resolve and reject callbacks
const targetOrigin = window.location.origin
// Send the message with `backgroundMessage` type
window.postMessage({ type: "backgroundMessage", action, requestId, payload: data, isExtension }, "*");
window.postMessage({ type: "backgroundMessage", action, requestId, payload: data, isExtension }, targetOrigin);
// Set up a timeout to automatically reject if no response is received
const timeoutId = setTimeout(() => {