@onekeyfe/cross-inpage-provider-core 2.1.0 → 2.1.2

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const version = '2.1.0';
3
+ const version = '2.1.2';
4
4
  const versionBuild = '2020-0101-1';
5
5
  exports.default = {
6
6
  version,
@@ -91,10 +91,12 @@ function checkEnableDefineProperty(property) {
91
91
  exports.checkEnableDefineProperty = checkEnableDefineProperty;
92
92
  function defineWindowProperty(property, provider, options) {
93
93
  var _a;
94
- if (!checkPlatformEnable(options === null || options === void 0 ? void 0 : options.disablePlatform))
95
- return;
96
- if (!checkWalletSwitchEnable())
97
- return;
94
+ if (!(options === null || options === void 0 ? void 0 : options.alwaysInject)) {
95
+ if (!checkPlatformEnable(options === null || options === void 0 ? void 0 : options.disablePlatform))
96
+ return;
97
+ if (!checkWalletSwitchEnable())
98
+ return;
99
+ }
98
100
  const enable = checkEnableDefineProperty(property);
99
101
  const proxyProvider = new Proxy(provider, {
100
102
  defineProperty(target, property, attributes) {
@@ -1,4 +1,4 @@
1
- const version = '2.1.0';
1
+ const version = '2.1.2';
2
2
  const versionBuild = '2020-0101-1';
3
3
  export default {
4
4
  version,
@@ -16,4 +16,5 @@ export declare function checkEnableDefineProperty(property: string): boolean;
16
16
  export declare function defineWindowProperty(property: string, provider: unknown, options?: {
17
17
  enumerable?: boolean;
18
18
  disablePlatform?: IPlatformType[];
19
+ alwaysInject?: boolean;
19
20
  }): void;
@@ -85,10 +85,12 @@ export function checkEnableDefineProperty(property) {
85
85
  }
86
86
  export function defineWindowProperty(property, provider, options) {
87
87
  var _a;
88
- if (!checkPlatformEnable(options === null || options === void 0 ? void 0 : options.disablePlatform))
89
- return;
90
- if (!checkWalletSwitchEnable())
91
- return;
88
+ if (!(options === null || options === void 0 ? void 0 : options.alwaysInject)) {
89
+ if (!checkPlatformEnable(options === null || options === void 0 ? void 0 : options.disablePlatform))
90
+ return;
91
+ if (!checkWalletSwitchEnable())
92
+ return;
93
+ }
92
94
  const enable = checkEnableDefineProperty(property);
93
95
  const proxyProvider = new Proxy(provider, {
94
96
  defineProperty(target, property, attributes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cross-inpage-provider-core",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -29,9 +29,9 @@
29
29
  "build-version-info": "node ./scripts/buildVersionInfo.js"
30
30
  },
31
31
  "dependencies": {
32
- "@onekeyfe/cross-inpage-provider-errors": "2.1.0",
33
- "@onekeyfe/cross-inpage-provider-events": "2.1.0",
34
- "@onekeyfe/cross-inpage-provider-types": "2.1.0",
32
+ "@onekeyfe/cross-inpage-provider-errors": "2.1.2",
33
+ "@onekeyfe/cross-inpage-provider-events": "2.1.2",
34
+ "@onekeyfe/cross-inpage-provider-types": "2.1.2",
35
35
  "events": "^3.3.0",
36
36
  "lodash-es": "^4.17.21",
37
37
  "ms": "^2.1.3"
@@ -39,5 +39,5 @@
39
39
  "devDependencies": {
40
40
  "@types/lodash-es": "^4.17.12"
41
41
  },
42
- "gitHead": "6c27b10b87edbd6d6c839566276c7f6f9cb4940c"
42
+ "gitHead": "18c5992b3eb11029f807d9488d2bb8a378e9b503"
43
43
  }