@onekeyfe/hd-web-sdk 0.1.26 → 0.1.27

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.
@@ -14600,7 +14600,7 @@ const UI_REQUEST = {
14600
14600
  FIRMWARE_NOT_INSTALLED: 'ui-device_firmware_not_installed',
14601
14601
  NOT_USE_ONEKEY_DEVICE: 'ui-device_please_use_onekey_device'
14602
14602
  };
14603
- const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${"0.1.26"}/`;
14603
+ const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${"0.1.27"}/`;
14604
14604
  const DEFAULT_PRIORITY = 2;
14605
14605
  const initialSettings = {
14606
14606
  configSrc: './data/config.json',
@@ -44779,6 +44779,7 @@ var IInjectedProviderNames;
44779
44779
  IInjectedProviderNames["ethereum"] = "ethereum";
44780
44780
  IInjectedProviderNames["conflux"] = "conflux";
44781
44781
  IInjectedProviderNames["solana"] = "solana";
44782
+ IInjectedProviderNames["starcoin"] = "starcoin";
44782
44783
  IInjectedProviderNames["sollet"] = "sollet";
44783
44784
  IInjectedProviderNames["near"] = "near";
44784
44785
  IInjectedProviderNames["$private"] = "$private";
@@ -45210,7 +45211,7 @@ function parseOpts(arg) {
45210
45211
 
45211
45212
 
45212
45213
  ;// CONCATENATED MODULE: ../../node_modules/@onekeyfe/cross-inpage-provider-core/dist/versionInfo.js
45213
- const version = '0.0.14';
45214
+ const version = '0.0.17';
45214
45215
  const versionBuild = '2020-0101-1';
45215
45216
  /* harmony default export */ const dist_versionInfo = ({
45216
45217
  version,
@@ -45916,6 +45917,12 @@ class JsBridgeSimple extends (/* unused pure expression or super */ null && (JsB
45916
45917
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
45917
45918
 
45918
45919
  let postMessageListenerAdded = false;
45920
+ /**
45921
+ * When the JsBridgeIframe instance changes, the tag can be changed manually
45922
+ */
45923
+ function setPostMessageListenerFlag(value) {
45924
+ postMessageListenerAdded = value;
45925
+ }
45919
45926
  function setupPostMessageListener(options = {}) {
45920
45927
  if (postMessageListenerAdded) {
45921
45928
  return;
@@ -46052,6 +46059,7 @@ let frameBridge; // eslint-disable-next-line import/no-mutable-exports
46052
46059
 
46053
46060
  let hostBridge;
46054
46061
  const Log = (0,dist/* getLogger */.jl)(dist/* LoggerNames.SendMessage */.d0.SendMessage);
46062
+ const resetListenerFlag = () => setPostMessageListenerFlag(false);
46055
46063
  const createJsBridge = params => {
46056
46064
  const bridge = new JsBridgeIframe(params);
46057
46065
 
@@ -46168,17 +46176,22 @@ const cancel = connectId => {
46168
46176
  });
46169
46177
  };
46170
46178
 
46179
+ let prevFrameInstance = null;
46180
+
46171
46181
  const createJSBridge = messageEvent => {
46182
+ var _iframe$instance;
46183
+
46172
46184
  if (messageEvent.origin !== origin) {
46173
46185
  return;
46174
46186
  }
46175
46187
 
46176
- if (!hostBridge) {
46177
- var _iframe$instance;
46188
+ if (!hostBridge || prevFrameInstance !== ((_iframe$instance = instance) === null || _iframe$instance === void 0 ? void 0 : _iframe$instance.contentWindow)) {
46189
+ var _iframe$instance2, _iframe$instance3;
46178
46190
 
46191
+ resetListenerFlag();
46179
46192
  createJsBridge({
46180
46193
  isHost: true,
46181
- remoteFrame: (_iframe$instance = instance) === null || _iframe$instance === void 0 ? void 0 : _iframe$instance.contentWindow,
46194
+ remoteFrame: (_iframe$instance2 = instance) === null || _iframe$instance2 === void 0 ? void 0 : _iframe$instance2.contentWindow,
46182
46195
  remoteFrameName: bridge_config.iframeName,
46183
46196
  selfFrameName: bridge_config.hostName,
46184
46197
  channel: bridge_config.channel,
@@ -46199,6 +46212,7 @@ const createJSBridge = messageEvent => {
46199
46212
  return response;
46200
46213
  }
46201
46214
  });
46215
+ prevFrameInstance = (_iframe$instance3 = instance) === null || _iframe$instance3 === void 0 ? void 0 : _iframe$instance3.contentWindow;
46202
46216
  }
46203
46217
  };
46204
46218
 
@@ -46218,7 +46232,7 @@ const src_init = async settings => {
46218
46232
 
46219
46233
  try {
46220
46234
  await init({ ..._settings,
46221
- version: "0.1.26"
46235
+ version: "0.1.27"
46222
46236
  });
46223
46237
  return true;
46224
46238
  } catch (e) {