From 1a6be158f1319bec7a440ff8efbd0c00180a1382 Mon Sep 17 00:00:00 2001 From: carumusan <879525+carumusan@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:57:53 +0000 Subject: [PATCH] Support ipfs and ipns urls (#667) Brave browser has native support for ipfs:// and ipns:// urls but this assertion is currently blocking. Updated to support them. Untested. --- packages/extension-base/src/background/handlers/State.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-base/src/background/handlers/State.ts b/packages/extension-base/src/background/handlers/State.ts index 1e0189bf..f813399d 100644 --- a/packages/extension-base/src/background/handlers/State.ts +++ b/packages/extension-base/src/background/handlers/State.ts @@ -239,7 +239,7 @@ export default class State { } private stripUrl (url: string): string { - assert(url && (url.startsWith('http:') || url.startsWith('https:')), `Invalid url ${url}, expected to start with http: or https:`); + assert(url && (url.startsWith('http:') || url.startsWith('https:') || url.startsWith('ipfs:') || url.startsWith('ipns:')), `Invalid url ${url}, expected to start with http: or https: or ipfs: or ipns:`); const parts = url.split('/');