From efa73cbfdbe8f13423f5016378c3373db111caf5 Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:14:17 +1100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=9A=A7=20Navigation=20context=20menu?= =?UTF-8?q?=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/shared/contextMenus/MenuItem.ts | 41 ++++++++++++++++++- .../tests/shared/contextMenus/MenuItem.ts | 6 ++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/content/shared/contextMenus/MenuItem.ts b/src/content/shared/contextMenus/MenuItem.ts index bc80a4e..6e45305 100644 --- a/src/content/shared/contextMenus/MenuItem.ts +++ b/src/content/shared/contextMenus/MenuItem.ts @@ -1,11 +1,14 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - import { type Readable, readable } from 'svelte/store' import type { ContextMenuInfo } from '../../../actors/ContextMenu.types' -import { openTab, setCurrentTab } from '../../browser/lib/globalApi' +import { + openTab, + runOnCurrentTab, + setCurrentTab, +} from '../../browser/lib/globalApi' import { resource } from '../../browser/lib/resources' import { getClipboardHelper } from '../../browser/lib/xul/ccWrapper' import { observable } from '../../browser/lib/xul/observable' @@ -17,8 +20,12 @@ export const MENU_ITEM_ACTION_IDS = [ 'selection__copy', 'link__copy', 'link__new-tab', + 'navigation__back', + 'navigation__forward', + 'navigation__reload', ] as const +const ALWAYS = () => true const HAS_TEXT_SELECTION: VisibilityCheck = (info) => typeof info.textSelection == 'string' const HAS_HREF: VisibilityCheck = (info) => typeof info.href == 'string' @@ -59,6 +66,36 @@ export const MENU_ITEM_ACTIONS: MenuItemAction[] = [ } }, }, + { + type: 'action', + id: 'navigation__back', + title: 'Back', + + visible: ALWAYS, + action(info) { + runOnCurrentTab((tab) => tab.goBack()) + }, + }, + { + type: 'action', + id: 'navigation__forward', + title: 'Forward', + + visible: ALWAYS, + action(info) { + runOnCurrentTab((tab) => tab.goForward()) + }, + }, + { + type: 'action', + id: 'navigation__reload', + title: 'Reload', + + visible: ALWAYS, + action(info) { + runOnCurrentTab((tab) => tab.reload()) + }, + }, ] interface MenuItemBase {} diff --git a/src/content/tests/shared/contextMenus/MenuItem.ts b/src/content/tests/shared/contextMenus/MenuItem.ts index 8682137..a094d79 100644 --- a/src/content/tests/shared/contextMenus/MenuItem.ts +++ b/src/content/tests/shared/contextMenus/MenuItem.ts @@ -1,7 +1,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - import { test } from 'zora' import { @@ -13,7 +12,10 @@ import { export default async function () { await test('toIdString', (t) => { t.eq( - toIdString([...MENU_ITEM_ACTIONS, { type: 'separator' }]), + toIdString([ + ...MENU_ITEM_ACTIONS.filter((_, i) => i < 3), + { type: 'separator' }, + ]), 'selection__copy,link__copy,link__new-tab,separator', ) }) From e61016add5258964286caeb86e8f6cecc978ed8b Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:22:09 +1100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=9A=A7=20Bookmark=20context=20menu=20?= =?UTF-8?q?item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolbar/omnibox/Bookmarks.svelte | 12 ++++++++++- src/content/browser/lib/globalApi.ts | 6 ++++++ src/content/shared/contextMenus/MenuItem.ts | 21 +++++++++++-------- src/content/types.d.ts | 2 +- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/content/browser/components/toolbar/omnibox/Bookmarks.svelte b/src/content/browser/components/toolbar/omnibox/Bookmarks.svelte index 79669ef..122be1f 100644 --- a/src/content/browser/components/toolbar/omnibox/Bookmarks.svelte +++ b/src/content/browser/components/toolbar/omnibox/Bookmarks.svelte @@ -13,6 +13,7 @@ remove, } from '../../../../shared/ExtBookmarkAPI' import ToolbarButton from '../ToolbarButton.svelte' + import { onMount } from 'svelte' export let tab: Tab @@ -59,11 +60,20 @@ panel.hidePopup() } + + const OPEN_BOOKMARK_PANEL = () => + panel.openPopup(bookmarkButton, 'bottomright topright') + onMount(() => { + window.windowApi.windowTriggers.on( + 'bookmarkCurrentPage', + OPEN_BOOKMARK_PANEL, + ) + }) panel.openPopup(bookmarkButton, 'bottomright topright')} + on:click={OPEN_BOOKMARK_PANEL} kind="page-icon" > diff --git a/src/content/browser/lib/globalApi.ts b/src/content/browser/lib/globalApi.ts index 6d2f77f..ea8d492 100644 --- a/src/content/browser/lib/globalApi.ts +++ b/src/content/browser/lib/globalApi.ts @@ -1,6 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +import mitt from 'mitt' import { writable } from 'svelte/store' import type { ContextMenuInfo } from '../../../actors/ContextMenu.types' @@ -115,7 +116,12 @@ function insertAndShift(arr: T[], from: number, to: number) { arr.splice(to, 0, cutOut) } +export type WindowTriggers = { + bookmarkCurrentPage: undefined +} + export const windowApi = { + windowTriggers: mitt(), closeTab, openTab, setIcon: (browser: XULBrowserElement, iconURL: string) => diff --git a/src/content/shared/contextMenus/MenuItem.ts b/src/content/shared/contextMenus/MenuItem.ts index 6e45305..d97d5bd 100644 --- a/src/content/shared/contextMenus/MenuItem.ts +++ b/src/content/shared/contextMenus/MenuItem.ts @@ -23,6 +23,7 @@ export const MENU_ITEM_ACTION_IDS = [ 'navigation__back', 'navigation__forward', 'navigation__reload', + 'navigation__bookmark', ] as const const ALWAYS = () => true @@ -72,9 +73,7 @@ export const MENU_ITEM_ACTIONS: MenuItemAction[] = [ title: 'Back', visible: ALWAYS, - action(info) { - runOnCurrentTab((tab) => tab.goBack()) - }, + action: () => runOnCurrentTab((tab) => tab.goBack()), }, { type: 'action', @@ -82,9 +81,7 @@ export const MENU_ITEM_ACTIONS: MenuItemAction[] = [ title: 'Forward', visible: ALWAYS, - action(info) { - runOnCurrentTab((tab) => tab.goForward()) - }, + action: () => runOnCurrentTab((tab) => tab.goForward()), }, { type: 'action', @@ -92,9 +89,15 @@ export const MENU_ITEM_ACTIONS: MenuItemAction[] = [ title: 'Reload', visible: ALWAYS, - action(info) { - runOnCurrentTab((tab) => tab.reload()) - }, + action: () => runOnCurrentTab((tab) => tab.reload()), + }, + { + type: 'action', + id: 'navigation__bookmark', + title: 'Bookmark This Page', + + visible: ALWAYS, + action: () => window.windowApi.windowTriggers.emit('bookmarkCurrentPage'), }, ] diff --git a/src/content/types.d.ts b/src/content/types.d.ts index de90fb7..67b8a59 100644 --- a/src/content/types.d.ts +++ b/src/content/types.d.ts @@ -11,7 +11,7 @@ declare module '*.txt' { } declare interface Window { - windowApi: typeof import('./lib/globalApi').windowApi + windowApi: typeof import('./browser/lib/globalApi').windowApi browserDOMWindow: nsIBrowserDOMWindowType } From 812562baa3fae41bf7c2431369c47353ce4d46d2 Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Sat, 18 Nov 2023 16:29:16 +1100 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20Add=20image=20context=20menu=20?= =?UTF-8?q?icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 6 +- src/actors/ContextMenu.types.ts | 13 ++ src/actors/ContextMenuChild.ts | 87 ++++++++++- src/actors/ContextMenuParent.ts | 2 +- .../contextMenus/BrowserContextMenu.svelte | 11 +- src/content/browser/lib/globalApi.ts | 7 +- src/content/contentAreaUtils.d.ts | 44 ++++++ src/content/index.html | 6 + src/content/settings/Settings.svelte | 1 - .../ContextMenuPref/ContextMenuPref.svelte | 5 +- src/content/shared/contextMenus/MenuItem.ts | 88 +---------- src/content/shared/contextMenus/index.ts | 1 + src/content/shared/contextMenus/menuItems.ts | 144 ++++++++++++++++++ src/content/shared/svelteUtils.ts | 29 +++- src/link.d.ts | 2 +- src/prefs.js | 48 ++++++ 16 files changed, 387 insertions(+), 107 deletions(-) create mode 100644 src/content/contentAreaUtils.d.ts create mode 100644 src/content/shared/contextMenus/menuItems.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7e3324..d8e10a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,7 +62,7 @@ devDependencies: version: 8.0.1 gecko-types: specifier: github:quark-platform/gecko-types - version: github.com/quark-platform/gecko-types/7552802a99b366ea1ee83e853c3e954a1e9807b0 + version: github.com/quark-platform/gecko-types/2d3c36dfc177629bbe6118c5e8c64a04ac3dddc9 html-webpack-plugin: specifier: ^5.5.3 version: 5.5.3(webpack@5.89.0) @@ -4340,8 +4340,8 @@ packages: resolution: {integrity: sha512-FSZOvfJVfMWhk/poictNsDBCXq/Z+2Zu2peWs6d8OhWWb9nY++czw95D47hdw06L/kfjasLevwrbUtnXyWLAJw==} dev: true - github.com/quark-platform/gecko-types/7552802a99b366ea1ee83e853c3e954a1e9807b0: - resolution: {tarball: https://codeload.github.com/quark-platform/gecko-types/tar.gz/7552802a99b366ea1ee83e853c3e954a1e9807b0} + github.com/quark-platform/gecko-types/2d3c36dfc177629bbe6118c5e8c64a04ac3dddc9: + resolution: {tarball: https://codeload.github.com/quark-platform/gecko-types/tar.gz/2d3c36dfc177629bbe6118c5e8c64a04ac3dddc9} name: gecko-types version: 1.0.0 dev: true diff --git a/src/actors/ContextMenu.types.ts b/src/actors/ContextMenu.types.ts index ef9a516..ee99fb7 100644 --- a/src/actors/ContextMenu.types.ts +++ b/src/actors/ContextMenu.types.ts @@ -5,6 +5,11 @@ // NOTE: This file should only have types imported from it. Its contents will not be // available at runtime +export interface MediaInfo { + contentType?: string + contentDisposition?: string +} + export interface ContextMenuInfo { position: { screenX: number @@ -12,6 +17,14 @@ export interface ContextMenuInfo { inputSource: number } + context: { + principal?: nsIPrincipalType + referrerInfo?: string + } + + mediaInfo?: MediaInfo + textSelection?: string href?: string + imageSrc?: string } diff --git a/src/actors/ContextMenuChild.ts b/src/actors/ContextMenuChild.ts index 269498c..07fb737 100644 --- a/src/actors/ContextMenuChild.ts +++ b/src/actors/ContextMenuChild.ts @@ -4,10 +4,11 @@ /// import { lazyESModuleGetters } from 'resource://app/modules/TypedImportUtils.sys.mjs' -import type { ContextMenuInfo } from './ContextMenu.types' +import type { ContextMenuInfo, MediaInfo } from './ContextMenu.types' const lazy = lazyESModuleGetters({ SelectionUtils: 'resource://gre/modules/SelectionUtils.sys.mjs', + E10SUtils: 'resource://gre/modules/E10SUtils.sys.mjs', }) export class ContextMenuChild extends JSWindowActorChild { @@ -21,15 +22,83 @@ export class ContextMenuChild extends JSWindowActorChild { } } - handleEvent(event: MouseEvent & { inputSource: number }) { + getImageSrcIfExists(target: Node): string | undefined { + if ((target as HTMLImageElement).src) { + return (target as HTMLImageElement).src + } + } + + /** + * This code was based on the code from here: https://searchfox.org/mozilla-central/source/browser/actors/ContextMenuChild.sys.mjs#568 + */ + getMediaInfo(target: Node & nsIImageLoadingContentType) { + // @ts-expect-error - Ci interfaces are not instanceofable + if (!(target instanceof Ci.nsIImageLoadingContent && target.currentURI)) { + return + } + + const mediaInfo: MediaInfo = {} + + try { + const imageCache = Cc['@mozilla.org/image/tools;1'] + // @ts-expect-error - Cc is not correctly typed yet + .getService(Ci.imgITools) + .getImgCacheForDocument(target.ownerDocument) + // The image cache's notion of where this image is located is + // the currentURI of the image loading content. + const props = imageCache.findEntryProperties( + target.currentURI, + target.ownerDocument, + ) + + try { + mediaInfo.contentType = props.get('type', Ci.nsISupportsCString).data + } catch (e) { + // Ignore errors + } + + try { + mediaInfo.contentDisposition = props.get( + 'content-disposition', + Ci.nsISupportsCString, + ).data + } catch (e) { + // Ignore errors + } + } catch (e) { + // Ignore errors + } + + return mediaInfo + } + + getReferrerInfo(target: Element) { + const referrerInfo = Cc['@mozilla.org/referrer-info;1'].createInstance( + Ci.nsIReferrerInfo, + ) as nsIReferrerInfoType + referrerInfo.initWithElement(target) + return lazy.E10SUtils.serializeReferrerInfo(referrerInfo) + } + + handleEvent( + event: MouseEvent & { inputSource: number; composedTarget?: EventTarget }, + ) { const data: { position: ContextMenuInfo['position'] + context: ContextMenuInfo['context'] } & Partial = { position: { screenX: event.screenX, screenY: event.screenY, inputSource: event.inputSource, }, + + context: { + principal: + (event.target && + (event.target as Node).ownerDocument?.nodePrincipal) || + undefined, + }, } const selectionInfo = lazy.SelectionUtils.getSelectionDetails( @@ -39,7 +108,19 @@ export class ContextMenuChild extends JSWindowActorChild { data.textSelection = selectionInfo.fullText } - if (event.target) data.href = this.getHrefIfExists(event.target as Node) + if ( + event.composedTarget && + (event.composedTarget as Node).nodeType === Node.ELEMENT_NODE + ) { + const node = event.composedTarget as Node + + data.href = this.getHrefIfExists(node) + data.imageSrc = this.getImageSrcIfExists(node) + data.mediaInfo = this.getMediaInfo( + node as Node & nsIImageLoadingContentType, + ) + data.context.referrerInfo = this.getReferrerInfo(node as Element) + } this.sendAsyncMessage('contextmenu', data satisfies ContextMenuInfo) } diff --git a/src/actors/ContextMenuParent.ts b/src/actors/ContextMenuParent.ts index e09be5e..ea1c642 100644 --- a/src/actors/ContextMenuParent.ts +++ b/src/actors/ContextMenuParent.ts @@ -13,7 +13,7 @@ export class ContextMenuParent extends JSWindowActorParent { receiveMessage(event: ContextMenuEvent) { if (event.name == 'contextmenu') { const win = event.target.browsingContext.embedderElement.ownerGlobal - win.windowApi.showContextMenu(event.data) + win.windowApi.showContextMenu(event.data, this) } } } diff --git a/src/content/browser/components/contextMenus/BrowserContextMenu.svelte b/src/content/browser/components/contextMenus/BrowserContextMenu.svelte index f118fb4..1e00be5 100644 --- a/src/content/browser/components/contextMenus/BrowserContextMenu.svelte +++ b/src/content/browser/components/contextMenus/BrowserContextMenu.svelte @@ -3,11 +3,18 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> diff --git a/src/content/settings/Settings.svelte b/src/content/settings/Settings.svelte index 11d7e5a..ca8f4bf 100644 --- a/src/content/settings/Settings.svelte +++ b/src/content/settings/Settings.svelte @@ -7,7 +7,6 @@ DEFAULT_SEARCH_ENGINE, SEARCH_ENGINE_PREF, } from '../shared/search/constants' - import { searchEngineService } from '../shared/search/engine' import Category from './components/Category.svelte' import SubCategory from './components/SubCategory.svelte' import { ContextMenuPref } from './components/pref/ContextMenuPref' diff --git a/src/content/settings/components/pref/ContextMenuPref/ContextMenuPref.svelte b/src/content/settings/components/pref/ContextMenuPref/ContextMenuPref.svelte index 50dbaba..783b9f8 100644 --- a/src/content/settings/components/pref/ContextMenuPref/ContextMenuPref.svelte +++ b/src/content/settings/components/pref/ContextMenuPref/ContextMenuPref.svelte @@ -3,10 +3,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> diff --git a/src/content/shared/contextMenus/MenuItem.ts b/src/content/shared/contextMenus/MenuItem.ts index a6c16c6..811d993 100644 --- a/src/content/shared/contextMenus/MenuItem.ts +++ b/src/content/shared/contextMenus/MenuItem.ts @@ -18,6 +18,7 @@ export const MENU_ITEM_ACTION_IDS = [ 'navigation__forward', 'navigation__reload', 'navigation__bookmark', + 'image__copy', 'image__copy-link', 'image__new-tab', 'image__save', diff --git a/src/content/shared/contextMenus/menuItems.ts b/src/content/shared/contextMenus/menuItems.ts index 9950752..72c6bd5 100644 --- a/src/content/shared/contextMenus/menuItems.ts +++ b/src/content/shared/contextMenus/menuItems.ts @@ -119,6 +119,13 @@ export const MENU_ITEM_ACTIONS: MenuItemAction[] = ( visible: ALWAYS, action: () => window.windowApi.windowTriggers.emit('bookmarkCurrentPage'), }, + { + id: 'image__copy', + title: 'Copy Image', + + visible: HAS_IMAGE_SRC, + action: () => goDoCommand('cmd_copyImage'), + }, { id: 'image__copy-link', title: 'Copy Image Link', diff --git a/src/content/types.d.ts b/src/content/types.d.ts index 67b8a59..7b21a51 100644 --- a/src/content/types.d.ts +++ b/src/content/types.d.ts @@ -1,10 +1,12 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - /// /// +/// +/// + declare module '*.txt' { const contents: string export = contents From 37aca87479f272a2a35879128440abad5b7cbeca Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Sat, 18 Nov 2023 16:51:57 +1100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=93=84=20License=20headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/contentAreaUtils.d.ts | 4 ++++ src/content/globalOverlay.d.ts | 4 ++++ src/content/shared/contextMenus/menuItems.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/content/contentAreaUtils.d.ts b/src/content/contentAreaUtils.d.ts index 8e782aa..26aaa4b 100644 --- a/src/content/contentAreaUtils.d.ts +++ b/src/content/contentAreaUtils.d.ts @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + declare function urlSecurityCheck( url: string | nsIURIType, principal: nsIPrincipalType, diff --git a/src/content/globalOverlay.d.ts b/src/content/globalOverlay.d.ts index 9abbf37..136516d 100644 --- a/src/content/globalOverlay.d.ts +++ b/src/content/globalOverlay.d.ts @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + declare function closeWindow(aClose, aPromptFunction, aSource) /** diff --git a/src/content/shared/contextMenus/menuItems.ts b/src/content/shared/contextMenus/menuItems.ts index 72c6bd5..63260f9 100644 --- a/src/content/shared/contextMenus/menuItems.ts +++ b/src/content/shared/contextMenus/menuItems.ts @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + import curry from 'fnts/curry' import type { MenuItemAction, VisibilityCheck } from '.' From c85296ffd2ab10a6c8a6ff376e269d6e5107652e Mon Sep 17 00:00:00 2001 From: trickypr <23250792+trickypr@users.noreply.github.com> Date: Sat, 18 Nov 2023 16:55:01 +1100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=9A=A8=20Reduce=20the=20number=20of?= =?UTF-8?q?=20linter=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/unit-test.ts | 1 + src/content/browser/components/tabs/tab.ts | 6 +++--- src/content/browser/lib/shortcuts.ts | 2 +- src/content/browser/lib/xul/browser.ts | 2 -- src/modules/BrowserGlue.ts | 3 +-- src/modules/FaviconLoader.ts | 1 + 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/unit-test.ts b/scripts/unit-test.ts index 0fa87ca..d73a7ea 100644 --- a/scripts/unit-test.ts +++ b/scripts/unit-test.ts @@ -17,6 +17,7 @@ new App() .get('/config', (_, res) => void res.send({ shouldWatch })) .post('/results', (req, res) => { req.on('data', (chunk: Buffer) => { + // eslint-disable-next-line no-console console.log(chunk.toString()) }) req.on('close', () => { diff --git a/src/content/browser/components/tabs/tab.ts b/src/content/browser/components/tabs/tab.ts index 7fcfa6d..018ecbf 100644 --- a/src/content/browser/components/tabs/tab.ts +++ b/src/content/browser/components/tabs/tab.ts @@ -305,21 +305,21 @@ class TabProgressListener aStatus: number, aMessage: string, ): void { - console.log('onStatusChange') + // console.log('onStatusChange') } onSecurityChange( aWebProgress: nsIWebProgressType, aRequest: nsIRequestType, aState: number, ): void { - console.log('onSecurityChange') + // console.log('onSecurityChange') } onContentBlockingEvent( aWebProgress: nsIWebProgressType, aRequest: nsIRequestType, aEvent: number, ): void { - console.log('onContentBlockingEvent') + // console.log('onContentBlockingEvent') } QueryInterface = ChromeUtils.generateQI([ diff --git a/src/content/browser/lib/shortcuts.ts b/src/content/browser/lib/shortcuts.ts index bc85785..b27392e 100644 --- a/src/content/browser/lib/shortcuts.ts +++ b/src/content/browser/lib/shortcuts.ts @@ -33,7 +33,7 @@ export function initializeShortcuts() { runOnCurrentTab((tab) => tab.goForward()) break default: - console.log(event) + console.warn('Unknown event', event) } }) } diff --git a/src/content/browser/lib/xul/browser.ts b/src/content/browser/lib/xul/browser.ts index 6562f3a..d26f1f1 100644 --- a/src/content/browser/lib/xul/browser.ts +++ b/src/content/browser/lib/xul/browser.ts @@ -7,8 +7,6 @@ const { useRemoteTabs, useRemoteSubframe } = window.docShell.QueryInterface( Ci.nsILoadContext, ) -console.log(useRemoteTabs, useRemoteSubframe) - const DEFAULT_BROWSER_ATTRIBUTES = { message: 'true', messagemanagergroup: 'browsers', diff --git a/src/modules/BrowserGlue.ts b/src/modules/BrowserGlue.ts index 801965e..c47c662 100644 --- a/src/modules/BrowserGlue.ts +++ b/src/modules/BrowserGlue.ts @@ -50,14 +50,13 @@ export class BrowserGlue { QueryInterface = ChromeUtils.generateQI(['nsIObserver']) constructor() { - console.log('BrowserGlue impl') - lazy.ActorManagerParent.addJSProcessActors(JS_PROCESS_ACTORS) lazy.ActorManagerParent.addJSWindowActors(JS_WINDOW_ACTORS) } // nsIObserver impl observe(aSubject: nsISupportsType, aTopic: string, aData: string): void { + // eslint-disable-next-line no-console console.log({ aSubject, aTopic, aData }) } } diff --git a/src/modules/FaviconLoader.ts b/src/modules/FaviconLoader.ts index a15b49c..8a39018 100644 --- a/src/modules/FaviconLoader.ts +++ b/src/modules/FaviconLoader.ts @@ -624,6 +624,7 @@ class IconLoader { } catch (e: any) { if (e.result != Cr.NS_BINDING_ABORTED) { if (typeof e.data?.wrappedJSObject?.httpStatus !== 'number') { + // eslint-disable-next-line no-console console.error(e) }