diff --git a/src/background.ts b/src/background.ts index ff751e86..ab6279b7 100644 --- a/src/background.ts +++ b/src/background.ts @@ -20,7 +20,7 @@ import state from "@src/state" import * as webext from "@src/lib/webext" import { AutoContain } from "@src/lib/autocontainers" /* tslint:disable:import-spacing */ -;(window as any).tri = Object.assign(Object.create(null), { +; (window as any).tri = Object.assign(Object.create(null), { messaging, excmds, convert, @@ -41,7 +41,7 @@ import { AutoContain } from "@src/lib/autocontainers" // {{{ tri.contentLocation // When loading the background, use the active tab to know what the current content url is browser.tabs.query({ currentWindow: true, active: true }).then(t => { - ;(window as any).tri.contentLocation = new URL(t[0].url) + (window as any).tri.contentLocation = new URL(t[0].url) }) // After that, on every tab change, update the current url let contentLocationCount = 0 @@ -52,7 +52,7 @@ browser.tabs.onActivated.addListener(ev => { // Note: we're using contentLocationCount and myId in order to make sure that only the last onActivated event is used in order to set contentLocation // This is needed because otherWise the following chain of execution might happen: onActivated1 => onActivated2 => tabs.get2 => tabs.get1 if (contentLocationCount === myId) { - ;(window as any).tri.contentLocation = new URL(t.url) + (window as any).tri.contentLocation = new URL(t.url) } }) }) diff --git a/src/commandline_frame.ts b/src/commandline_frame.ts index fa25b213..f02088a1 100644 --- a/src/commandline_frame.ts +++ b/src/commandline_frame.ts @@ -482,6 +482,6 @@ Messaging.addListener("commandline_frame", Messaging.attributeCaller(SELF)) // object since there's apparently a bug that causes performance // observers to be GC'd even if they're still the target of a // callback. -;(window as any).tri = Object.assign(window.tri || {}, { +; (window as any).tri = Object.assign(window.tri || {}, { perfObserver: perf.listenForCounters(), }) diff --git a/src/content.ts b/src/content.ts index d2f21fcc..901f3070 100644 --- a/src/content.ts +++ b/src/content.ts @@ -4,7 +4,7 @@ if ((window as any).tridactyl_content_lock !== undefined) { throw Error("Trying to load Tridactyl, but it's already loaded.") } -;(window as any).tridactyl_content_lock = "locked" +(window as any).tridactyl_content_lock = "locked" // Be careful: typescript elides imports that appear not to be used if they're // assigned to a name. If you want an import just for its side effects, make @@ -74,7 +74,7 @@ import * as keyseq from "@src/lib/keyseq" import * as native from "@src/lib/native" import * as styling from "@src/content/styling" /* tslint:disable:import-spacing */ -;(window as any).tri = Object.assign(Object.create(null), { +; (window as any).tri = Object.assign(Object.create(null), { browserBg: webext.browserBg, commandline_content, convert, @@ -293,6 +293,6 @@ config.getAsync("leavegithubalone").then(v => { // background for collection. Attach the observer to the window object // since there's apparently a bug that causes performance observers to // be GC'd even if they're still the target of a callback. -;(window as any).tri = Object.assign(window.tri, { +; (window as any).tri = Object.assign(window.tri, { perfObserver: perf.listenForCounters(), }) diff --git a/src/excmds.ts b/src/excmds.ts index 82bdcab2..b6ee647b 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -201,7 +201,7 @@ export async function fillinput(selector: string, ...content: string[]) { let inputToFill = document.querySelector(selector) if (!inputToFill) inputToFill = DOM.getLastUsedInput() if ("value" in inputToFill) { - ;(inputToFill as HTMLInputElement).value = content.join(" ") + (inputToFill as HTMLInputElement).value = content.join(" ") } else { inputToFill.textContent = content.join(" ") } @@ -829,7 +829,7 @@ document.addEventListener("load", () => curJumps().then(() => jumpprev(0))) /** Blur (unfocus) the active element */ //#content export function unfocus() { - ;(document.activeElement as HTMLInputElement).blur() + (document.activeElement as HTMLInputElement).blur() contentState.mode = "normal" } @@ -1046,7 +1046,7 @@ export async function open(...urlarr: string[]) { p = Messaging.message("controller_background", "acceptExCmd", ["nativeopen " + url]) } else if (url.match(/^javascript:/)) { let bookmarklet = url.replace(/^javascript:/, "") - ;(document.body as any).append( + ; (document.body as any).append( html`