Skip to content

Commit

Permalink
Remove main.backgroun changes
Browse files Browse the repository at this point in the history
  • Loading branch information
justindbaur committed Sep 28, 2022
1 parent 8f1eb2e commit 8533b53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
19 changes: 6 additions & 13 deletions apps/browser/src/background/main.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ import RuntimeBackground from "./runtime.background";
import TabsBackground from "./tabs.background";
import WebRequestBackground from "./webRequest.background";

type CommonSidebarAction = typeof chrome.sidebarAction | OperaSidebarAction;
type BrowserOrSidebarAction = typeof chrome.browserAction | CommonSidebarAction;

export default class MainBackground {
messagingService: MessagingServiceAbstraction;
storageService: AbstractStorageService;
Expand Down Expand Up @@ -177,7 +174,7 @@ export default class MainBackground {
private tabsBackground: TabsBackground;
private webRequestBackground: WebRequestBackground;

private sidebarAction: CommonSidebarAction;
private sidebarAction: any;
private buildingContextMenu: boolean;
private menuOptionsLoaded: any[] = [];
private syncTimeout: any;
Expand Down Expand Up @@ -467,7 +464,7 @@ export default class MainBackground {
? null
: typeof opr !== "undefined" && opr.sidebarAction
? opr.sidebarAction
: window.chrome.sidebarAction;
: (window as any).chrome.sidebarAction;

// Background
this.runtimeBackground = new RuntimeBackground(
Expand Down Expand Up @@ -999,11 +996,7 @@ export default class MainBackground {
});
}

private async actionSetIcon(
theAction: BrowserOrSidebarAction,
suffix: string,
windowId?: number
): Promise<void> {
private async actionSetIcon(theAction: any, suffix: string, windowId?: number): Promise<void> {
if (!theAction || !theAction.setIcon) {
return;
}
Expand All @@ -1029,8 +1022,8 @@ export default class MainBackground {
}
}

private actionSetBadgeBackgroundColor(action: BrowserOrSidebarAction) {
if (action && "setBadgeBackgroundColor" in action) {
private actionSetBadgeBackgroundColor(action: any) {
if (action && action.setBadgeBackgroundColor) {
action.setBadgeBackgroundColor({ color: "#294e5f" });
}
}
Expand All @@ -1049,7 +1042,7 @@ export default class MainBackground {
return;
}

if ("setBadgeText" in this.sidebarAction) {
if (this.sidebarAction.setBadgeText) {
this.sidebarAction.setBadgeText({
text: text,
tabId: tabId,
Expand Down
14 changes: 5 additions & 9 deletions apps/browser/src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export {};

declare function escape(s: string): string;
declare function unescape(s: string): string;
/**
Expand Down Expand Up @@ -126,13 +124,11 @@ declare namespace chrome {
| undefined;
}

interface Window {
opr: Opera | undefined;
opera: unknown;
}

declare let opr: Opera | undefined;
declare let opera: unknown | undefined;
declare let safari: any;

declare global {
interface Window {
opr: Opera | undefined;
opera: unknown;
}
}

0 comments on commit 8533b53

Please sign in to comment.