mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Merge pull request #4188 from GHolk/master
Fix #4158: bookmarklet execution bug
This commit is contained in:
commit
bcad918899
1 changed files with 2 additions and 8 deletions
|
@ -1326,14 +1326,8 @@ export async function open(...urlarr: string[]) {
|
||||||
// Open URLs that firefox won't let us by running `firefox <URL>` on the command line
|
// Open URLs that firefox won't let us by running `firefox <URL>` on the command line
|
||||||
return nativeopen(url)
|
return nativeopen(url)
|
||||||
} else if (/^javascript:/.exec(url)) {
|
} else if (/^javascript:/.exec(url)) {
|
||||||
const bookmarklet = url.replace(/^javascript:/, "")
|
const escapeUrl = url.replace(/[\\"]/g, "\\$&")
|
||||||
document.body.append(
|
window.eval(`window.location.href = "${escapeUrl}"`)
|
||||||
html`
|
|
||||||
<script>
|
|
||||||
${bookmarklet}
|
|
||||||
</script>
|
|
||||||
`,
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
const tab = await ownTab()
|
const tab = await ownTab()
|
||||||
return openInTab(tab, {}, urlarr)
|
return openInTab(tab, {}, urlarr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue