From 247fc05d1cb79e2096187c20d6e83fc86040240e Mon Sep 17 00:00:00 2001 From: Colin Caine Date: Fri, 20 Jul 2018 13:39:59 +0100 Subject: [PATCH] Simplify open() --- src/excmds.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/excmds.ts b/src/excmds.ts index fd599e73..1191066e 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -863,11 +863,10 @@ export async function open(...urlarr: string[]) { let url = urlarr.join(" ") // Setting window.location to about:blank results in a page we can't access, tabs.update works. - if (["about:blank"].includes(url)) { - url = url || undefined + if (url === "about:blank") { browserBg.tabs.update(await activeTabId(), { url }) - // Open URLs that firefox won't let us by running `firefox ` on the command line } else if (!ABOUT_WHITELIST.includes(url) && url.match(/^(about|file):.*/)) { + // Open URLs that firefox won't let us by running `firefox ` on the command line Messaging.message("commandline_background", "recvExStr", ["nativeopen " + url]) } else if (url !== "") { window.location.href = forceURI(url)