@lark-apaas/client-toolkit 1.1.3 → 1.1.5

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.
@@ -21,7 +21,7 @@ function PageHoc(props) {
21
21
  type: 'PageScreenshot',
22
22
  data: imgEle.src
23
23
  });
24
- });
24
+ }).catch(()=>{});
25
25
  }, 1000);
26
26
  return ()=>clearTimeout(timer);
27
27
  }
@@ -254,7 +254,7 @@ const comprehensiveInterceptor = (logger)=>({
254
254
  });
255
255
  }
256
256
  });
257
- const interceptors = [
257
+ const interceptors = 'production' !== process.env.NODE_ENV ? [
258
258
  comprehensiveInterceptor
259
- ];
259
+ ] : null;
260
260
  export { interceptors };
@@ -1,6 +1,10 @@
1
1
  import { getPreviewParentOrigin } from "./getParentOrigin.js";
2
2
  function postMessage(message, targetOrigin) {
3
- window.parent.postMessage(message, targetOrigin ?? getPreviewParentOrigin());
3
+ try {
4
+ window.parent.postMessage(message, targetOrigin ?? getPreviewParentOrigin());
5
+ } catch (e) {
6
+ console.error('postMessage error', e);
7
+ }
4
8
  }
5
9
  function isOutgoingMessage(msg, type) {
6
10
  return msg.type === type;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [