Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ let ports: { [key: number]: Runtime.Port } = {};
const responseMap: Map<string, { server: RequestInfo, response: IMAGEResponse, request: IMAGERequest }> = new Map();
var serverUrl: RequestInfo;
var renderingsPanel: browser.Windows.Window | browser.Tabs.Tab;
var errorPanel: browser.Windows.Window | browser.Tabs.Tab;
let launchPad : browser.Windows.Window | browser.Tabs.Tab;
var graphicUrl: string = "";
var extVersion = process.env.NODE_ENV;
Expand Down Expand Up @@ -197,13 +198,15 @@ async function handleMessage(p: Runtime.Port, message: any) {
"body": JSON.stringify(query)
});
windowsPanel ? browser.windows.remove(progressWindow.id!) : browser.tabs.remove(progressWindow.id!);
// close existing error panel if it exists
windowsPanel ? (errorPanel && browser.windows.remove(errorPanel.id!)) : (errorPanel && browser.tabs.remove(errorPanel.id!));
if (resp.ok) {
json = await resp.json();
} else {
windowsPanel ? browser.windows.create({
errorPanel = windowsPanel ? await browser.windows.create({
type: "panel",
url: "errors/http_error.html"
}) : browser.tabs.create({
}) : await browser.tabs.create({
url: "errors/http_error.html",
});
console.error(`HTTP Error ${resp.status}: ${resp.statusText}`);
Expand All @@ -213,10 +216,12 @@ async function handleMessage(p: Runtime.Port, message: any) {
}
} catch {
windowsPanel ? browser.windows.remove(progressWindow.id!) : browser.tabs.remove(progressWindow.id!);
windowsPanel ? browser.windows.create({
// close existing error panel if it exists
windowsPanel ? (errorPanel && browser.windows.remove(errorPanel.id!)) : (errorPanel && browser.tabs.remove(errorPanel.id!));
errorPanel = windowsPanel ? await browser.windows.create({
type: "panel",
url: "errors/http_error.html"
}) : browser.tabs.create({
}) : await browser.tabs.create({
url: "errors/http_error.html",
});
return;
Expand Down Expand Up @@ -811,6 +816,7 @@ browser.contextMenus.onClicked.addListener((info, tab) => {
}
} else {
console.error("No tab passed to context menu listener!");
windowsPanel ? (errorPanel && browser.windows.remove(errorPanel.id!)) : (errorPanel && browser.tabs.remove(errorPanel.id!));
windowsPanel ? browser.windows.create({
type: "panel",
url: "errors/http_error.html"
Expand Down
14 changes: 13 additions & 1 deletion src/options/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,16 @@
padding: 1rem;
border: 2px solid lightgrey;
margin: 0.5rem 0rem;
}
}

/* High contrast mode support */
@media (forced-colors: active) {
.slider {
background-color: Canvas;
border: 1px solid CanvasText;
forced-color-adjust: none;
}
.slider::before {
background-color: CanvasText;
}
}
1 change: 1 addition & 0 deletions src/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function optionsCheck(){
alertMessage = browser.i18n.getMessage("perferencesSaved");
}
announcer!.textContent = alertMessage;
window.alert(alertMessage)
setTimeout(() => {
announcer!.textContent = '';
}, 1000);
Expand Down
Loading