mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Simplify open()
This commit is contained in:
parent
12459b139b
commit
247fc05d1c
1 changed files with 2 additions and 3 deletions
|
@ -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 <URL>` 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 <URL>` on the command line
|
||||
Messaging.message("commandline_background", "recvExStr", ["nativeopen " + url])
|
||||
} else if (url !== "") {
|
||||
window.location.href = forceURI(url)
|
||||
|
|
Loading…
Add table
Reference in a new issue