@polkadot/extension-base 0.61.2 → 0.61.4

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.
@@ -20,7 +20,6 @@ export default class Tabs {
20
20
  private rpcSubscribeConnected;
21
21
  private rpcUnsubscribe;
22
22
  private redirectPhishingLanding;
23
- private parseUrl;
24
23
  private redirectIfPhishing;
25
24
  handle<TMessageType extends MessageTypes>(id: string, type: TMessageType, request: RequestTypes[TMessageType], url: string, port?: chrome.runtime.Port): Promise<ResponseTypes[keyof ResponseTypes]>;
26
25
  }
@@ -1,5 +1,4 @@
1
1
  import { combineLatest } from 'rxjs';
2
- import { parse } from 'tldts';
3
2
  import { checkIfDenied } from '@polkadot/phishing';
4
3
  import { keyring } from '@polkadot/ui-keyring';
5
4
  import { accounts as accountsObservable } from '@polkadot/ui-keyring/observable/accounts';
@@ -143,19 +142,6 @@ export default class Tabs {
143
142
  .forEach((id) => withErrorLog(() => chrome.tabs.update(id, { url })));
144
143
  });
145
144
  }
146
- parseUrl(rawUrl) {
147
- let from = 'extension';
148
- if (rawUrl) {
149
- try {
150
- const { hostname } = parse(rawUrl);
151
- from = hostname || '<unknown>'; // Only use the hostname
152
- }
153
- catch {
154
- from = '<unknown>';
155
- }
156
- }
157
- return from;
158
- }
159
145
  async redirectIfPhishing(url) {
160
146
  const isInDenyList = await checkIfDenied(url);
161
147
  if (isInDenyList) {
@@ -166,8 +152,7 @@ export default class Tabs {
166
152
  }
167
153
  async handle(id, type, request, url, port) {
168
154
  if (type === 'pub(phishing.redirectIfDenied)') {
169
- const parsedUrl = this.parseUrl(url);
170
- return this.redirectIfPhishing(parsedUrl);
155
+ return this.redirectIfPhishing(url);
171
156
  }
172
157
  if (type !== 'pub(authorize.tab)') {
173
158
  this.#state.ensureUrlAuthorized(url);
@@ -20,7 +20,6 @@ export default class Tabs {
20
20
  private rpcSubscribeConnected;
21
21
  private rpcUnsubscribe;
22
22
  private redirectPhishingLanding;
23
- private parseUrl;
24
23
  private redirectIfPhishing;
25
24
  handle<TMessageType extends MessageTypes>(id: string, type: TMessageType, request: RequestTypes[TMessageType], url: string, port?: chrome.runtime.Port): Promise<ResponseTypes[keyof ResponseTypes]>;
26
25
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const rxjs_1 = require("rxjs");
5
- const tldts_1 = require("tldts");
6
5
  const phishing_1 = require("@polkadot/phishing");
7
6
  const ui_keyring_1 = require("@polkadot/ui-keyring");
8
7
  const accounts_1 = require("@polkadot/ui-keyring/observable/accounts");
@@ -146,19 +145,6 @@ class Tabs {
146
145
  .forEach((id) => (0, helpers_js_1.withErrorLog)(() => chrome.tabs.update(id, { url })));
147
146
  });
148
147
  }
149
- parseUrl(rawUrl) {
150
- let from = 'extension';
151
- if (rawUrl) {
152
- try {
153
- const { hostname } = (0, tldts_1.parse)(rawUrl);
154
- from = hostname || '<unknown>'; // Only use the hostname
155
- }
156
- catch {
157
- from = '<unknown>';
158
- }
159
- }
160
- return from;
161
- }
162
148
  async redirectIfPhishing(url) {
163
149
  const isInDenyList = await (0, phishing_1.checkIfDenied)(url);
164
150
  if (isInDenyList) {
@@ -169,8 +155,7 @@ class Tabs {
169
155
  }
170
156
  async handle(id, type, request, url, port) {
171
157
  if (type === 'pub(phishing.redirectIfDenied)') {
172
- const parsedUrl = this.parseUrl(url);
173
- return this.redirectIfPhishing(parsedUrl);
158
+ return this.redirectIfPhishing(url);
174
159
  }
175
160
  if (type !== 'pub(authorize.tab)') {
176
161
  this.#state.ensureUrlAuthorized(url);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageInfo = void 0;
4
- exports.packageInfo = { name: '@polkadot/extension-base', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.61.2' };
4
+ exports.packageInfo = { name: '@polkadot/extension-base', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.61.4' };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "./cjs/packageDetect.js"
19
19
  ],
20
20
  "type": "module",
21
- "version": "0.61.2",
21
+ "version": "0.61.4",
22
22
  "main": "./cjs/index.js",
23
23
  "module": "./index.js",
24
24
  "types": "./index.d.ts",
@@ -479,22 +479,21 @@
479
479
  }
480
480
  },
481
481
  "dependencies": {
482
- "@polkadot/api": "^16.3.1",
483
- "@polkadot/extension-chains": "0.61.2",
484
- "@polkadot/extension-dapp": "0.61.2",
485
- "@polkadot/extension-inject": "0.61.2",
482
+ "@polkadot/api": "^16.4.1",
483
+ "@polkadot/extension-chains": "0.61.4",
484
+ "@polkadot/extension-dapp": "0.61.4",
485
+ "@polkadot/extension-inject": "0.61.4",
486
486
  "@polkadot/keyring": "^13.5.3",
487
487
  "@polkadot/networks": "^13.5.3",
488
- "@polkadot/phishing": "^0.25.14",
489
- "@polkadot/rpc-provider": "^16.3.1",
490
- "@polkadot/types": "^16.3.1",
488
+ "@polkadot/phishing": "^0.25.15",
489
+ "@polkadot/rpc-provider": "^16.4.1",
490
+ "@polkadot/types": "^16.4.1",
491
491
  "@polkadot/ui-keyring": "^3.15.2",
492
492
  "@polkadot/ui-settings": "^3.15.2",
493
493
  "@polkadot/util": "^13.5.3",
494
494
  "@polkadot/util-crypto": "^13.5.3",
495
495
  "eventemitter3": "^5.0.1",
496
496
  "rxjs": "^7.8.1",
497
- "tldts": "^7.0.8",
498
497
  "tslib": "^2.8.1"
499
498
  }
500
499
  }
package/packageInfo.js CHANGED
@@ -1 +1 @@
1
- export const packageInfo = { name: '@polkadot/extension-base', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.61.2' };
1
+ export const packageInfo = { name: '@polkadot/extension-base', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.61.4' };