mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Fix #4000: use a safer URL for dummy tabs
This commit is contained in:
parent
07fea47e43
commit
da03de2109
|
|
@ -21,10 +21,13 @@ Object.assign(browser.tabs, {
|
|||
onActivated: tabEvent,
|
||||
})
|
||||
Object.defineProperty(browser, "windows", {
|
||||
value: { getCurrent: jest.fn().mockReturnValue({ incognito: false }) },
|
||||
value: {
|
||||
create: jest.fn().mockResolvedValue({ tabs: [{ id: 42 }] }),
|
||||
getCurrent: jest.fn().mockReturnValue({ incognito: false }),
|
||||
},
|
||||
})
|
||||
|
||||
const { set, tabopen } = require("@src/.excmds_background.generated")
|
||||
const { set, tabopen, winopen } = require("@src/.excmds_background.generated")
|
||||
|
||||
test("`set` preserves deep custom arrays", async () => {
|
||||
await config.set("custom", "deep", "array", [0])
|
||||
|
|
@ -51,3 +54,13 @@ test.each(["none", "somecnt"])(
|
|||
expect(queryAndURLwrangler).toHaveBeenLastCalledWith([])
|
||||
},
|
||||
)
|
||||
|
||||
test("`winopen` creates a neutral tab before navigating it", async () => {
|
||||
await winopen("https://example.com/")
|
||||
|
||||
expect(browser.windows.create).toHaveBeenCalledWith({ url: "about:blank" })
|
||||
expect(browser.tabs.update).toHaveBeenCalledWith(42, {
|
||||
loadReplace: true,
|
||||
url: "https://example.com/",
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3503,7 +3503,7 @@ export async function winopen(...args: string[]) {
|
|||
return nativeopen(firefoxArgs, address)
|
||||
}
|
||||
|
||||
createData.url = "https://fix-a-firefox-bug.invalid"
|
||||
createData.url = "about:blank"
|
||||
|
||||
return browser.windows.create(createData).then(win => openInTab(win.tabs[0], { loadReplace: true }, address.split(" ")))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue