Silence window-type errors

This commit is contained in:
Nils Maier 2019-09-10 13:58:28 +02:00
parent 2df7a1c592
commit d79060237d

View File

@ -11,7 +11,7 @@ const MANAGER_URL = "/windows/manager.html";
export async function mostRecentBrowser(incognito: boolean): Promise<any> {
let window;
try {
window = await windows.getCurrent({windowTypes: ["normal"]});
window = await windows.getCurrent();
if (window.type !== "normal") {
throw new Error("not a normal window");
}
@ -21,7 +21,7 @@ export async function mostRecentBrowser(incognito: boolean): Promise<any> {
}
catch {
try {
window = await windows.getlastFocused({windowTypes: ["normal"]});
window = await windows.getlastFocused();
if (window.type !== "normal") {
throw new Error("not a normal window");
}