Fix jsonview with about:blank newtab

This commit is contained in:
Oliver Blanthorn 2021-07-07 22:13:10 +02:00
parent 64c3547034
commit c07b9bf216
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -4267,7 +4267,7 @@ export function viewconfig(...key: string[]) {
*/
//#background
export async function jsonview(...json: string[]) {
const tab = await tabopen("-w")
const tab = await tabopen("-w", browser.runtime.getURL("static/newtab.html"))
const url = "data:application/json," + encodeURIComponent(json.join(" "))
return browser.tabs.executeScript(tab.id, { code: `window.location.href = "${url}";` })
}