mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -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
|
||||
return nativeopen(url)
|
||||
} else if (/^javascript:/.exec(url)) {
|
||||
const bookmarklet = url.replace(/^javascript:/, "")
|
||||
document.body.append(
|
||||
html`
|
||||
<script>
|
||||
${bookmarklet}
|
||||
</script>
|
||||
`,
|
||||
)
|
||||
const escapeUrl = url.replace(/[\\"]/g, "\\$&")
|
||||
window.eval(`window.location.href = "${escapeUrl}"`)
|
||||
} else {
|
||||
const tab = await ownTab()
|
||||
return openInTab(tab, {}, urlarr)
|
||||
|
|
Loading…
Add table
Reference in a new issue