Silence window-type errors
This commit is contained in:
parent
2df7a1c592
commit
d79060237d
@ -11,7 +11,7 @@ const MANAGER_URL = "/windows/manager.html";
|
|||||||
export async function mostRecentBrowser(incognito: boolean): Promise<any> {
|
export async function mostRecentBrowser(incognito: boolean): Promise<any> {
|
||||||
let window;
|
let window;
|
||||||
try {
|
try {
|
||||||
window = await windows.getCurrent({windowTypes: ["normal"]});
|
window = await windows.getCurrent();
|
||||||
if (window.type !== "normal") {
|
if (window.type !== "normal") {
|
||||||
throw new Error("not a normal window");
|
throw new Error("not a normal window");
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ export async function mostRecentBrowser(incognito: boolean): Promise<any> {
|
|||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
try {
|
try {
|
||||||
window = await windows.getlastFocused({windowTypes: ["normal"]});
|
window = await windows.getlastFocused();
|
||||||
if (window.type !== "normal") {
|
if (window.type !== "normal") {
|
||||||
throw new Error("not a normal window");
|
throw new Error("not a normal window");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user