@dynamic-labs-wallet/browser-wallet-client 0.0.278 → 0.0.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +14 -2
- package/index.esm.js +14 -2
- package/package.json +2 -2
- package/src/services/messageTransportBridge.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -166,8 +166,20 @@ const setupMessageTransportBridge = (messageTransport$1, iframe, iframeOrigin)=>
|
|
|
166
166
|
messageTransport$1.on((message)=>{
|
|
167
167
|
// Forward the message to webview via postMessage
|
|
168
168
|
if (message.origin === 'host') {
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
try {
|
|
170
|
+
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
171
|
+
const error = new Error('Cannot send message to iframe: contentWindow is unavailable');
|
|
172
|
+
logger.error(error.message);
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
iframe.contentWindow.postMessage(message, iframeOrigin);
|
|
176
|
+
} catch (error) {
|
|
177
|
+
// This catches "Attempt to postMessage on disconnected port" errors
|
|
178
|
+
// which occur when the iframe has been navigated away or destroyed
|
|
179
|
+
logger.error('Failed to post message to iframe:', error);
|
|
180
|
+
// Re-throw to trigger recovery mechanism and timeout handling
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
184
|
});
|
|
173
185
|
const handleIncomingMessage = (message)=>{
|
package/index.esm.js
CHANGED
|
@@ -165,8 +165,20 @@ const setupMessageTransportBridge = (messageTransport, iframe, iframeOrigin)=>{
|
|
|
165
165
|
messageTransport.on((message)=>{
|
|
166
166
|
// Forward the message to webview via postMessage
|
|
167
167
|
if (message.origin === 'host') {
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
try {
|
|
169
|
+
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
170
|
+
const error = new Error('Cannot send message to iframe: contentWindow is unavailable');
|
|
171
|
+
logger.error(error.message);
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
iframe.contentWindow.postMessage(message, iframeOrigin);
|
|
175
|
+
} catch (error) {
|
|
176
|
+
// This catches "Attempt to postMessage on disconnected port" errors
|
|
177
|
+
// which occur when the iframe has been navigated away or destroyed
|
|
178
|
+
logger.error('Failed to post message to iframe:', error);
|
|
179
|
+
// Re-throw to trigger recovery mechanism and timeout handling
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
170
182
|
}
|
|
171
183
|
});
|
|
172
184
|
const handleIncomingMessage = (message)=>{
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.280",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/core": "0.0.280",
|
|
8
8
|
"@dynamic-labs/logger": "^4.25.3",
|
|
9
9
|
"@dynamic-labs/message-transport": "^4.25.3",
|
|
10
10
|
"uuid": "11.1.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageTransportBridge.d.ts","sourceRoot":"","sources":["../../src/services/messageTransportBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EAGvC,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,2BAA2B,qBACpB,iCAAiC,UAC3C,iBAAiB,gBACX,MAAM,
|
|
1
|
+
{"version":3,"file":"messageTransportBridge.d.ts","sourceRoot":"","sources":["../../src/services/messageTransportBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iCAAiC,EAGvC,MAAM,iCAAiC,CAAC;AAGzC,eAAO,MAAM,2BAA2B,qBACpB,iCAAiC,UAC3C,iBAAiB,gBACX,MAAM,SA+DrB,CAAC"}
|