@subwallet/extension-base 1.1.12-1 → 1.1.13-0

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.
@@ -214,6 +214,7 @@ export interface RequestAccountEdit {
214
214
  }
215
215
  export interface RequestAccountForget {
216
216
  address: string;
217
+ lockAfter: boolean;
217
218
  }
218
219
  export interface RequestAccountShow {
219
220
  address: string;
@@ -123,7 +123,7 @@ async function subscribeCrowdloan(addresses, substrateApiMap, callback, chainInf
123
123
  }
124
124
  if (networkKey === _chainList.COMMON_CHAIN_SLUGS.ACALA) {
125
125
  const acalaAddresses = substrateAddresses.map(address => (0, _utils2.reformatAddress)(address, (0, _utils._getChainSubstrateAddressPrefix)(chainInfo), (0, _utils._isChainEvmCompatible)(chainInfo)));
126
- unsubMap.acala = subscribeAcalaContributeInterval(acalaAddresses, polkadotFundsStatusMap[paraId], crowdloanCb);
126
+ unsubMap.acala = subscribeAcalaContributeInterval(acalaAddresses, _KoniTypes.CrowdloanParaState.COMPLETED, crowdloanCb);
127
127
  } else if (parentChain === _chainList.COMMON_CHAIN_SLUGS.POLKADOT && polkadotFundsStatusMap[paraId]) {
128
128
  unsubMap[networkKey] = getRPCCrowdloan(polkadotAPI, paraId, hexAddresses, polkadotFundsStatusMap[paraId], crowdloanCb);
129
129
  } else if (parentChain === _chainList.COMMON_CHAIN_SLUGS.KUSAMA && kusamaFundsStatusMap[paraId]) {
@@ -1175,7 +1175,7 @@ class KoniExtension {
1175
1175
  address: _constants.ALL_ACCOUNT_KEY,
1176
1176
  currentGenesisHash: allGenesisHash || null,
1177
1177
  allGenesisHash
1178
- });
1178
+ }, undefined, true);
1179
1179
  }
1180
1180
  changedAccount = true;
1181
1181
  }
@@ -1192,7 +1192,8 @@ class KoniExtension {
1192
1192
  }
1193
1193
  async accountsForgetOverride(_ref36) {
1194
1194
  let {
1195
- address
1195
+ address,
1196
+ lockAfter
1196
1197
  } = _ref36;
1197
1198
  _uiKeyring.keyring.forgetAccount(address);
1198
1199
  await new Promise(resolve => {
@@ -1224,6 +1225,9 @@ class KoniExtension {
1224
1225
  }, resolve);
1225
1226
  });
1226
1227
  await this.#koniState.disableMantaPay(address);
1228
+ if (lockAfter) {
1229
+ this.checkLockAfterMigrate();
1230
+ }
1227
1231
  return true;
1228
1232
  }
1229
1233
  seedCreateV2(_ref37) {
@@ -1391,9 +1395,10 @@ class KoniExtension {
1391
1395
  _uiKeyring.keyring.restoreAccounts(file, password);
1392
1396
  this._addAddressesToAuthList(addressList, isAllowed);
1393
1397
  });
1394
- if (this.#alwaysLock) {
1395
- this.keyringLock();
1396
- }
1398
+
1399
+ // if (this.#alwaysLock) {
1400
+ // this.keyringLock();
1401
+ // }
1397
1402
  } catch (error) {
1398
1403
  throw new Error(error.message);
1399
1404
  }
@@ -2799,7 +2804,7 @@ class KoniExtension {
2799
2804
  };
2800
2805
  }
2801
2806
  this.#koniState.updateKeyringState();
2802
- if (this.#alwaysLock) {
2807
+ if (this.#alwaysLock && !createNew) {
2803
2808
  this.keyringLock();
2804
2809
  }
2805
2810
  return {
@@ -2810,6 +2815,15 @@ class KoniExtension {
2810
2815
 
2811
2816
  // Migrate password
2812
2817
 
2818
+ checkLockAfterMigrate() {
2819
+ const pairs = _uiKeyring.keyring.getPairs();
2820
+ const needMigrate = !!pairs.filter(acc => acc.address !== _constants.ALL_ACCOUNT_KEY && !acc.meta.isExternal && !acc.meta.isInjected).filter(acc => !acc.meta.isMasterPassword).length;
2821
+ if (!needMigrate) {
2822
+ if (this.#alwaysLock) {
2823
+ this.keyringLock();
2824
+ }
2825
+ }
2826
+ }
2813
2827
  keyringMigrateMasterPassword(_ref66) {
2814
2828
  let {
2815
2829
  address,
@@ -2817,6 +2831,7 @@ class KoniExtension {
2817
2831
  } = _ref66;
2818
2832
  try {
2819
2833
  _uiKeyring.keyring.migrateWithMasterPassword(address, password);
2834
+ this.checkLockAfterMigrate();
2820
2835
  } catch (e) {
2821
2836
  console.error(e);
2822
2837
  return {
@@ -475,7 +475,7 @@ class KoniState {
475
475
  subscribeStakingReward() {
476
476
  return this.stakingRewardSubject;
477
477
  }
478
- setCurrentAccount(data, callback) {
478
+ setCurrentAccount(data, callback, preventOneAccount) {
479
479
  const {
480
480
  address,
481
481
  currentGenesisHash
@@ -490,9 +490,13 @@ class KoniState {
490
490
  if (pairs.length > 1 || !pair) {
491
491
  result.allGenesisHash = currentGenesisHash || undefined;
492
492
  } else {
493
- result.address = pair.address;
494
- result.currentGenesisHash = pairGenesisHash || '';
495
- result.allGenesisHash = pairGenesisHash || undefined;
493
+ if (!preventOneAccount) {
494
+ result.address = pair.address;
495
+ result.currentGenesisHash = pairGenesisHash || '';
496
+ result.allGenesisHash = pairGenesisHash || undefined;
497
+ } else {
498
+ result.allGenesisHash = currentGenesisHash || undefined;
499
+ }
496
500
  }
497
501
  }
498
502
  this.keyringService.setCurrentAccount(result);
@@ -13,6 +13,6 @@ const packageInfo = {
13
13
  name: '@subwallet/extension-base',
14
14
  path: typeof __dirname === 'string' ? __dirname : 'auto',
15
15
  type: 'cjs',
16
- version: '1.1.12-1'
16
+ version: '1.1.13-0'
17
17
  };
18
18
  exports.packageInfo = packageInfo;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -8,6 +9,7 @@ var _types = require("@subwallet/chain-list/types");
8
9
  var _AbstractChainHandler = require("@subwallet/extension-base/services/chain-service/handler/AbstractChainHandler");
9
10
  var _EvmApi2 = require("@subwallet/extension-base/services/chain-service/handler/EvmApi");
10
11
  var _helper = require("@subwallet/extension-base/services/chain-service/helper");
12
+ var _bignumber = _interopRequireDefault(require("bignumber.js"));
11
13
  var _logger = require("@polkadot/util/logger");
12
14
  // Copyright 2019-2022 @subwallet/extension-base authors & contributors
13
15
  // SPDX-License-Identifier: Apache-2.0
@@ -134,7 +136,7 @@ class EvmChainHandler extends _AbstractChainHandler.AbstractChainHandler {
134
136
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
135
137
  tokenContract.methods.symbol().call()]);
136
138
  name = _symbol;
137
- decimals = _decimals;
139
+ decimals = new _bignumber.default(_decimals).toNumber();
138
140
  symbol = _symbol;
139
141
  }
140
142
  if (name === '' || symbol === '') {
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _utils = require("@subwallet/extension-base/services/chain-service/utils");
9
+ var _Base = _interopRequireDefault(require("@subwallet/extension-base/services/migration-service/Base"));
10
+ // Copyright 2019-2022 @subwallet/extension-base authors & contributors
11
+ // SPDX-License-Identifier: Apache-2.0
12
+
13
+ class MigrateTokenDecimals extends _Base.default {
14
+ async run() {
15
+ const state = this.state;
16
+ return new Promise(resolve => {
17
+ const assetMap = state.getAssetRegistry();
18
+ for (const [slug, info] of Object.entries(assetMap)) {
19
+ if ((0, _utils._isCustomAsset)(slug)) {
20
+ state.chainService.upsertCustomToken({
21
+ ...info,
22
+ decimals: info.decimals ? parseInt(info.decimals.toString()) : info.decimals
23
+ });
24
+ }
25
+ }
26
+ resolve();
27
+ });
28
+ }
29
+ }
30
+ exports.default = MigrateTokenDecimals;
@@ -15,6 +15,7 @@ var _MigrateImportedToken = _interopRequireDefault(require("./MigrateImportedTok
15
15
  var _MigrateLedgerAccount = _interopRequireDefault(require("./MigrateLedgerAccount"));
16
16
  var _MigrateNetworkSettings = _interopRequireDefault(require("./MigrateNetworkSettings"));
17
17
  var _MigrateSettings = _interopRequireDefault(require("./MigrateSettings"));
18
+ var _MigrateTokenDecimals = _interopRequireDefault(require("./MigrateTokenDecimals"));
18
19
  var _MigrateTransactionHistory = _interopRequireDefault(require("./MigrateTransactionHistory"));
19
20
  var _MigrateWalletReference = _interopRequireDefault(require("./MigrateWalletReference"));
20
21
  // Copyright 2019-2022 @subwallet/extension-koni authors & contributors
@@ -34,7 +35,8 @@ var _default = {
34
35
  '1.0.9-01': _MigrateLedgerAccount.default,
35
36
  '1.0.12-02': _MigrateEthProvider.default,
36
37
  '1.1.6-01': _MigrateWalletReference.default,
37
- '1.1.7': _DeleteChain.default
38
+ '1.1.7': _DeleteChain.default,
39
+ '1.1.13-01': _MigrateTokenDecimals.default
38
40
  // [`${EVERYTIME}-1`]: AutoEnableChainsTokens
39
41
  };
40
42
  exports.default = _default;
@@ -70,7 +70,7 @@ const getOS = () => {
70
70
  // @ts-ignore
71
71
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
72
72
  const platform = ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgentData) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform;
73
- const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
73
+ const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K', 'macOS'];
74
74
  const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
75
75
  const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
76
76
  let os = 'Unknown';
@@ -108,7 +108,7 @@ export async function subscribeCrowdloan(addresses, substrateApiMap, callback, c
108
108
  }
109
109
  if (networkKey === COMMON_CHAIN_SLUGS.ACALA) {
110
110
  const acalaAddresses = substrateAddresses.map(address => reformatAddress(address, _getChainSubstrateAddressPrefix(chainInfo), _isChainEvmCompatible(chainInfo)));
111
- unsubMap.acala = subscribeAcalaContributeInterval(acalaAddresses, polkadotFundsStatusMap[paraId], crowdloanCb);
111
+ unsubMap.acala = subscribeAcalaContributeInterval(acalaAddresses, CrowdloanParaState.COMPLETED, crowdloanCb);
112
112
  } else if (parentChain === COMMON_CHAIN_SLUGS.POLKADOT && polkadotFundsStatusMap[paraId]) {
113
113
  unsubMap[networkKey] = getRPCCrowdloan(polkadotAPI, paraId, hexAddresses, polkadotFundsStatusMap[paraId], crowdloanCb);
114
114
  } else if (parentChain === COMMON_CHAIN_SLUGS.KUSAMA && kusamaFundsStatusMap[paraId]) {
@@ -171,6 +171,7 @@ export default class KoniExtension {
171
171
  private submitTuringCancelStakeCompound;
172
172
  private keyringStateSubscribe;
173
173
  private keyringChangeMasterPassword;
174
+ private checkLockAfterMigrate;
174
175
  private keyringMigrateMasterPassword;
175
176
  private keyringUnlock;
176
177
  private keyringLock;
@@ -1131,7 +1131,7 @@ export default class KoniExtension {
1131
1131
  address: ALL_ACCOUNT_KEY,
1132
1132
  currentGenesisHash: allGenesisHash || null,
1133
1133
  allGenesisHash
1134
- });
1134
+ }, undefined, true);
1135
1135
  }
1136
1136
  changedAccount = true;
1137
1137
  }
@@ -1147,7 +1147,8 @@ export default class KoniExtension {
1147
1147
  return addressDict;
1148
1148
  }
1149
1149
  async accountsForgetOverride({
1150
- address
1150
+ address,
1151
+ lockAfter
1151
1152
  }) {
1152
1153
  keyring.forgetAccount(address);
1153
1154
  await new Promise(resolve => {
@@ -1179,6 +1180,9 @@ export default class KoniExtension {
1179
1180
  }, resolve);
1180
1181
  });
1181
1182
  await this.#koniState.disableMantaPay(address);
1183
+ if (lockAfter) {
1184
+ this.checkLockAfterMigrate();
1185
+ }
1182
1186
  return true;
1183
1187
  }
1184
1188
  seedCreateV2({
@@ -1338,9 +1342,10 @@ export default class KoniExtension {
1338
1342
  keyring.restoreAccounts(file, password);
1339
1343
  this._addAddressesToAuthList(addressList, isAllowed);
1340
1344
  });
1341
- if (this.#alwaysLock) {
1342
- this.keyringLock();
1343
- }
1345
+
1346
+ // if (this.#alwaysLock) {
1347
+ // this.keyringLock();
1348
+ // }
1344
1349
  } catch (error) {
1345
1350
  throw new Error(error.message);
1346
1351
  }
@@ -2724,7 +2729,7 @@ export default class KoniExtension {
2724
2729
  };
2725
2730
  }
2726
2731
  this.#koniState.updateKeyringState();
2727
- if (this.#alwaysLock) {
2732
+ if (this.#alwaysLock && !createNew) {
2728
2733
  this.keyringLock();
2729
2734
  }
2730
2735
  return {
@@ -2735,12 +2740,22 @@ export default class KoniExtension {
2735
2740
 
2736
2741
  // Migrate password
2737
2742
 
2743
+ checkLockAfterMigrate() {
2744
+ const pairs = keyring.getPairs();
2745
+ const needMigrate = !!pairs.filter(acc => acc.address !== ALL_ACCOUNT_KEY && !acc.meta.isExternal && !acc.meta.isInjected).filter(acc => !acc.meta.isMasterPassword).length;
2746
+ if (!needMigrate) {
2747
+ if (this.#alwaysLock) {
2748
+ this.keyringLock();
2749
+ }
2750
+ }
2751
+ }
2738
2752
  keyringMigrateMasterPassword({
2739
2753
  address,
2740
2754
  password
2741
2755
  }) {
2742
2756
  try {
2743
2757
  keyring.migrateWithMasterPassword(address, password);
2758
+ this.checkLockAfterMigrate();
2744
2759
  } catch (e) {
2745
2760
  console.error(e);
2746
2761
  return {
@@ -128,7 +128,7 @@ export default class KoniState {
128
128
  removeAccountRef(address: string, callback: () => void): void;
129
129
  getStakingReward(update: (value: StakingRewardJson) => void): void;
130
130
  subscribeStakingReward(): Subject<StakingRewardJson>;
131
- setCurrentAccount(data: CurrentAccountInfo, callback?: () => void): void;
131
+ setCurrentAccount(data: CurrentAccountInfo, callback?: () => void, preventOneAccount?: boolean): void;
132
132
  setAccountTie(address: string, genesisHash: string | null): boolean;
133
133
  switchEvmNetworkByUrl(shortenUrl: string, networkKey: string): Promise<void>;
134
134
  switchNetworkAccount(id: string, url: string, networkKey: string, changeAddress?: string): Promise<boolean>;
@@ -463,7 +463,7 @@ export default class KoniState {
463
463
  subscribeStakingReward() {
464
464
  return this.stakingRewardSubject;
465
465
  }
466
- setCurrentAccount(data, callback) {
466
+ setCurrentAccount(data, callback, preventOneAccount) {
467
467
  const {
468
468
  address,
469
469
  currentGenesisHash
@@ -478,9 +478,13 @@ export default class KoniState {
478
478
  if (pairs.length > 1 || !pair) {
479
479
  result.allGenesisHash = currentGenesisHash || undefined;
480
480
  } else {
481
- result.address = pair.address;
482
- result.currentGenesisHash = pairGenesisHash || '';
483
- result.allGenesisHash = pairGenesisHash || undefined;
481
+ if (!preventOneAccount) {
482
+ result.address = pair.address;
483
+ result.currentGenesisHash = pairGenesisHash || '';
484
+ result.allGenesisHash = pairGenesisHash || undefined;
485
+ } else {
486
+ result.allGenesisHash = currentGenesisHash || undefined;
487
+ }
484
488
  }
485
489
  }
486
490
  this.keyringService.setCurrentAccount(result);
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "./cjs/detectPackage.js"
18
18
  ],
19
19
  "type": "module",
20
- "version": "1.1.12-1",
20
+ "version": "1.1.13-0",
21
21
  "main": "./cjs/index.js",
22
22
  "module": "./index.js",
23
23
  "types": "./index.d.ts",
@@ -707,6 +707,11 @@
707
707
  "require": "./cjs/services/migration-service/scripts/MigrateSettings.js",
708
708
  "default": "./services/migration-service/scripts/MigrateSettings.js"
709
709
  },
710
+ "./services/migration-service/scripts/MigrateTokenDecimals": {
711
+ "types": "./services/migration-service/scripts/MigrateTokenDecimals.d.ts",
712
+ "require": "./cjs/services/migration-service/scripts/MigrateTokenDecimals.js",
713
+ "default": "./services/migration-service/scripts/MigrateTokenDecimals.js"
714
+ },
710
715
  "./services/migration-service/scripts/MigrateTransactionHistory": {
711
716
  "types": "./services/migration-service/scripts/MigrateTransactionHistory.d.ts",
712
717
  "require": "./cjs/services/migration-service/scripts/MigrateTransactionHistory.js",
@@ -1222,10 +1227,10 @@
1222
1227
  "@sora-substrate/type-definitions": "^1.17.7",
1223
1228
  "@substrate/connect": "^0.7.26",
1224
1229
  "@subwallet/chain-list": "^0.2.14",
1225
- "@subwallet/extension-base": "^1.1.12-1",
1226
- "@subwallet/extension-chains": "^1.1.12-1",
1227
- "@subwallet/extension-dapp": "^1.1.12-1",
1228
- "@subwallet/extension-inject": "^1.1.12-1",
1230
+ "@subwallet/extension-base": "^1.1.13-0",
1231
+ "@subwallet/extension-chains": "^1.1.13-0",
1232
+ "@subwallet/extension-dapp": "^1.1.13-0",
1233
+ "@subwallet/extension-inject": "^1.1.13-0",
1229
1234
  "@subwallet/keyring": "^0.1.1",
1230
1235
  "@subwallet/ui-keyring": "^0.1.1",
1231
1236
  "@walletconnect/sign-client": "^2.8.4",
package/packageInfo.js CHANGED
@@ -7,5 +7,5 @@ export const packageInfo = {
7
7
  name: '@subwallet/extension-base',
8
8
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
9
9
  type: 'esm',
10
- version: '1.1.12-1'
10
+ version: '1.1.13-0'
11
11
  };
@@ -5,6 +5,7 @@ import { _AssetType } from '@subwallet/chain-list/types';
5
5
  import { AbstractChainHandler } from '@subwallet/extension-base/services/chain-service/handler/AbstractChainHandler';
6
6
  import { EvmApi } from '@subwallet/extension-base/services/chain-service/handler/EvmApi';
7
7
  import { _ERC20_ABI, _ERC721_ABI } from '@subwallet/extension-base/services/chain-service/helper';
8
+ import BigN from 'bignumber.js';
8
9
  import { logger as createLogger } from '@polkadot/util/logger';
9
10
  export class EvmChainHandler extends AbstractChainHandler {
10
11
  evmApiMap = {};
@@ -127,7 +128,7 @@ export class EvmChainHandler extends AbstractChainHandler {
127
128
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
128
129
  tokenContract.methods.symbol().call()]);
129
130
  name = _symbol;
130
- decimals = _decimals;
131
+ decimals = new BigN(_decimals).toNumber();
131
132
  symbol = _symbol;
132
133
  }
133
134
  if (name === '' || symbol === '') {
@@ -0,0 +1,4 @@
1
+ import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
2
+ export default class MigrateTokenDecimals extends BaseMigrationJob {
3
+ run(): Promise<void>;
4
+ }
@@ -0,0 +1,22 @@
1
+ // Copyright 2019-2022 @subwallet/extension-base authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { _isCustomAsset } from '@subwallet/extension-base/services/chain-service/utils';
5
+ import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base';
6
+ export default class MigrateTokenDecimals extends BaseMigrationJob {
7
+ async run() {
8
+ const state = this.state;
9
+ return new Promise(resolve => {
10
+ const assetMap = state.getAssetRegistry();
11
+ for (const [slug, info] of Object.entries(assetMap)) {
12
+ if (_isCustomAsset(slug)) {
13
+ state.chainService.upsertCustomToken({
14
+ ...info,
15
+ decimals: info.decimals ? parseInt(info.decimals.toString()) : info.decimals
16
+ });
17
+ }
18
+ }
19
+ resolve();
20
+ });
21
+ }
22
+ }
@@ -11,6 +11,7 @@ import MigrateImportedToken from "./MigrateImportedToken.js";
11
11
  import MigrateLedgerAccount from "./MigrateLedgerAccount.js";
12
12
  import MigrateNetworkSettings from "./MigrateNetworkSettings.js";
13
13
  import MigrateSettings from "./MigrateSettings.js";
14
+ import MigrateTokenDecimals from "./MigrateTokenDecimals.js";
14
15
  import MigrateTransactionHistory from "./MigrateTransactionHistory.js";
15
16
  import MigrateWalletReference from "./MigrateWalletReference.js";
16
17
  export const EVERYTIME = '__everytime__';
@@ -26,6 +27,7 @@ export default {
26
27
  '1.0.9-01': MigrateLedgerAccount,
27
28
  '1.0.12-02': MigrateEthProvider,
28
29
  '1.1.6-01': MigrateWalletReference,
29
- '1.1.7': DeleteChain
30
+ '1.1.7': DeleteChain,
31
+ '1.1.13-01': MigrateTokenDecimals
30
32
  // [`${EVERYTIME}-1`]: AutoEnableChainsTokens
31
33
  };
@@ -63,7 +63,7 @@ export const getOS = () => {
63
63
  // @ts-ignore
64
64
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
65
65
  const platform = ((_window$navigator = window.navigator) === null || _window$navigator === void 0 ? void 0 : (_window$navigator$use = _window$navigator.userAgentData) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform;
66
- const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
66
+ const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K', 'macOS'];
67
67
  const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
68
68
  const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
69
69
  let os = 'Unknown';