@subwallet/extension-base 1.1.35-beta.0 → 1.1.35-beta.1

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/cjs/utils/mv3.js CHANGED
@@ -4,11 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isSupportWindow = exports.isManifestV3 = void 0;
7
- var _chrome, _chrome$runtime, _chrome$runtime$getMa;
8
7
  // Copyright 2019-2022 @subwallet/extension-base authors & contributors
9
8
  // SPDX-License-Identifier: Apache-2.0
10
9
 
11
- const isManifestV3 = ((_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : (_chrome$runtime$getMa = _chrome$runtime.getManifest()) === null || _chrome$runtime$getMa === void 0 ? void 0 : _chrome$runtime$getMa.manifest_version) === 3;
10
+ function detectMv3() {
11
+ try {
12
+ var _chrome, _chrome$runtime, _chrome$runtime$getMa;
13
+ return ((_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : (_chrome$runtime$getMa = _chrome$runtime.getManifest()) === null || _chrome$runtime$getMa === void 0 ? void 0 : _chrome$runtime$getMa.manifest_version) === 3;
14
+ } catch (error) {
15
+ return false;
16
+ }
17
+ }
18
+ const isManifestV3 = detectMv3();
12
19
  exports.isManifestV3 = isManifestV3;
13
20
  const isSupportWindow = typeof window !== 'undefined';
14
21
  exports.isSupportWindow = isSupportWindow;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.1.35-beta.0",
20
+ "version": "1.1.35-beta.1",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
package/utils/mv3.js CHANGED
@@ -1,6 +1,13 @@
1
- var _chrome, _chrome$runtime, _chrome$runtime$getMa;
2
1
  // Copyright 2019-2022 @subwallet/extension-base authors & contributors
3
2
  // SPDX-License-Identifier: Apache-2.0
4
3
 
5
- export const isManifestV3 = ((_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : (_chrome$runtime$getMa = _chrome$runtime.getManifest()) === null || _chrome$runtime$getMa === void 0 ? void 0 : _chrome$runtime$getMa.manifest_version) === 3;
4
+ function detectMv3() {
5
+ try {
6
+ var _chrome, _chrome$runtime, _chrome$runtime$getMa;
7
+ return ((_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : (_chrome$runtime$getMa = _chrome$runtime.getManifest()) === null || _chrome$runtime$getMa === void 0 ? void 0 : _chrome$runtime$getMa.manifest_version) === 3;
8
+ } catch (error) {
9
+ return false;
10
+ }
11
+ }
12
+ export const isManifestV3 = detectMv3();
6
13
  export const isSupportWindow = typeof window !== 'undefined';