From 7b99f227cdfbc694b19cd7f1f16258d504af6898 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 10 May 2025 21:22:16 +0200 Subject: [PATCH] chore: Format with only a maximum of 10 columns, b=(no-bug), c=workflows, common, compact-mode, folders, glance, kbs, media, mods, split-view, tabs, tests, workspaces, welcome --- .github/workflows/build.yml | 13 +- .prettierrc.json | 2 +- package.json | 2 +- src/browser/app/profile/browser.inc | 2 + .../base/content/zen-sidebar-icons.inc.xhtml | 2 +- .../components/preferences/zen-settings.js | 121 +- .../tabbrowser/content/tabbrowser-js.patch | 70 +- .../shared/preferences/zen-preferences.css | 5 +- src/browser/themes/shared/zen-icons/icons.css | 63 +- src/zen/@types/lib.gecko.darwin.d.ts | 6 +- src/zen/@types/lib.gecko.dom.d.ts | 1739 ++++++++++++--- src/zen/@types/lib.gecko.linux.d.ts | 5 +- src/zen/@types/lib.gecko.tweaks.d.ts | 17 +- src/zen/@types/lib.gecko.win32.d.ts | 50 +- src/zen/@types/lib.gecko.xpcom.d.ts | 1923 ++++++++++++++--- src/zen/@types/zen.d.ts | 27 +- src/zen/common/ZenCommonUtils.mjs | 8 +- src/zen/common/ZenCustomizableUI.sys.mjs | 17 +- src/zen/common/ZenStartup.mjs | 23 +- src/zen/common/ZenUIManager.mjs | 141 +- src/zen/common/styles/zen-browser-ui.css | 6 +- src/zen/common/styles/zen-popup.css | 19 +- src/zen/common/styles/zen-theme.css | 87 +- src/zen/common/styles/zen-urlbar.css | 27 +- src/zen/common/zen-sets.js | 4 +- src/zen/common/zenThemeModifier.js | 11 +- src/zen/compact-mode/ZenCompactMode.mjs | 79 +- src/zen/downloads/ZenDownloadAnimation.mjs | 79 +- src/zen/folders/ZenFolders.mjs | 5 +- src/zen/folders/zen-folders.css | 6 +- src/zen/glance/ZenGlanceManager.mjs | 70 +- src/zen/glance/actors/ZenGlanceChild.sys.mjs | 6 +- src/zen/kbs/ZenKeyboardShortcuts.mjs | 34 +- src/zen/media/ZenMediaController.mjs | 61 +- src/zen/mods/ZenThemesCommon.mjs | 19 +- src/zen/mods/ZenThemesImporter.mjs | 55 +- .../actors/ZenThemeMarketplaceChild.sys.mjs | 5 +- .../actors/ZenThemeMarketplaceParent.sys.mjs | 21 +- src/zen/split-view/ZenViewSplitter.mjs | 142 +- src/zen/split-view/zen-decks.css | 4 +- src/zen/tabs/ZenPinnedTabManager.mjs | 59 +- src/zen/tabs/ZenPinnedTabsStorage.mjs | 57 +- src/zen/tabs/ZenTabUnloader.mjs | 47 +- .../zen-tabs/vertical-tabs-topbar.inc.css | 4 +- src/zen/tabs/zen-tabs/vertical-tabs.css | 52 +- .../browser_container_specific_essentials.js | 8 +- .../tests/urlbar/browser_floating_urlbar.js | 10 +- src/zen/tests/urlbar/head.js | 24 +- .../workspaces/browser_basic_workspaces.js | 10 +- src/zen/tests/workspaces/head.js | 131 +- src/zen/welcome/ZenWelcome.mjs | 31 +- src/zen/workspaces/ZenGradientGenerator.mjs | 292 ++- src/zen/workspaces/ZenWorkspaces.mjs | 415 +++- src/zen/workspaces/ZenWorkspacesStorage.mjs | 316 +-- src/zen/workspaces/ZenWorkspacesSync.mjs | 8 +- src/zen/workspaces/zen-gradient-generator.css | 11 +- src/zen/workspaces/zen-workspaces.css | 3 +- 57 files changed, 5118 insertions(+), 1336 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2e283e4..22ab9705 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -475,7 +475,18 @@ jobs: if: ${{ inputs.create_release || inputs.update_branch == 'twilight' }} permissions: write-all name: Release - needs: [build-data, linux, windows-step-3, check-release, mac-uni, appimage, source, lint, stop-self-hosted] + needs: + [ + build-data, + linux, + windows-step-3, + check-release, + mac-uni, + appimage, + source, + lint, + stop-self-hosted, + ] runs-on: ubuntu-latest environment: name: ${{ inputs.update_branch == 'release' && 'Deploy-Release' || 'Deploy-Twilight' }} diff --git a/.prettierrc.json b/.prettierrc.json index 11a53591..1fb5f789 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -7,6 +7,6 @@ "useTabs": false, "jsxSingleQuote": false, "semi": true, - "printWidth": 128, + "printWidth": 100, "plugins": ["prettier-plugin-sh"] } diff --git a/package.json b/package.json index 13ed60e4..95f4982e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "surfer build", "build:ui": "surfer build --ui", - "start": "cd engine && ./mach run --noprofile", + "start": "cd engine && ./mach run --noprofile --marionette", "import": "surfer import", "export": "surfer export", "init": "npm run download && npm run bootstrap && npm run import", diff --git a/src/browser/app/profile/browser.inc b/src/browser/app/profile/browser.inc index 8d237b1a..5eec1f69 100644 --- a/src/browser/app/profile/browser.inc +++ b/src/browser/app/profile/browser.inc @@ -35,7 +35,9 @@ pref('browser.download.open_pdf_attachments_inline', true); pref('browser.download.alwaysOpenPanel', false); // Updates +#ifdef MOZILLA_OFFICIAL pref("app.update.checkInstallTime.days", 6); +#endif #include fullscreen.inc #include ai.inc diff --git a/src/browser/base/content/zen-sidebar-icons.inc.xhtml b/src/browser/base/content/zen-sidebar-icons.inc.xhtml index 604f38c8..60a8c9eb 100644 --- a/src/browser/base/content/zen-sidebar-icons.inc.xhtml +++ b/src/browser/base/content/zen-sidebar-icons.inc.xhtml @@ -8,6 +8,6 @@ skipintoolbarset="true" context="toolbar-context-menu" mode="icons"> - + diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 84bf5c2f..bd5385f5 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -80,17 +80,24 @@ var gZenMarketplaceManager = { const browser = ZenThemesCommon.currentBrowser; const mozToggle = document.createElement('moz-toggle'); - mozToggle.className = 'zenThemeMarketplaceItemPreferenceToggle zenThemeMarketplaceDisableAllToggle'; + mozToggle.className = + 'zenThemeMarketplaceItemPreferenceToggle zenThemeMarketplaceDisableAllToggle'; mozToggle.pressed = !areThemesDisabled; - browser.document.l10n.setAttributes(mozToggle, `zen-theme-disable-all-${!areThemesDisabled ? 'enabled' : 'disabled'}`); + browser.document.l10n.setAttributes( + mozToggle, + `zen-theme-disable-all-${!areThemesDisabled ? 'enabled' : 'disabled'}` + ); mozToggle.addEventListener('toggle', async (event) => { const { pressed = false } = event.target || {}; this.themesList.style.display = pressed ? '' : 'none'; Services.prefs.setBoolPref('zen.themes.disable-all', !pressed); - browser.document.l10n.setAttributes(mozToggle, `zen-theme-disable-all-${pressed ? 'enabled' : 'disabled'}`); + browser.document.l10n.setAttributes( + mozToggle, + `zen-theme-disable-all-${pressed ? 'enabled' : 'disabled'}` + ); }); if (areThemesDisabled) { @@ -343,18 +350,28 @@ var gZenMarketplaceManager = { if (!event.target.hasAttribute('pressed')) { await this.disableTheme(themeId); - browser.document.l10n.setAttributes(mozToggle, 'zen-theme-marketplace-toggle-disabled-button'); + browser.document.l10n.setAttributes( + mozToggle, + 'zen-theme-marketplace-toggle-disabled-button' + ); if (theme.preferences) { - document.getElementById(`zenThemeMarketplaceItemConfigureButton-${sanitizedName}`).setAttribute('hidden', true); + document + .getElementById(`zenThemeMarketplaceItemConfigureButton-${sanitizedName}`) + .setAttribute('hidden', true); } } else { await this.enableTheme(themeId); - browser.document.l10n.setAttributes(mozToggle, 'zen-theme-marketplace-toggle-enabled-button'); + browser.document.l10n.setAttributes( + mozToggle, + 'zen-theme-marketplace-toggle-enabled-button' + ); if (theme.preferences) { - document.getElementById(`zenThemeMarketplaceItemConfigureButton-${sanitizedName}`).removeAttribute('hidden'); + document + .getElementById(`zenThemeMarketplaceItemConfigureButton-${sanitizedName}`) + .removeAttribute('hidden'); } } setTimeout(() => { @@ -365,15 +382,19 @@ var gZenMarketplaceManager = { fragment.querySelector('.zenThemeMarketplaceItemTitle').textContent = themeName; fragment.querySelector('.zenThemeMarketplaceItemDescription').textContent = theme.description; - fragment.querySelector('.zenThemeMarketplaceItemUninstallButton').addEventListener('click', async (event) => { - const [msg] = await document.l10n.formatValues([{ id: 'zen-theme-marketplace-remove-confirmation' }]); + fragment + .querySelector('.zenThemeMarketplaceItemUninstallButton') + .addEventListener('click', async (event) => { + const [msg] = await document.l10n.formatValues([ + { id: 'zen-theme-marketplace-remove-confirmation' }, + ]); - if (!confirm(msg)) { - return; - } + if (!confirm(msg)) { + return; + } - await this.removeTheme(event.target.getAttribute('zen-theme-id')); - }); + await this.removeTheme(event.target.getAttribute('zen-theme-id')); + }); if (theme.homepage) { const homepageButton = fragment.querySelector('.zenThemeMarketplaceItemHomepageButton'); @@ -386,12 +407,16 @@ var gZenMarketplaceManager = { } if (theme.preferences) { - fragment.querySelector('.zenThemeMarketplaceItemConfigureButton').addEventListener('click', () => { - dialog.showModal(); - }); + fragment + .querySelector('.zenThemeMarketplaceItemConfigureButton') + .addEventListener('click', () => { + dialog.showModal(); + }); if (isThemeEnabled) { - fragment.querySelector('.zenThemeMarketplaceItemConfigureButton').removeAttribute('hidden'); + fragment + .querySelector('.zenThemeMarketplaceItemConfigureButton') + .removeAttribute('hidden'); } } @@ -432,7 +457,10 @@ var gZenMarketplaceManager = { if (placeholder) { defaultItem.setAttribute('label', placeholder || '-'); } else { - browser.document.l10n.setAttributes(defaultItem, 'zen-theme-marketplace-dropdown-default-label'); + browser.document.l10n.setAttributes( + defaultItem, + 'zen-theme-marketplace-dropdown-default-label' + ); } menupopup.appendChild(defaultItem); @@ -500,7 +528,9 @@ var gZenMarketplaceManager = { `); - const checkboxElement = checkbox.querySelector('.zenThemeMarketplaceItemPreferenceCheckbox'); + const checkboxElement = checkbox.querySelector( + '.zenThemeMarketplaceItemPreferenceCheckbox' + ); checkboxElement.setAttribute('label', label); checkboxElement.setAttribute('tooltiptext', property); checkboxElement.setAttribute('zen-pref', property); @@ -546,7 +576,10 @@ var gZenMarketplaceManager = { if (placeholder) { input.setAttribute('placeholder', placeholder || '-'); } else { - browser.document.l10n.setAttributes(input, 'zen-theme-marketplace-input-default-placeholder'); + browser.document.l10n.setAttributes( + input, + 'zen-theme-marketplace-input-default-placeholder' + ); } input.addEventListener( @@ -558,9 +591,13 @@ var gZenMarketplaceManager = { this._triggerBuildUpdateWithoutRebuild(); if (value === '') { - browser.document.querySelector(':root').style.removeProperty(`--${sanitizedProperty}`); + browser.document + .querySelector(':root') + .style.removeProperty(`--${sanitizedProperty}`); } else { - browser.document.querySelector(':root').style.setProperty(`--${sanitizedProperty}`, value); + browser.document + .querySelector(':root') + .style.setProperty(`--${sanitizedProperty}`, value); } }, 500) ); @@ -630,7 +667,11 @@ var gZenLooksAndFeel = { layout.classList.remove('selected'); if (layout.getAttribute('layout') == 'single' && isSingleToolbar) { layout.classList.add('selected'); - } else if (layout.getAttribute('layout') == 'multiple' && !isSingleToolbar && isExtendedSidebar) { + } else if ( + layout.getAttribute('layout') == 'multiple' && + !isSingleToolbar && + isExtendedSidebar + ) { layout.classList.add('selected'); } else if (layout.getAttribute('layout') == 'collapsed' && !isExtendedSidebar) { layout.classList.add('selected'); @@ -650,7 +691,10 @@ var gZenLooksAndFeel = { layout.classList.add('selected'); - Services.prefs.setBoolPref(kZenExtendedSidebar, layout.getAttribute('layout') != 'collapsed'); + Services.prefs.setBoolPref( + kZenExtendedSidebar, + layout.getAttribute('layout') != 'collapsed' + ); Services.prefs.setBoolPref(kZenSingleToolbar, layout.getAttribute('layout') == 'single'); }); } @@ -734,13 +778,19 @@ var gZenWorkspacesSettings = { }; Services.prefs.addObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs - Services.prefs.addObserver('zen.workspaces.container-specific-essentials-enabled', tabsUnloaderPrefListener); + Services.prefs.addObserver( + 'zen.workspaces.container-specific-essentials-enabled', + tabsUnloaderPrefListener + ); Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener); window.addEventListener('unload', () => { Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener); - Services.prefs.removeObserver('zen.workspaces.container-specific-essentials-enabled', tabsUnloaderPrefListener); + Services.prefs.removeObserver( + 'zen.workspaces.container-specific-essentials-enabled', + tabsUnloaderPrefListener + ); }); }, }; @@ -800,7 +850,10 @@ var zenMissingKeyboardShortcutL10n = { key_accessibility: 'zen-devtools-toggle-accessibility-shortcut', }; -var zenIgnoreKeyboardShortcutL10n = ['zen-full-zoom-reduce-shortcut-alt-b', 'zen-full-zoom-reduce-shortcut-alt-a']; +var zenIgnoreKeyboardShortcutL10n = [ + 'zen-full-zoom-reduce-shortcut-alt-b', + 'zen-full-zoom-reduce-shortcut-alt-a', +]; var gZenCKSSettings = { async init() { @@ -964,8 +1017,16 @@ var gZenCKSSettings = { event.preventDefault(); - let input = document.querySelector(`.${ZEN_CKS_INPUT_FIELD_CLASS}[${KEYBIND_ATTRIBUTE_KEY}="${this._currentActionID}"]`); - const modifiers = new KeyShortcutModifiers(event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, false); + let input = document.querySelector( + `.${ZEN_CKS_INPUT_FIELD_CLASS}[${KEYBIND_ATTRIBUTE_KEY}="${this._currentActionID}"]` + ); + const modifiers = new KeyShortcutModifiers( + event.ctrlKey, + event.altKey, + event.shiftKey, + event.metaKey, + false + ); const modifiersActive = modifiers.areAnyActive(); input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-not-set`); diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index ccaea42c..5bc395be 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c2eb25c4c 100644 +index 6dece2b9d0462d90a28e75350ce983d87816ef73..e54e815b04c311464ed53364007d99bb6c1a0cf3 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -415,11 +415,45 @@ @@ -309,9 +309,11 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c let url = "about:blank"; if (tabData.entries?.length) { -@@ -3638,6 +3723,27 @@ +@@ -3637,7 +3722,29 @@ + skipLoad: true, preferredRemoteType, }); ++ tab._originalUrl = url; + if (tabData.zenWorkspace) { + tab.setAttribute("zen-workspace-id", tabData.zenWorkspace); @@ -337,7 +339,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (select) { tabToSelect = tab; } -@@ -3661,7 +3767,8 @@ +@@ -3661,7 +3768,8 @@ // needs calling: shouldUpdateForPinnedTabs = true; } @@ -347,7 +349,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c let { groupId } = tabData; const tabGroup = tabGroupWorkingData.get(groupId); // if a tab refers to a tab group we don't know, skip any group -@@ -3675,7 +3782,10 @@ +@@ -3675,7 +3783,10 @@ tabGroup.stateData.id, tabGroup.stateData.color, tabGroup.stateData.collapsed, @@ -359,7 +361,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c ); tabsFragment.appendChild(tabGroup.node); } -@@ -3723,8 +3833,16 @@ +@@ -3723,8 +3834,16 @@ // to remove the old selected tab. if (tabToSelect) { let leftoverTab = this.selectedTab; @@ -378,7 +380,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } if (tabs.length > 1 || !tabs[0].selected) { -@@ -3912,7 +4030,7 @@ +@@ -3912,7 +4031,7 @@ // Ensure we have an index if one was not provided. if (typeof index != "number") { // Move the new tab after another tab if needed, to the end otherwise. @@ -387,7 +389,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if ( !bulkOrderedOpen && ((openerTab && -@@ -3935,7 +4053,7 @@ +@@ -3935,7 +4054,7 @@ ) { index = Infinity; } else if (previousTab.visible) { @@ -396,7 +398,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } else if (previousTab == FirefoxViewHandler.tab) { index = 0; } -@@ -3958,18 +4076,18 @@ +@@ -3958,18 +4077,18 @@ // Ensure index is within bounds. if (tab.pinned) { @@ -420,7 +422,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (this.isTab(itemAfter) && itemAfter.group == tabGroup) { // Place at the front of, or between tabs in, the same tab group this.tabContainer.insertBefore(tab, itemAfter); -@@ -4290,6 +4408,9 @@ +@@ -4290,6 +4409,9 @@ return; } @@ -430,7 +432,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c this.removeTabs(selectedTabs, { telemetrySource }); } -@@ -4542,6 +4663,7 @@ +@@ -4542,6 +4664,7 @@ telemetrySource, } = {} ) { @@ -438,7 +440,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // When 'closeWindowWithLastTab' pref is enabled, closing all tabs // can be considered equivalent to closing the window. if ( -@@ -4626,6 +4748,7 @@ +@@ -4626,6 +4749,7 @@ if (lastToClose) { this.removeTab(lastToClose, aParams); } @@ -446,7 +448,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } catch (e) { console.error(e); } -@@ -4650,6 +4773,7 @@ +@@ -4650,6 +4774,7 @@ telemetrySource, } = {} ) { @@ -454,7 +456,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.finish("browser.tabs.opening", window); } -@@ -4663,6 +4787,12 @@ +@@ -4663,6 +4788,12 @@ aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start(); } @@ -467,7 +469,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // Handle requests for synchronously removing an already // asynchronously closing tab. if (!animate && aTab.closing) { -@@ -4677,7 +4807,9 @@ +@@ -4677,7 +4808,9 @@ // frame created for it (for example, by updating the visually selected // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; @@ -478,7 +480,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -4840,7 +4972,7 @@ +@@ -4840,7 +4973,7 @@ closeWindowWithLastTab != null ? closeWindowWithLastTab : !window.toolbar.visible || @@ -487,7 +489,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -4864,6 +4996,7 @@ +@@ -4864,6 +4997,7 @@ newTab = true; } @@ -495,7 +497,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c aTab._endRemoveArgs = [closeWindow, newTab]; // swapBrowsersAndCloseOther will take care of closing the window without animation. -@@ -4903,9 +5036,7 @@ +@@ -4903,9 +5037,7 @@ aTab._mouseleave(); if (newTab) { @@ -506,7 +508,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } else { TabBarVisibility.update(); } -@@ -5034,6 +5165,8 @@ +@@ -5034,6 +5166,8 @@ this.tabs[i]._tPos = i; } @@ -515,7 +517,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (!this._windowIsClosing) { if (wasPinned) { this.tabContainer._positionPinnedTabs(); -@@ -5159,8 +5292,8 @@ +@@ -5159,8 +5293,8 @@ return closedCount; } @@ -526,7 +528,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (unloadBlocked) { return; } -@@ -5248,6 +5381,7 @@ +@@ -5248,6 +5382,7 @@ } let excludeTabs = new Set(aExcludeTabs); @@ -534,7 +536,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // If this tab has a successor, it should be selectable, since // hiding or closing a tab removes that tab as a successor. -@@ -5260,13 +5394,13 @@ +@@ -5260,13 +5395,13 @@ !excludeTabs.has(aTab.owner) && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") ) { @@ -550,7 +552,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c ); let tab = this.tabContainer.findNextTab(aTab, { -@@ -5282,7 +5416,7 @@ +@@ -5282,7 +5417,7 @@ } if (tab) { @@ -559,7 +561,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } // If no qualifying visible tab was found, see if there is a tab in -@@ -5303,7 +5437,7 @@ +@@ -5303,7 +5438,7 @@ }); } @@ -568,7 +570,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } _blurTab(aTab) { -@@ -5704,10 +5838,10 @@ +@@ -5704,10 +5839,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -581,7 +583,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -6001,7 +6135,7 @@ +@@ -6001,7 +6136,7 @@ // Don't allow mixing pinned and unpinned tabs. if (this.isTab(element) && element.pinned) { @@ -590,7 +592,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c } else { tabIndex = Math.max(tabIndex, this.pinnedTabCount); } -@@ -6028,9 +6162,16 @@ +@@ -6028,9 +6163,16 @@ element, () => { let neighbor = this.tabs[tabIndex]; @@ -608,7 +610,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (neighbor && this.isTab(element) && tabIndex > element._tPos) { neighbor.after(element); } else { -@@ -6099,7 +6240,9 @@ +@@ -6099,7 +6241,9 @@ targetElement = targetElement.group; } } @@ -619,7 +621,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // Don't allow mixing pinned and unpinned tabs. if (element.pinned && !targetElement?.pinned) { targetElement = this.tabs[this.pinnedTabCount - 1]; -@@ -6109,7 +6252,13 @@ +@@ -6109,7 +6253,13 @@ moveBefore = true; } @@ -633,7 +635,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c if (element.pinned && this.tabContainer.verticalMode) { return this.tabContainer.verticalPinnedTabsContainer; } -@@ -6169,7 +6318,7 @@ +@@ -6169,7 +6319,7 @@ if (!this.isTab(aTab)) { throw new Error("Can only move a tab into a tab group"); } @@ -642,7 +644,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c return; } if (aTab.group && aTab.group.id === aGroup.id) { -@@ -6263,6 +6412,10 @@ +@@ -6263,6 +6413,10 @@ moveActionCallback(); @@ -653,7 +655,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // Clear tabs cache after moving nodes because the order of tabs may have // changed. this.tabContainer._invalidateCachedTabs(); -@@ -7080,7 +7233,7 @@ +@@ -7080,7 +7234,7 @@ // preventDefault(). It will still raise the window if appropriate. break; } @@ -662,7 +664,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c window.focus(); aEvent.preventDefault(); break; -@@ -7981,6 +8134,7 @@ +@@ -7981,6 +8135,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -670,7 +672,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; } -@@ -8954,7 +9108,7 @@ var TabContextMenu = { +@@ -8954,7 +9109,7 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !this.multiselected; @@ -679,7 +681,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..a2fd09d94746bbb8ba16c5e234c6e99c // Move Tab items let contextMoveTabOptions = document.getElementById( "context_moveTabOptions" -@@ -9223,6 +9377,7 @@ var TabContextMenu = { +@@ -9223,6 +9378,7 @@ var TabContextMenu = { telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP, }); } else { diff --git a/src/browser/themes/shared/preferences/zen-preferences.css b/src/browser/themes/shared/preferences/zen-preferences.css index 9075840d..5cb53fa7 100644 --- a/src/browser/themes/shared/preferences/zen-preferences.css +++ b/src/browser/themes/shared/preferences/zen-preferences.css @@ -7,7 +7,10 @@ @namespace html 'http://www.w3.org/1999/xhtml'; :root { - --zen-settings-secondary-background: light-dark(#f2f4f4, color-mix(in srgb, var(--zen-colors-tertiary) 50%, #0f0f0f 50%)); + --zen-settings-secondary-background: light-dark( + #f2f4f4, + color-mix(in srgb, var(--zen-colors-tertiary) 50%, #0f0f0f 50%) + ); --in-content-box-background: var(--zen-colors-tertiary) !important; } diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index a07cdc43..bb04ea90 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -94,8 +94,16 @@ #appMenu-passwords-button, #password-notification-icon, -#PopupAutoComplete > richlistbox > richlistitem[originaltype='generatedPassword'] > .two-line-wrapper > .ac-site-icon, -#PopupAutoComplete > richlistbox > richlistitem[originaltype='loginWithOrigin'] > .two-line-wrapper > .ac-site-icon, +#PopupAutoComplete + > richlistbox + > richlistitem[originaltype='generatedPassword'] + > .two-line-wrapper + > .ac-site-icon, +#PopupAutoComplete + > richlistbox + > richlistitem[originaltype='loginWithOrigin'] + > .two-line-wrapper + > .ac-site-icon, #PopupAutoComplete > richlistbox > richlistitem[originaltype='login'] > .ac-site-icon { list-style-image: url('passwords.svg') !important; } @@ -125,13 +133,19 @@ } #history-panelmenu, -.urlbarView-row[source='history'] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, +.urlbarView-row[source='history'] + > .urlbarView-row-inner + > .urlbarView-no-wrap + > .urlbarView-favicon, #urlbar-engine-one-off-item-history, #appMenu-history-button, #appMenu-library-history-button, #sidebar-switcher-history, #zen-history-button, -#sidebar-box[sidebarcommand='viewHistorySidebar'] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon { +#sidebar-box[sidebarcommand='viewHistorySidebar'] + > #sidebar-header + > #sidebar-switcher-target + > #sidebar-icon { list-style-image: url('history.svg') !important; } @@ -276,7 +290,10 @@ #appMenu-bookmarks-button, #sidebar-switcher-bookmarks, #appMenu-library-bookmarks-button, -#sidebar-box[sidebarcommand='viewBookmarksSidebar'] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon { +#sidebar-box[sidebarcommand='viewBookmarksSidebar'] + > #sidebar-header + > #sidebar-switcher-target + > #sidebar-icon { list-style-image: url('bookmark-star-on-tray.svg') !important; } @@ -302,7 +319,10 @@ list-style-image: url('page-portrait.svg') !important; } -#urlbar:not(.searchButton) > #urlbar-input-container > #identity-box[pageproxystate='invalid'] #identity-icon { +#urlbar:not(.searchButton) + > #urlbar-input-container + > #identity-box[pageproxystate='invalid'] + #identity-icon { list-style-image: url('search-glass.svg') !important; } @@ -428,7 +448,10 @@ list-style-image: url('split.svg'); } -#sidebar-box[sidebarcommand='viewTabsSidebar'] > #sidebar-header > #sidebar-switcher-target > #sidebar-icon, +#sidebar-box[sidebarcommand='viewTabsSidebar'] + > #sidebar-header + > #sidebar-switcher-target + > #sidebar-icon, #sidebar-switcher-tabs { list-style-image: url('send-to-device.svg') !important; } @@ -592,7 +615,10 @@ background-image: url('reload-to-stop.svg') !important; } -#stop-reload-button[animate] > #reload-button > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image, +#stop-reload-button[animate] + > #reload-button + > .toolbarbutton-animatable-box + > .toolbarbutton-animatable-image, #zen-sidebar-web-panel-reload[animate] > #zen-sidebar-web-panel-reload-button > .toolbarbutton-animatable-box @@ -630,7 +656,14 @@ ), :not(:not(menubar) > menu, #ContentSelectDropdown) > menupopup - > menu:not(.menu-iconic, [type='checkbox'], [type='radio'], .in-menulist, .in-menulist menu, .unified-nav-current), + > menu:not( + .menu-iconic, + [type='checkbox'], + [type='radio'], + .in-menulist, + .in-menulist menu, + .unified-nav-current + ), #toggle_toolbar-menubar, #PanelUI-history toolbarbutton, #unified-extensions-context-menu menuitem { @@ -1112,10 +1145,18 @@ menuitem[id='placesContext_new:separator'] { ), :not(:not(menubar) > menu, #ContentSelectDropdown) > menupopup - > menu:not(.menu-iconic, [type='checkbox'], [type='radio'], .in-menulist, .in-menulist menu, .unified-nav-current), + > menu:not( + .menu-iconic, + [type='checkbox'], + [type='radio'], + .in-menulist, + .in-menulist menu, + .unified-nav-current + ), :not(:not(menubar) > menu, #ContentSelectDropdown) > menupopup > menucaption { padding-inline-start: calc( - var(--fp-contextmenu-menuitem-padding-inline) + 16px + var(--fp-contextmenu-menuicon-margin-inline) + var(--fp-contextmenu-menuitem-padding-inline) + 16px + + var(--fp-contextmenu-menuicon-margin-inline) ) !important; } diff --git a/src/zen/@types/lib.gecko.darwin.d.ts b/src/zen/@types/lib.gecko.darwin.d.ts index e23e2d31..400ad03f 100644 --- a/src/zen/@types/lib.gecko.darwin.d.ts +++ b/src/zen/@types/lib.gecko.darwin.d.ts @@ -52,7 +52,11 @@ declare global { setBadgeImage(aBadgeImage: imgIContainer, aPaintContext?: nsISVGPaintContext): void; readonly isAppInDock: boolean; ensureAppIsPinnedToDock(aAppPath?: string, aAppToReplacePath?: string): boolean; - launchAppBundle(aAppBundle: nsIFile, aArgs: string[], aLaunchOptions?: nsIAppBundleLaunchOptions): void; + launchAppBundle( + aAppBundle: nsIFile, + aArgs: string[], + aLaunchOptions?: nsIAppBundleLaunchOptions + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsIMacFinderProgress.idl diff --git a/src/zen/@types/lib.gecko.dom.d.ts b/src/zen/@types/lib.gecko.dom.d.ts index 58614b00..9b759a5d 100644 --- a/src/zen/@types/lib.gecko.dom.d.ts +++ b/src/zen/@types/lib.gecko.dom.d.ts @@ -4300,7 +4300,9 @@ interface sendAbuseReportOptions { type EventListener = ((event: Event) => void) | { handleEvent(event: Event): void }; -type MessageListener = ((argument: ReceiveMessageArgument) => any) | { receiveMessage(argument: ReceiveMessageArgument): any }; +type MessageListener = + | ((argument: ReceiveMessageArgument) => any) + | { receiveMessage(argument: ReceiveMessageArgument): any }; type MozDocumentCallback = | ((matcher: MozDocumentMatcher, window: WindowProxy) => void) @@ -4327,7 +4329,9 @@ declare var NodeFilter: { readonly SHOW_NOTATION: 0x800; }; -type ObserverCallback = ((observer: FetchObserver) => void) | { handleEvent(observer: FetchObserver): void }; +type ObserverCallback = + | ((observer: FetchObserver) => void) + | { handleEvent(observer: FetchObserver): void }; type UncaughtRejectionObserver = ((p: any) => boolean) | { onLeftUncaught(p: any): boolean }; @@ -4351,7 +4355,13 @@ type XPathNSResolver = interface ANGLE_instanced_arrays { drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; - drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; + drawElementsInstancedANGLE( + mode: GLenum, + count: GLsizei, + type: GLenum, + offset: GLintptr, + primcount: GLsizei + ): void; vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88fe; } @@ -4609,7 +4619,11 @@ declare var AddonInstall: { interface AddonManager extends EventTarget { createInstall(options?: addonInstallOptions): Promise; getAddonByID(id: string): Promise; - sendAbuseReport(addonId: string, data: Record, options?: sendAbuseReportOptions): Promise; + sendAbuseReport( + addonId: string, + data: Record, + options?: sendAbuseReportOptions + ): Promise; } declare var AddonManager: { @@ -5033,7 +5047,11 @@ interface AudioParam { linearRampToValueAtTime(value: number, endTime: number): AudioParam; setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; setValueAtTime(value: number, startTime: number): AudioParam; - setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; + setValueCurveAtTime( + values: number[] | Float32Array, + startTime: number, + duration: number + ): AudioParam; } declare var AudioParam: { @@ -5044,7 +5062,10 @@ declare var AudioParam: { /** Available only in secure contexts. */ interface AudioParamMap { - forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; + forEach( + callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, + thisArg?: any + ): void; } declare var AudioParamMap: { @@ -5200,7 +5221,11 @@ interface AudioWorkletNode extends AudioNode { declare var AudioWorkletNode: { prototype: AudioWorkletNode; - new (context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; + new ( + context: BaseAudioContext, + name: string, + options?: AudioWorkletNodeOptions + ): AudioWorkletNode; isInstance: IsInstance; }; @@ -5387,7 +5412,11 @@ interface BiquadFilterNode extends AudioNode, AudioNodePassThrough { readonly frequency: AudioParam; readonly gain: AudioParam; type: BiquadFilterType; - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; + getFrequencyResponse( + frequencyHz: Float32Array, + magResponse: Float32Array, + phaseResponse: Float32Array + ): void; } declare var BiquadFilterNode: { @@ -5667,7 +5696,10 @@ interface CSSCustomPropertyRegisteredEvent extends Event { declare var CSSCustomPropertyRegisteredEvent: { prototype: CSSCustomPropertyRegisteredEvent; - new (type: string, eventInitDict?: CSSCustomPropertyRegisteredEventInit): CSSCustomPropertyRegisteredEvent; + new ( + type: string, + eventInitDict?: CSSCustomPropertyRegisteredEventInit + ): CSSCustomPropertyRegisteredEvent; isInstance: IsInstance; }; @@ -5973,7 +6005,12 @@ interface CSSStyleRule extends CSSGroupingRule { selectorText: string; readonly style: CSSStyleDeclaration; getSelectorWarnings(): SelectorWarning[]; - selectorMatchesElement(selectorIndex: number, element: Element, pseudo?: string, includeVisitedStyle?: boolean): boolean; + selectorMatchesElement( + selectorIndex: number, + element: Element, + pseudo?: string, + includeVisitedStyle?: boolean + ): boolean; selectorSpecificityAt(index: number, desugared?: boolean): number; selectorTextAt(index: number, desugared?: boolean): string; } @@ -6104,8 +6141,16 @@ interface CanonicalBrowsingContext extends BrowsingContext { clearRestoreState(): void; fixupAndLoadURIString(aURI: string, aOptions?: LoadURIOptions): void; getWindowGlobals(): WindowGlobalParent[]; - goBack(aCancelContentJSEpoch?: number, aRequireUserInteraction?: boolean, aUserActivation?: boolean): void; - goForward(aCancelContentJSEpoch?: number, aRequireUserInteraction?: boolean, aUserActivation?: boolean): void; + goBack( + aCancelContentJSEpoch?: number, + aRequireUserInteraction?: boolean, + aUserActivation?: boolean + ): void; + goForward( + aCancelContentJSEpoch?: number, + aRequireUserInteraction?: boolean, + aUserActivation?: boolean + ): void; goToIndex(aIndex: number, aCancelContentJSEpoch?: number, aUserActivation?: boolean): void; loadURI(aURI: URI, aOptions?: LoadURIOptions): void; notifyMediaMutedChanged(muted: boolean): void; @@ -6113,7 +6158,12 @@ interface CanonicalBrowsingContext extends BrowsingContext { print(aPrintSettings: nsIPrintSettings): Promise; reload(aReloadFlags: number): void; resetScalingZoom(): void; - startApzAutoscroll(aAnchorX: number, aAnchorY: number, aScrollId: number, aPresShellId: number): boolean; + startApzAutoscroll( + aAnchorX: number, + aAnchorY: number, + aScrollId: number, + aPresShellId: number + ): boolean; stop(aStopFlags: number): void; stopApzAutoscroll(aScrollId: number, aPresShellId: number): void; } @@ -6198,7 +6248,14 @@ interface CanvasFillStrokeStyles { createConicGradient(angle: number, cx: number, cy: number): CanvasGradient; createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + createRadialGradient( + x0: number, + y0: number, + r0: number, + x1: number, + y1: number, + r1: number + ): CanvasGradient; } interface CanvasFilters { @@ -6246,7 +6303,14 @@ interface CanvasPathDrawingStyles { } interface CanvasPathMethods { - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arc( + x: number, + y: number, + radius: number, + startAngle: number, + endAngle: number, + anticlockwise?: boolean + ): void; arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; closePath(): void; @@ -6264,7 +6328,13 @@ interface CanvasPathMethods { moveTo(x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; rect(x: number, y: number, w: number, h: number): void; - roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void; + roundRect( + x: number, + y: number, + w: number, + h: number, + radii?: number | DOMPointInit | (number | DOMPointInit)[] + ): void; } interface CanvasPattern { @@ -6302,7 +6372,15 @@ interface CanvasRenderingContext2D CanvasUserInterface { readonly canvas: HTMLCanvasElement | null; demote(): void; - drawWindow(window: Window, x: number, y: number, w: number, h: number, bgColor: string, flags?: number): void; + drawWindow( + window: Window, + x: number, + y: number, + w: number, + h: number, + bgColor: string, + flags?: number + ): void; getContextAttributes(): CanvasRenderingContext2DSettings; getDebugInfo(ensureTarget?: boolean): CanvasRenderingContext2DDebugInfo; readonly DRAWWINDOW_DRAW_CARET: 0x01; @@ -6461,7 +6539,11 @@ interface ChannelWrapper extends EventTarget { getRequestHeader(header: string): string | null; getRequestHeaders(): MozHTTPHeader[]; getResponseHeaders(): MozHTTPHeader[]; - matches(filter?: MozRequestFilter, extension?: WebExtensionPolicy | null, options?: MozRequestMatchOptions): boolean; + matches( + filter?: MozRequestFilter, + extension?: WebExtensionPolicy | null, + options?: MozRequestMatchOptions + ): boolean; redirectTo(url: URI): void; registerTraceableChannel(extension: WebExtensionPolicy, remoteTab: RemoteTab | null): void; resume(): void; @@ -6496,7 +6578,11 @@ declare var ChannelWrapper: { new (): ChannelWrapper; isInstance: IsInstance; get(channel: MozChannel): ChannelWrapper; - getRegisteredChannel(aChannelId: number, extension: WebExtensionPolicy, remoteTab: RemoteTab | null): ChannelWrapper | null; + getRegisteredChannel( + aChannelId: number, + extension: WebExtensionPolicy, + remoteTab: RemoteTab | null + ): ChannelWrapper | null; }; interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { @@ -6869,7 +6955,10 @@ interface ContentVisibilityAutoStateChangeEvent extends Event { declare var ContentVisibilityAutoStateChangeEvent: { prototype: ContentVisibilityAutoStateChangeEvent; - new (type: string, eventInitDict?: ContentVisibilityAutoStateChangeEventInit): ContentVisibilityAutoStateChangeEvent; + new ( + type: string, + eventInitDict?: ContentVisibilityAutoStateChangeEventInit + ): ContentVisibilityAutoStateChangeEvent; isInstance: IsInstance; }; @@ -7031,7 +7120,11 @@ declare var CryptoKey: { }; interface CustomElementRegistry { - define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; + define( + name: string, + constructor: CustomElementConstructor, + options?: ElementDefinitionOptions + ): void; get(name: string): CustomElementConstructor | undefined; getName(constructor: CustomElementConstructor): string | null; setElementCreationCallback(name: string, callback: CustomElementCreationCallback): void; @@ -7057,7 +7150,10 @@ declare var CustomEvent: { }; interface CustomStateSet { - forEach(callbackfn: (value: string, key: string, parent: CustomStateSet) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: CustomStateSet) => void, + thisArg?: any + ): void; } declare var CustomStateSet: { @@ -7131,7 +7227,11 @@ declare var DOMException: { }; interface DOMImplementation { - createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): Document; + createDocument( + namespace: string | null, + qualifiedName: string | null, + doctype?: DocumentType | null + ): Document; createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; createHTMLDocument(title?: string): Document; hasFeature(): boolean; @@ -7158,7 +7258,12 @@ interface DOMLocalization extends Localization { declare var DOMLocalization: { prototype: DOMLocalization; - new (aResourceIds: L10nResourceId[], aSync?: boolean, aRegistry?: L10nRegistry, aLocales?: string[]): DOMLocalization; + new ( + aResourceIds: L10nResourceId[], + aSync?: boolean, + aRegistry?: L10nRegistry, + aLocales?: string[] + ): DOMLocalization; isInstance: IsInstance; }; @@ -7192,7 +7297,14 @@ interface DOMMatrix extends DOMMatrixReadOnly { rotateFromVectorSelf(x?: number, y?: number): DOMMatrix; rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; - scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + scaleSelf( + scaleX?: number, + scaleY?: number, + scaleZ?: number, + originX?: number, + originY?: number, + originZ?: number + ): DOMMatrix; setMatrixValue(transformList: string): DOMMatrix; skewXSelf(sx?: number): DOMMatrix; skewYSelf(sy?: number): DOMMatrix; @@ -7243,7 +7355,14 @@ interface DOMMatrixReadOnly { rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; rotateFromVector(x?: number, y?: number): DOMMatrix; - scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + scale( + scaleX?: number, + scaleY?: number, + scaleZ?: number, + originX?: number, + originY?: number, + originZ?: number + ): DOMMatrix; scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix; skewX(sx?: number): DOMMatrix; @@ -7271,7 +7390,12 @@ interface DOMParser { parseFromBuffer(buf: number[], type: SupportedType): Document; parseFromBuffer(buf: Uint8Array, type: SupportedType): Document; parseFromSafeString(str: string, type: SupportedType): Document; - parseFromStream(stream: InputStream, charset: string | null, contentLength: number, type: SupportedType): Document; + parseFromStream( + stream: InputStream, + charset: string | null, + contentLength: number, + type: SupportedType + ): Document; parseFromString(str: TrustedHTML | string, type: SupportedType): Document; } @@ -7406,7 +7530,10 @@ interface DOMTokenList { replace(token: string, newToken: string): boolean; supports(token: string): boolean; toggle(token: string, force?: boolean): boolean; - forEach(callbackfn: (value: string | null, key: number, parent: DOMTokenList) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string | null, key: number, parent: DOMTokenList) => void, + thisArg?: any + ): void; [index: number]: string; } @@ -7735,7 +7862,11 @@ interface Document blockParsing(promise: any, options?: BlockParsingOptions): Promise; blockUnblockOnload(block: boolean): void; captureEvents(): void; - caretPositionFromPoint(x: number, y: number, options?: CaretPositionFromPointOptions): CaretPosition | null; + caretPositionFromPoint( + x: number, + y: number, + options?: CaretPositionFromPointOptions + ): CaretPosition | null; clear(): void; clearUserGestureActivation(): void; close(): void; @@ -7746,14 +7877,21 @@ interface Document createCDATASection(data: string): CDATASection; createComment(data: string): Comment; createDocumentFragment(): DocumentFragment; - createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement( + tagName: K, + options?: ElementCreationOptions + ): HTMLElementTagNameMap[K]; /** @deprecated */ createElement( tagName: K, options?: ElementCreationOptions ): HTMLElementDeprecatedTagNameMap[K]; createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; - createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; + createElementNS( + namespace: string | null, + qualifiedName: string, + options?: string | ElementCreationOptions + ): Element; createEvent(eventInterface: 'AddonEvent'): AddonEvent; createEvent(eventInterface: 'AnimationEvent'): AnimationEvent; createEvent(eventInterface: 'AnimationPlaybackEvent'): AnimationPlaybackEvent; @@ -7766,7 +7904,9 @@ interface Document createEvent(eventInterface: 'CloseEvent'): CloseEvent; createEvent(eventInterface: 'CommandEvent'): CommandEvent; createEvent(eventInterface: 'CompositionEvent'): CompositionEvent; - createEvent(eventInterface: 'ContentVisibilityAutoStateChangeEvent'): ContentVisibilityAutoStateChangeEvent; + createEvent( + eventInterface: 'ContentVisibilityAutoStateChangeEvent' + ): ContentVisibilityAutoStateChangeEvent; createEvent(eventInterface: 'CookieChangeEvent'): CookieChangeEvent; createEvent(eventInterface: 'CustomEvent'): CustomEvent; createEvent(eventInterface: 'DeviceLightEvent'): DeviceLightEvent; @@ -7805,7 +7945,9 @@ interface Document createEvent(eventInterface: 'MutationEvent'): MutationEvent; createEvent(eventInterface: 'MutationEvents'): MutationEvent; createEvent(eventInterface: 'NavigateEvent'): NavigateEvent; - createEvent(eventInterface: 'NavigationCurrentEntryChangeEvent'): NavigationCurrentEntryChangeEvent; + createEvent( + eventInterface: 'NavigationCurrentEntryChangeEvent' + ): NavigationCurrentEntryChangeEvent; createEvent(eventInterface: 'NotifyPaintEvent'): NotifyPaintEvent; createEvent(eventInterface: 'OfflineAudioCompletionEvent'): OfflineAudioCompletionEvent; createEvent(eventInterface: 'PageTransitionEvent'): PageTransitionEvent; @@ -7833,7 +7975,9 @@ interface Document createEvent(eventInterface: 'SpeechSynthesisEvent'): SpeechSynthesisEvent; createEvent(eventInterface: 'StorageEvent'): StorageEvent; createEvent(eventInterface: 'StreamFilterDataEvent'): StreamFilterDataEvent; - createEvent(eventInterface: 'StyleSheetApplicableStateChangeEvent'): StyleSheetApplicableStateChangeEvent; + createEvent( + eventInterface: 'StyleSheetApplicableStateChangeEvent' + ): StyleSheetApplicableStateChangeEvent; createEvent(eventInterface: 'StyleSheetRemovedEvent'): StyleSheetRemovedEvent; createEvent(eventInterface: 'SubmitEvent'): SubmitEvent; createEvent(eventInterface: 'TCPServerSocketEvent'): TCPServerSocketEvent; @@ -7890,9 +8034,15 @@ interface Document getConnectedShadowRoots(): ShadowRoot[]; getElementsByClassName(classNames: string): HTMLCollection; getElementsByName(elementName: string): NodeList; - getElementsByTagName(localName: K): HTMLCollectionOf; - getElementsByTagName(localName: K): HTMLCollectionOf; - getElementsByTagName(localName: K): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; /** @deprecated */ getElementsByTagName( localName: K @@ -7923,7 +8073,10 @@ interface Document reloadWithHttpsOnlyException(): void; removeAnonymousContent(aContent: AnonymousContent): void; requestStorageAccess(): Promise; - requestStorageAccessForOrigin(thirdPartyOrigin: string, requireUserInteraction?: boolean): Promise; + requestStorageAccessForOrigin( + thirdPartyOrigin: string, + requireUserInteraction?: boolean + ): Promise; requestStorageAccessUnderSite(serializedSite: string): Promise; setKeyPressEventModel(aKeyPressEventModel: number): void; setNotifyFetchSuccess(aShouldNotify: boolean): void; @@ -8156,7 +8309,14 @@ interface ElementEventMap { fullscreenerror: Event; } -interface Element extends Node, ARIAMixin, Animatable, ChildNode, GeometryUtils, NonDocumentTypeChildNode, ParentNode { +interface Element + extends Node, + ARIAMixin, + Animatable, + ChildNode, + GeometryUtils, + NonDocumentTypeChildNode, + ParentNode { readonly assignedSlot: HTMLSlotElement | null; readonly attributes: NamedNodeMap; readonly classList: DOMTokenList; @@ -8209,9 +8369,15 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, GeometryUtils, getBoundingClientRect(): DOMRect; getClientRects(): DOMRectList; getElementsByClassName(classNames: string): HTMLCollection; - getElementsByTagName(localName: K): HTMLCollectionOf; - getElementsByTagName(localName: K): HTMLCollectionOf; - getElementsByTagName(localName: K): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; + getElementsByTagName( + localName: K + ): HTMLCollectionOf; /** @deprecated */ getElementsByTagName( localName: K @@ -8306,7 +8472,10 @@ interface ElementInternals extends ARIAMixin { readonly willValidate: boolean; checkValidity(): boolean; reportValidity(): boolean; - setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; + setFormValue( + value: File | string | FormData | null, + state?: File | string | FormData | null + ): void; setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void; } @@ -8423,7 +8592,10 @@ declare var EventCallbackDebuggerNotification: { }; interface EventCounts { - forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void; + forEach( + callbackfn: (value: number, key: string, parent: EventCounts) => void, + thisArg?: any + ): void; } declare var EventCounts: { @@ -8504,7 +8676,11 @@ interface EventTarget { ): void; dispatchEvent(event: Event): boolean; getEventHandler(type: string): EventHandler; - removeEventListener(type: string, listener: EventListener | null, options?: EventListenerOptions | boolean): void; + removeEventListener( + type: string, + listener: EventListener | null, + options?: EventListenerOptions | boolean + ): void; setEventHandler(type: string, handler: EventHandler): void; } @@ -8715,7 +8891,10 @@ declare var FileSystemDirectoryEntry: { /** Available only in secure contexts. */ interface FileSystemDirectoryHandle extends FileSystemHandle { - getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; + getDirectoryHandle( + name: string, + options?: FileSystemGetDirectoryOptions + ): Promise; getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; resolve(possibleDescendant: FileSystemHandle): Promise; @@ -9007,7 +9186,10 @@ interface FormData { has(name: string): boolean; set(name: string, value: Blob, filename?: string): void; set(name: string, value: string): void; - forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; + forEach( + callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, + thisArg?: any + ): void; } declare var FormData: { @@ -9064,7 +9246,10 @@ interface FrameLoader extends WebBrowserPersistable { readonly ownerElement: Element | null; readonly remoteTab: RemoteTab | null; exitPrintPreview(): void; - printPreview(aPrintSettings: nsIPrintSettings, aSourceBrowsingContext: BrowsingContext | null): Promise; + printPreview( + aPrintSettings: nsIPrintSettings, + aSourceBrowsingContext: BrowsingContext | null + ): Promise; requestEpochUpdate(aEpoch: number): void; requestSHistoryUpdate(): void; requestTabStateFlush(): Promise; @@ -9155,7 +9340,11 @@ declare var GPUBindGroupLayout: { }; interface GPUBindingCommandsMixin { - setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: GPUBufferDynamicOffset[]): void; + setBindGroup( + index: GPUIndex32, + bindGroup: GPUBindGroup | null, + dynamicOffsets?: GPUBufferDynamicOffset[] + ): void; setBindGroup( index: GPUIndex32, bindGroup: GPUBindGroup | null, @@ -9217,9 +9406,21 @@ interface GPUCommandEncoder extends GPUDebugCommandsMixin, GPUObjectBase { destinationOffset: GPUSize64, size: GPUSize64 ): void; - copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void; - copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D): void; - copyTextureToTexture(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D): void; + copyBufferToTexture( + source: GPUTexelCopyBufferInfo, + destination: GPUTexelCopyTextureInfo, + copySize: GPUExtent3D + ): void; + copyTextureToBuffer( + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyBufferInfo, + copySize: GPUExtent3D + ): void; + copyTextureToTexture( + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyTextureInfo, + copySize: GPUExtent3D + ): void; finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer; resolveQuerySet( querySet: GPUQuerySet, @@ -9264,8 +9465,15 @@ declare var GPUCompilationMessage: { }; /** Available only in secure contexts. */ -interface GPUComputePassEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase { - dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY?: GPUSize32, workgroupCountZ?: GPUSize32): void; +interface GPUComputePassEncoder + extends GPUBindingCommandsMixin, + GPUDebugCommandsMixin, + GPUObjectBase { + dispatchWorkgroups( + workgroupCountX: GPUSize32, + workgroupCountY?: GPUSize32, + workgroupCountZ?: GPUSize32 + ): void; dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void; end(): void; setPipeline(pipeline: GPUComputePipeline): void; @@ -9437,7 +9645,13 @@ interface GPUQueue extends GPUObjectBase { ): void; onSubmittedWorkDone(): Promise; submit(buffers: GPUCommandBuffer[]): void; - writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: BufferSource, dataOffset?: GPUSize64, size?: GPUSize64): void; + writeBuffer( + buffer: GPUBuffer, + bufferOffset: GPUSize64, + data: BufferSource, + dataOffset?: GPUSize64, + size?: GPUSize64 + ): void; writeTexture( destination: GPUTexelCopyTextureInfo, data: BufferSource, @@ -9462,7 +9676,11 @@ declare var GPURenderBundle: { }; /** Available only in secure contexts. */ -interface GPURenderBundleEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase, GPURenderCommandsMixin { +interface GPURenderBundleEncoder + extends GPUBindingCommandsMixin, + GPUDebugCommandsMixin, + GPUObjectBase, + GPURenderCommandsMixin { finish(descriptor?: GPURenderBundleDescriptor): GPURenderBundle; } @@ -9473,7 +9691,12 @@ declare var GPURenderBundleEncoder: { }; interface GPURenderCommandsMixin { - draw(vertexCount: GPUSize32, instanceCount?: GPUSize32, firstVertex?: GPUSize32, firstInstance?: GPUSize32): void; + draw( + vertexCount: GPUSize32, + instanceCount?: GPUSize32, + firstVertex?: GPUSize32, + firstInstance?: GPUSize32 + ): void; drawIndexed( indexCount: GPUSize32, instanceCount?: GPUSize32, @@ -9483,13 +9706,22 @@ interface GPURenderCommandsMixin { ): void; drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void; drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void; - setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): void; + setIndexBuffer( + buffer: GPUBuffer, + indexFormat: GPUIndexFormat, + offset?: GPUSize64, + size?: GPUSize64 + ): void; setPipeline(pipeline: GPURenderPipeline): void; setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64, size?: GPUSize64): void; } /** Available only in secure contexts. */ -interface GPURenderPassEncoder extends GPUBindingCommandsMixin, GPUDebugCommandsMixin, GPUObjectBase, GPURenderCommandsMixin { +interface GPURenderPassEncoder + extends GPUBindingCommandsMixin, + GPUDebugCommandsMixin, + GPUObjectBase, + GPURenderCommandsMixin { beginOcclusionQuery(queryIndex: GPUSize32): void; end(): void; endOcclusionQuery(): void; @@ -9502,7 +9734,14 @@ interface GPURenderPassEncoder extends GPUBindingCommandsMixin, GPUDebugCommands height: GPUIntegerCoordinate ): void; setStencilReference(reference: GPUStencilValue): void; - setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): void; + setViewport( + x: number, + y: number, + width: number, + height: number, + minDepth: number, + maxDepth: number + ): void; } declare var GPURenderPassEncoder: { @@ -9542,7 +9781,10 @@ declare var GPUShaderModule: { /** Available only in secure contexts. */ interface GPUSupportedFeatures { - forEach(callbackfn: (value: string, key: string, parent: GPUSupportedFeatures) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: GPUSupportedFeatures) => void, + thisArg?: any + ): void; } declare var GPUSupportedFeatures: { @@ -9628,7 +9870,10 @@ interface GPUUncapturedErrorEvent extends Event { declare var GPUUncapturedErrorEvent: { prototype: GPUUncapturedErrorEvent; - new (type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit): GPUUncapturedErrorEvent; + new ( + type: string, + gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit + ): GPUUncapturedErrorEvent; isInstance: IsInstance; }; @@ -9772,8 +10017,19 @@ interface GamepadServiceTest { numTouchEvents: number ): Promise; newAxisMoveEvent(index: number, axis: number, value: number): Promise; - newButtonEvent(index: number, button: number, pressed: boolean, touched: boolean): Promise; - newButtonValueEvent(index: number, button: number, pressed: boolean, touched: boolean, value: number): Promise; + newButtonEvent( + index: number, + button: number, + pressed: boolean, + touched: boolean + ): Promise; + newButtonValueEvent( + index: number, + button: number, + pressed: boolean, + touched: boolean, + value: number + ): Promise; newPoseMove( index: number, orient: Float32Array | null, @@ -9887,9 +10143,21 @@ declare var GeolocationPositionError: { }; interface GeometryUtils { - convertPointFromNode(point: DOMPointInit, from: GeometryNode, options?: ConvertCoordinateOptions): DOMPoint; - convertQuadFromNode(quad: DOMQuad, from: GeometryNode, options?: ConvertCoordinateOptions): DOMQuad; - convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options?: ConvertCoordinateOptions): DOMQuad; + convertPointFromNode( + point: DOMPointInit, + from: GeometryNode, + options?: ConvertCoordinateOptions + ): DOMPoint; + convertQuadFromNode( + quad: DOMQuad, + from: GeometryNode, + options?: ConvertCoordinateOptions + ): DOMQuad; + convertRectFromNode( + rect: DOMRectReadOnly, + from: GeometryNode, + options?: ConvertCoordinateOptions + ): DOMQuad; getBoxQuads(options?: BoxQuadOptions): DOMQuad[]; getBoxQuadsFromWindowOrigin(options?: BoxQuadOptions): DOMQuad[]; } @@ -11695,7 +11963,12 @@ interface HTMLInputElement setDateTimePickerState(aIsOpen: boolean): void; setFocusState(aIsFocused: boolean): void; setRangeText(replacement: string): void; - setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void; + setRangeText( + replacement: string, + start: number, + end: number, + selectionMode?: SelectionMode + ): void; setSelectionRange(start: number, end: number, direction?: string): void; showPicker(): void; stepDown(n?: number): void; @@ -13157,7 +13430,12 @@ interface HTMLTextAreaElement extends HTMLElement, MozEditableElement { select(): void; setCustomValidity(error: string): void; setRangeText(replacement: string): void; - setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void; + setRangeText( + replacement: string, + start: number, + end: number, + selectionMode?: SelectionMode + ): void; setSelectionRange(start: number, end: number, direction?: string): void; addEventListener( type: K, @@ -13443,7 +13721,10 @@ declare var HeapSnapshot: { interface Highlight { priority: number; type: HighlightType; - forEach(callbackfn: (value: AbstractRange, key: AbstractRange, parent: Highlight) => void, thisArg?: any): void; + forEach( + callbackfn: (value: AbstractRange, key: AbstractRange, parent: Highlight) => void, + thisArg?: any + ): void; } declare var Highlight: { @@ -13453,7 +13734,10 @@ declare var Highlight: { }; interface HighlightRegistry { - forEach(callbackfn: (value: Highlight, key: string, parent: HighlightRegistry) => void, thisArg?: any): void; + forEach( + callbackfn: (value: Highlight, key: string, parent: HighlightRegistry) => void, + thisArg?: any + ): void; } declare var HighlightRegistry: { @@ -13526,7 +13810,11 @@ interface IDBDatabase extends EventTarget { close(): void; createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore; deleteObjectStore(name: string): void; - transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction; + transaction( + storeNames: string | string[], + mode?: IDBTransactionMode, + options?: IDBTransactionOptions + ): IDBTransaction; addEventListener( type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, @@ -13559,10 +13847,18 @@ interface IDBFactory { cmp(first: any, second: any): number; databases(): Promise; deleteDatabase(name: string): IDBOpenDBRequest; - deleteForPrincipal(principal: Principal, name: string, options?: IDBOpenDBOptions): IDBOpenDBRequest; + deleteForPrincipal( + principal: Principal, + name: string, + options?: IDBOpenDBOptions + ): IDBOpenDBRequest; open(name: string, version?: number): IDBOpenDBRequest; openForPrincipal(principal: Principal, name: string, version: number): IDBOpenDBRequest; - openForPrincipal(principal: Principal, name: string, options?: IDBOpenDBOptions): IDBOpenDBRequest; + openForPrincipal( + principal: Principal, + name: string, + options?: IDBOpenDBOptions + ): IDBOpenDBRequest; } declare var IDBFactory: { @@ -13621,7 +13917,11 @@ interface IDBObjectStore { add(value: any, key?: any): IDBRequest; clear(): IDBRequest; count(key?: any): IDBRequest; - createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex; + createIndex( + name: string, + keyPath: string | string[], + optionalParameters?: IDBIndexParameters + ): IDBIndex; delete(key: any): IDBRequest; deleteIndex(indexName: string): void; get(key: any): IDBRequest; @@ -13775,7 +14075,11 @@ declare var IDBVersionChangeEvent: { }; interface IIRFilterNode extends AudioNode, AudioNodePassThrough { - getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; + getFrequencyResponse( + frequencyHz: Float32Array, + magResponse: Float32Array, + phaseResponse: Float32Array + ): void; } declare var IIRFilterNode: { @@ -13885,7 +14189,10 @@ interface ImageCaptureErrorEvent extends Event { declare var ImageCaptureErrorEvent: { prototype: ImageCaptureErrorEvent; - new (type: string, imageCaptureErrorInitDict?: ImageCaptureErrorEventInit): ImageCaptureErrorEvent; + new ( + type: string, + imageCaptureErrorInitDict?: ImageCaptureErrorEventInit + ): ImageCaptureErrorEvent; isInstance: IsInstance; }; @@ -14074,7 +14381,10 @@ declare var InspectorFontFace: { interface InstallTriggerImpl { enabled(): boolean; - install(installs: Record, callback?: InstallTriggerCallback): boolean; + install( + installs: Record, + callback?: InstallTriggerCallback + ): boolean; installChrome(type: number, url: string, skin: string): boolean; startSoftwareUpdate(url: string, flags?: number): boolean; updateEnabled(): boolean; @@ -14106,7 +14416,10 @@ interface IntersectionObserver { declare var IntersectionObserver: { prototype: IntersectionObserver; - new (intersectionCallback: IntersectionCallback, options?: IntersectionObserverInit): IntersectionObserver; + new ( + intersectionCallback: IntersectionCallback, + options?: IntersectionObserverInit + ): IntersectionObserver; isInstance: IsInstance; }; @@ -14837,7 +15150,11 @@ interface KeyframeEffect extends AnimationEffect { declare var KeyframeEffect: { prototype: KeyframeEffect; - new (target: Element | null, keyframes: any, options?: number | KeyframeEffectOptions): KeyframeEffect; + new ( + target: Element | null, + keyframes: any, + options?: number | KeyframeEffectOptions + ): KeyframeEffect; new (source: KeyframeEffect): KeyframeEffect; isInstance: IsInstance; }; @@ -14944,7 +15261,12 @@ interface Localization { declare var Localization: { prototype: Localization; - new (aResourceIds: L10nResourceId[], aSync?: boolean, aRegistry?: L10nRegistry, aLocales?: string[]): Localization; + new ( + aResourceIds: L10nResourceId[], + aSync?: boolean, + aRegistry?: L10nRegistry, + aLocales?: string[] + ): Localization; isInstance: IsInstance; }; @@ -15081,7 +15403,10 @@ declare var MIDIInput: { /** Available only in secure contexts. */ interface MIDIInputMap { - forEach(callbackfn: (value: MIDIInput, key: string, parent: MIDIInputMap) => void, thisArg?: any): void; + forEach( + callbackfn: (value: MIDIInput, key: string, parent: MIDIInputMap) => void, + thisArg?: any + ): void; } declare var MIDIInputMap: { @@ -15135,7 +15460,10 @@ declare var MIDIOutput: { /** Available only in secure contexts. */ interface MIDIOutputMap { - forEach(callbackfn: (value: MIDIOutput, key: string, parent: MIDIOutputMap) => void, thisArg?: any): void; + forEach( + callbackfn: (value: MIDIOutput, key: string, parent: MIDIOutputMap) => void, + thisArg?: any + ): void; } declare var MIDIOutputMap: { @@ -15193,10 +15521,19 @@ interface MLS { deleteState(): Promise; generateCredential(credentialContent: MLSBytesOrUint8ArrayOrUTF8String): Promise; generateIdentity(): Promise; - generateKeyPackage(clientId: MLSBytesOrUint8Array, credential: MLSBytesOrUint8Array): Promise; + generateKeyPackage( + clientId: MLSBytesOrUint8Array, + credential: MLSBytesOrUint8Array + ): Promise; getGroupIdFromMessage(message: MLSBytesOrUint8Array): Promise; - groupCreate(clientId: MLSBytesOrUint8Array, credential: MLSBytesOrUint8Array): Promise; - groupGet(groupId: MLSBytesOrUint8Array, clientId: MLSBytesOrUint8Array): Promise; + groupCreate( + clientId: MLSBytesOrUint8Array, + credential: MLSBytesOrUint8Array + ): Promise; + groupGet( + groupId: MLSBytesOrUint8Array, + clientId: MLSBytesOrUint8Array + ): Promise; groupJoin(clientId: MLSBytesOrUint8Array, welcome: MLSBytesOrUint8Array): Promise; } @@ -15570,7 +15907,10 @@ interface MediaKeyStatusMap { readonly size: number; get(keyId: BufferSource): MediaKeyStatus | undefined; has(keyId: BufferSource): boolean; - forEach(callbackfn: (value: MediaKeyStatus, key: ArrayBuffer, parent: MediaKeyStatusMap) => void, thisArg?: any): void; + forEach( + callbackfn: (value: MediaKeyStatus, key: ArrayBuffer, parent: MediaKeyStatusMap) => void, + thisArg?: any + ): void; } declare var MediaKeyStatusMap: { @@ -15950,7 +16290,10 @@ interface MediaStreamTrackAudioSourceNode extends AudioNode, AudioNodePassThroug declare var MediaStreamTrackAudioSourceNode: { prototype: MediaStreamTrackAudioSourceNode; - new (context: AudioContext, options: MediaStreamTrackAudioSourceOptions): MediaStreamTrackAudioSourceNode; + new ( + context: AudioContext, + options: MediaStreamTrackAudioSourceOptions + ): MediaStreamTrackAudioSourceNode; isInstance: IsInstance; }; @@ -16034,7 +16377,11 @@ declare var MessageListenerManager: { }; interface MessageListenerManagerMixin { - addMessageListener(messageName: string, listener: MessageListener, listenWhenClosed?: boolean): void; + addMessageListener( + messageName: string, + listener: MessageListener, + listenWhenClosed?: boolean + ): void; addWeakMessageListener(messageName: string, listener: MessageListener): void; removeMessageListener(messageName: string, listener: MessageListener): void; removeWeakMessageListener(messageName: string, listener: MessageListener): void; @@ -16335,7 +16682,10 @@ declare var MozQueryInterface: { interface MozSharedMap extends EventTarget { get(name: string): StructuredClonable; has(name: string): boolean; - forEach(callbackfn: (value: StructuredClonable, key: string, parent: MozSharedMap) => void, thisArg?: any): void; + forEach( + callbackfn: (value: StructuredClonable, key: string, parent: MozSharedMap) => void, + thisArg?: any + ): void; } declare var MozSharedMap: { @@ -16577,7 +16927,10 @@ interface NavigationCurrentEntryChangeEvent extends Event { declare var NavigationCurrentEntryChangeEvent: { prototype: NavigationCurrentEntryChangeEvent; - new (type: string, eventInitDict: NavigationCurrentEntryChangeEventInit): NavigationCurrentEntryChangeEvent; + new ( + type: string, + eventInitDict: NavigationCurrentEntryChangeEventInit + ): NavigationCurrentEntryChangeEvent; isInstance: IsInstance; }; @@ -16946,7 +17299,10 @@ declare var NodeIterator: { interface NodeList { readonly length: number; item(index: number): Node | null; - forEach(callbackfn: (value: Node | null, key: number, parent: NodeList) => void, thisArg?: any): void; + forEach( + callbackfn: (value: Node | null, key: number, parent: NodeList) => void, + thisArg?: any + ): void; [index: number]: Node; } @@ -17017,7 +17373,9 @@ declare var Notification: { isInstance: IsInstance; readonly maxActions: number; readonly permission: NotificationPermission; - requestPermission(permissionCallback?: NotificationPermissionCallback): Promise; + requestPermission( + permissionCallback?: NotificationPermissionCallback + ): Promise; }; interface NotifyPaintEvent extends Event { @@ -17037,7 +17395,13 @@ declare var NotifyPaintEvent: { interface OES_draw_buffers_indexed { blendEquationSeparateiOES(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum): void; blendEquationiOES(buf: GLuint, mode: GLenum): void; - blendFuncSeparateiOES(buf: GLuint, srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void; + blendFuncSeparateiOES( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum + ): void; blendFunciOES(buf: GLuint, src: GLenum, dst: GLenum): void; colorMaskiOES(buf: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean): void; disableiOES(target: GLenum, index: GLuint): void; @@ -17143,7 +17507,10 @@ interface OffscreenCanvas extends EventTarget { oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null; width: number; convertToBlob(options?: ImageEncodeOptions): Promise; - getContext(contextId: OffscreenRenderingContextId, contextOptions?: any): OffscreenRenderingContext | null; + getContext( + contextId: OffscreenRenderingContextId, + contextOptions?: any + ): OffscreenRenderingContext | null; toBlob(type?: string, encoderOptions?: any): Promise; transferToImageBitmap(): ImageBitmap; addEventListener( @@ -17208,7 +17575,10 @@ interface OnErrorEventHandlerForNodes { onerror: ((this: OnErrorEventHandlerForNodes, ev: Event) => any) | null; addEventListener( type: K, - listener: (this: OnErrorEventHandlerForNodes, ev: OnErrorEventHandlerForNodesEventMap[K]) => any, + listener: ( + this: OnErrorEventHandlerForNodes, + ev: OnErrorEventHandlerForNodesEventMap[K] + ) => any, options?: boolean | AddEventListenerOptions ): void; addEventListener( @@ -17218,7 +17588,10 @@ interface OnErrorEventHandlerForNodes { ): void; removeEventListener( type: K, - listener: (this: OnErrorEventHandlerForNodes, ev: OnErrorEventHandlerForNodesEventMap[K]) => any, + listener: ( + this: OnErrorEventHandlerForNodes, + ev: OnErrorEventHandlerForNodesEventMap[K] + ) => any, options?: boolean | EventListenerOptions ): void; removeEventListener( @@ -17236,7 +17609,10 @@ interface OnErrorEventHandlerForWindow { onerror: ((this: OnErrorEventHandlerForWindow, ev: Event) => any) | null; addEventListener( type: K, - listener: (this: OnErrorEventHandlerForWindow, ev: OnErrorEventHandlerForWindowEventMap[K]) => any, + listener: ( + this: OnErrorEventHandlerForWindow, + ev: OnErrorEventHandlerForWindowEventMap[K] + ) => any, options?: boolean | AddEventListenerOptions ): void; addEventListener( @@ -17246,7 +17622,10 @@ interface OnErrorEventHandlerForWindow { ): void; removeEventListener( type: K, - listener: (this: OnErrorEventHandlerForWindow, ev: OnErrorEventHandlerForWindowEventMap[K]) => any, + listener: ( + this: OnErrorEventHandlerForWindow, + ev: OnErrorEventHandlerForWindowEventMap[K] + ) => any, options?: boolean | EventListenerOptions ): void; removeEventListener( @@ -17355,17 +17734,33 @@ interface ParentNode { readonly lastElementChild: Element | null; append(...nodes: (Node | string)[]): void; getElementsByAttribute(name: string, value: string | null): HTMLCollection; - getElementsByAttributeNS(namespaceURI: string | null, name: string, value: string | null): HTMLCollection; + getElementsByAttributeNS( + namespaceURI: string | null, + name: string, + value: string | null + ): HTMLCollection; prepend(...nodes: (Node | string)[]): void; - querySelector(selectors: K): HTMLElementTagNameMap[K] | null; + querySelector( + selectors: K + ): HTMLElementTagNameMap[K] | null; querySelector(selectors: K): SVGElementTagNameMap[K] | null; - querySelector(selectors: K): MathMLElementTagNameMap[K] | null; + querySelector( + selectors: K + ): MathMLElementTagNameMap[K] | null; /** @deprecated */ - querySelector(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null; + querySelector( + selectors: K + ): HTMLElementDeprecatedTagNameMap[K] | null; querySelector(selectors: string): E | null; - querySelectorAll(selectors: K): NodeListOf; - querySelectorAll(selectors: K): NodeListOf; - querySelectorAll(selectors: K): NodeListOf; + querySelectorAll( + selectors: K + ): NodeListOf; + querySelectorAll( + selectors: K + ): NodeListOf; + querySelectorAll( + selectors: K + ): NodeListOf; /** @deprecated */ querySelectorAll( selectors: K @@ -17374,7 +17769,10 @@ interface ParentNode { replaceChildren(...nodes: (Node | string)[]): void; } -interface ParentProcessMessageManager extends MessageBroadcaster, GlobalProcessScriptLoader, ProcessScriptLoader {} +interface ParentProcessMessageManager + extends MessageBroadcaster, + GlobalProcessScriptLoader, + ProcessScriptLoader {} declare var ParentProcessMessageManager: { prototype: ParentProcessMessageManager; @@ -17447,7 +17845,9 @@ interface PaymentRequest extends EventTarget { readonly shippingType: PaymentShippingType | null; abort(): Promise; canMakePayment(): Promise; - show(detailsPromise?: PaymentDetailsUpdate | PromiseLike): Promise; + show( + detailsPromise?: PaymentDetailsUpdate | PromiseLike + ): Promise; addEventListener( type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, @@ -17472,7 +17872,11 @@ interface PaymentRequest extends EventTarget { declare var PaymentRequest: { prototype: PaymentRequest; - new (methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest; + new ( + methodData: PaymentMethodData[], + details: PaymentDetailsInit, + options?: PaymentOptions + ): PaymentRequest; isInstance: IsInstance; }; @@ -18094,7 +18498,10 @@ declare var PlacesEvent: { }; interface PlacesEventCounts { - forEach(callbackfn: (value: number, key: string, parent: PlacesEventCounts) => void, thisArg?: any): void; + forEach( + callbackfn: (value: number, key: string, parent: PlacesEventCounts) => void, + thisArg?: any + ): void; } declare var PlacesEventCounts: { @@ -18411,8 +18818,12 @@ declare var PublicKeyCredential: { getClientCapabilities(): Promise; isConditionalMediationAvailable(): Promise; isUserVerifyingPlatformAuthenticatorAvailable(): Promise; - parseCreationOptionsFromJSON(options: PublicKeyCredentialCreationOptionsJSON): PublicKeyCredentialCreationOptions; - parseRequestOptionsFromJSON(options: PublicKeyCredentialRequestOptionsJSON): PublicKeyCredentialRequestOptions; + parseCreationOptionsFromJSON( + options: PublicKeyCredentialCreationOptionsJSON + ): PublicKeyCredentialCreationOptions; + parseRequestOptionsFromJSON( + options: PublicKeyCredentialRequestOptionsJSON + ): PublicKeyCredentialRequestOptions; }; interface PushManager { @@ -18772,9 +19183,15 @@ interface RTCPeerConnection extends EventTarget { ): Promise; addStream(stream: MediaStream): void; addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender; - addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver; + addTransceiver( + trackOrKind: MediaStreamTrack | string, + init?: RTCRtpTransceiverInit + ): RTCRtpTransceiver; close(): void; - createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback): Promise; + createAnswer( + successCallback: RTCSessionDescriptionCallback, + failureCallback: RTCPeerConnectionErrorCallback + ): Promise; createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel; createOffer( successCallback: RTCSessionDescriptionCallback, @@ -18981,7 +19398,10 @@ declare var RTCSessionDescription: { }; interface RTCStatsReport { - forEach(callbackfn: (value: any, key: string, parent: RTCStatsReport) => void, thisArg?: any): void; + forEach( + callbackfn: (value: any, key: string, parent: RTCStatsReport) => void, + thisArg?: any + ): void; } declare var RTCStatsReport: { @@ -19090,7 +19510,10 @@ declare var ReadableStream: { }; interface ReadableStreamBYOBReader extends ReadableStreamGenericReader { - read(view: ArrayBufferView, options?: ReadableStreamBYOBReaderReadOptions): Promise; + read( + view: ArrayBufferView, + options?: ReadableStreamBYOBReaderReadOptions + ): Promise; releaseLock(): void; } @@ -19254,7 +19677,10 @@ interface Response extends Body { declare var Response: { prototype: Response; - new (body?: Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string | null, init?: ResponseInit): Response; + new ( + body?: Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string | null, + init?: ResponseInit + ): Response; isInstance: IsInstance; error(): Response; json(data: any, init?: ResponseInit): Response; @@ -20433,7 +20859,10 @@ declare var SVGFEGaussianBlurElement: { isInstance: IsInstance; }; -interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { +interface SVGFEImageElement + extends SVGElement, + SVGFilterPrimitiveStandardAttributes, + SVGURIReference { crossOrigin: string | null; readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; addEventListener( @@ -22483,7 +22912,10 @@ interface SecurityPolicyViolationEvent extends Event { declare var SecurityPolicyViolationEvent: { prototype: SecurityPolicyViolationEvent; - new (type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent; + new ( + type: string, + eventInitDict?: SecurityPolicyViolationEventInit + ): SecurityPolicyViolationEvent; isInstance: IsInstance; }; @@ -22501,7 +22933,13 @@ interface Selection { readonly rangeCount: number; readonly selectionType: number; readonly type: string; - GetRangesForInterval(beginNode: Node, beginOffset: number, endNode: Node, endOffset: number, allowAdjacent: boolean): Range[]; + GetRangesForInterval( + beginNode: Node, + beginOffset: number, + endNode: Node, + endOffset: number, + allowAdjacent: boolean + ): Range[]; addRange(range: Range): void; addSelectionListener(newListener: nsISelectionListener): void; collapse(node: Node | null, offset?: number): void; @@ -22519,8 +22957,18 @@ interface Selection { removeSelectionListener(listenerToRemove: nsISelectionListener): void; resetColors(): void; selectAllChildren(node: Node): void; - setBaseAndExtent(anchorNode: Node, anchorOffset: number, focusNode: Node, focusOffset: number): void; - setColors(aForegroundColor: string, aBackgroundColor: string, aAltForegroundColor: string, aAltBackgroundColor: string): void; + setBaseAndExtent( + anchorNode: Node, + anchorOffset: number, + focusNode: Node, + focusOffset: number + ): void; + setColors( + aForegroundColor: string, + aBackgroundColor: string, + aAltForegroundColor: string, + aAltBackgroundColor: string + ): void; setPosition(node: Node | null, offset?: number): void; toStringWithFormat(formatType: string, flags: number, wrapColumn: number): string; toString(): string; @@ -22584,7 +23032,10 @@ interface ServiceWorkerContainer extends EventTarget { readonly ready: Promise; getRegistration(documentURL?: string | URL): Promise; getRegistrations(): Promise; - register(scriptURL: TrustedScriptURL | string, options?: RegistrationOptions): Promise; + register( + scriptURL: TrustedScriptURL | string, + options?: RegistrationOptions + ): Promise; startMessages(): void; addEventListener( type: K, @@ -23378,7 +23829,10 @@ interface StyleSheetApplicableStateChangeEvent extends Event { declare var StyleSheetApplicableStateChangeEvent: { prototype: StyleSheetApplicableStateChangeEvent; - new (type: string, eventInitDict?: StyleSheetApplicableStateChangeEventInit): StyleSheetApplicableStateChangeEvent; + new ( + type: string, + eventInitDict?: StyleSheetApplicableStateChangeEventInit + ): StyleSheetApplicableStateChangeEvent; isInstance: IsInstance; }; @@ -23417,7 +23871,11 @@ declare var SubmitEvent: { /** Available only in secure contexts. */ interface SubtleCrypto { decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise; - deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length?: number | null): Promise; + deriveBits( + algorithm: AlgorithmIdentifier, + baseKey: CryptoKey, + length?: number | null + ): Promise; deriveKey( algorithm: AlgorithmIdentifier, baseKey: CryptoKey, @@ -23428,7 +23886,11 @@ interface SubtleCrypto { digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): Promise; exportKey(format: KeyFormat, key: CryptoKey): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; + generateKey( + algorithm: AlgorithmIdentifier, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; importKey( format: KeyFormat, keyData: any, @@ -23446,8 +23908,18 @@ interface SubtleCrypto { extractable: boolean, keyUsages: KeyUsage[] ): Promise; - verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; - wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): Promise; + verify( + algorithm: AlgorithmIdentifier, + key: CryptoKey, + signature: BufferSource, + data: BufferSource + ): Promise; + wrapKey( + format: KeyFormat, + key: CryptoKey, + wrappingKey: CryptoKey, + wrapAlgorithm: AlgorithmIdentifier + ): Promise; } declare var SubtleCrypto: { @@ -23610,7 +24082,10 @@ interface TaskPriorityChangeEvent extends Event { declare var TaskPriorityChangeEvent: { prototype: TaskPriorityChangeEvent; - new (type: string, priorityChangeEventInitDict: TaskPriorityChangeEventInit): TaskPriorityChangeEvent; + new ( + type: string, + priorityChangeEventInitDict: TaskPriorityChangeEventInit + ): TaskPriorityChangeEvent; isInstance: IsInstance; }; @@ -23734,7 +24209,10 @@ declare var TestInterfaceAsyncIterableSingleWithArgs: { }; interface TestInterfaceIterableDouble { - forEach(callbackfn: (value: string, key: string, parent: TestInterfaceIterableDouble) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: TestInterfaceIterableDouble) => void, + thisArg?: any + ): void; } declare var TestInterfaceIterableDouble: { @@ -23745,7 +24223,11 @@ declare var TestInterfaceIterableDouble: { interface TestInterfaceIterableDoubleUnion { forEach( - callbackfn: (value: string | number, key: string, parent: TestInterfaceIterableDoubleUnion) => void, + callbackfn: ( + value: string | number, + key: string, + parent: TestInterfaceIterableDoubleUnion + ) => void, thisArg?: any ): void; } @@ -23758,7 +24240,10 @@ declare var TestInterfaceIterableDoubleUnion: { interface TestInterfaceIterableSingle { readonly length: number; - forEach(callbackfn: (value: number, key: number, parent: TestInterfaceIterableSingle) => void, thisArg?: any): void; + forEach( + callbackfn: (value: number, key: number, parent: TestInterfaceIterableSingle) => void, + thisArg?: any + ): void; [index: number]: number; } @@ -23787,7 +24272,9 @@ interface TestInterfaceJS extends EventTarget { pingPongAny(arg: any): any; pingPongDictionary(dict?: TestInterfaceJSDictionary): TestInterfaceJSDictionary; pingPongDictionaryOrLong(dictOrLong?: TestInterfaceJSUnionableDictionary | number): number; - pingPongNullableUnion(something: TestInterfaceJS | number | null): TestInterfaceJS | number | null; + pingPongNullableUnion( + something: TestInterfaceJS | number | null + ): TestInterfaceJS | number | null; pingPongObject(obj: any): any; pingPongObjectOrString(objOrString: any): any; pingPongRecord(rec: Record): string; @@ -23855,7 +24342,10 @@ interface TestInterfaceMaplike { getInternal(aKey: string): number; hasInternal(aKey: string): boolean; setInternal(aKey: string, aValue: number): void; - forEach(callbackfn: (value: number, key: string, parent: TestInterfaceMaplike) => void, thisArg?: any): void; + forEach( + callbackfn: (value: number, key: string, parent: TestInterfaceMaplike) => void, + thisArg?: any + ): void; } declare var TestInterfaceMaplike: { @@ -23870,7 +24360,10 @@ interface TestInterfaceMaplikeJSObject { getInternal(aKey: string): any; hasInternal(aKey: string): boolean; setInternal(aKey: string, aObject: any): void; - forEach(callbackfn: (value: any, key: string, parent: TestInterfaceMaplikeJSObject) => void, thisArg?: any): void; + forEach( + callbackfn: (value: any, key: string, parent: TestInterfaceMaplikeJSObject) => void, + thisArg?: any + ): void; } declare var TestInterfaceMaplikeJSObject: { @@ -23886,7 +24379,11 @@ interface TestInterfaceMaplikeObject { hasInternal(aKey: string): boolean; setInternal(aKey: string): void; forEach( - callbackfn: (value: TestInterfaceMaplike, key: string, parent: TestInterfaceMaplikeObject) => void, + callbackfn: ( + value: TestInterfaceMaplike, + key: string, + parent: TestInterfaceMaplikeObject + ) => void, thisArg?: any ): void; } @@ -23925,7 +24422,10 @@ declare var TestInterfaceObservableArray: { }; interface TestInterfaceSetlike { - forEach(callbackfn: (value: string, key: string, parent: TestInterfaceSetlike) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: TestInterfaceSetlike) => void, + thisArg?: any + ): void; } declare var TestInterfaceSetlike: { @@ -23935,7 +24435,10 @@ declare var TestInterfaceSetlike: { }; interface TestInterfaceSetlikeNode { - forEach(callbackfn: (value: Node, key: Node, parent: TestInterfaceSetlikeNode) => void, thisArg?: any): void; + forEach( + callbackfn: (value: Node, key: Node, parent: TestInterfaceSetlikeNode) => void, + thisArg?: any + ): void; } declare var TestInterfaceSetlikeNode: { @@ -24049,7 +24552,13 @@ declare var TextEncoderStream: { interface TextEvent extends UIEvent { readonly data: string; - initTextEvent(type: string, bubbles?: boolean, cancelable?: boolean, view?: Window | null, data?: string): void; + initTextEvent( + type: string, + bubbles?: boolean, + cancelable?: boolean, + view?: Window | null, + data?: string + ): void; } declare var TextEvent: { @@ -24368,7 +24877,11 @@ interface TransformStream { declare var TransformStream: { prototype: TransformStream; - new (transformer?: any, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; + new ( + transformer?: any, + writableStrategy?: QueuingStrategy, + readableStrategy?: QueuingStrategy + ): TransformStream; isInstance: IsInstance; }; @@ -24563,7 +25076,12 @@ interface TrustedTypePolicyFactory { readonly emptyHTML: TrustedHTML; readonly emptyScript: TrustedScript; createPolicy(policyName: string, policyOptions?: TrustedTypePolicyOptions): TrustedTypePolicy; - getAttributeType(tagName: string, attribute: string, elementNs?: string | null, attrNs?: string | null): string | null; + getAttributeType( + tagName: string, + attribute: string, + elementNs?: string | null, + attrNs?: string | null + ): string | null; getPropertyType(tagName: string, property: string, elementNs?: string | null): string | null; isHTML(value: any): boolean; isScript(value: any): boolean; @@ -24606,7 +25124,11 @@ interface UDPSocket extends EventTarget { close(): Promise; joinMulticastGroup(multicastGroupAddress: string): void; leaveMulticastGroup(multicastGroupAddress: string): void; - send(data: string | Blob | ArrayBuffer | ArrayBufferView, remoteAddress?: string | null, remotePort?: number | null): boolean; + send( + data: string | Blob | ArrayBuffer | ArrayBufferView, + remoteAddress?: string | null, + remotePort?: number | null + ): boolean; addEventListener( type: K, listener: (this: UDPSocket, ev: UDPSocketEventMap[K]) => any, @@ -24643,7 +25165,13 @@ interface UIEvent extends Event { readonly rangeParent: Node | null; readonly view: WindowProxy | null; readonly which: number; - initUIEvent(aType: string, aCanBubble?: boolean, aCancelable?: boolean, aView?: Window | null, aDetail?: number): void; + initUIEvent( + aType: string, + aCanBubble?: boolean, + aCancelable?: boolean, + aView?: Window | null, + aDetail?: number + ): void; readonly SCROLL_PAGE_UP: -32768; readonly SCROLL_PAGE_DOWN: 32768; } @@ -24699,7 +25227,10 @@ interface URLSearchParams { set(name: string, value: string): void; sort(): void; toString(): string; - forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: URLSearchParams) => void, + thisArg?: any + ): void; } declare var URLSearchParams: { @@ -24881,7 +25412,13 @@ interface VRMockDisplay { capStageParameters: boolean; create(): void; setConnected(connected: boolean): void; - setEyeFOV(eye: VREye, upDegree: number, rightDegree: number, downDegree: number, leftDegree: number): void; + setEyeFOV( + eye: VREye, + upDegree: number, + rightDegree: number, + downDegree: number, + leftDegree: number + ): void; setEyeOffset(eye: VREye, offsetX: number, offsetY: number, offsetZ: number): void; setEyeResolution(renderWidth: number, renderHeight: number): void; setMounted(mounted: boolean): void; @@ -25156,7 +25693,10 @@ interface VideoFrame { allocationSize(options?: VideoFrameCopyToOptions): number; clone(): VideoFrame; close(): void; - copyTo(destination: ArrayBufferView | ArrayBuffer, options?: VideoFrameCopyToOptions): Promise; + copyTo( + destination: ArrayBufferView | ArrayBuffer, + options?: VideoFrameCopyToOptions + ): Promise; } declare var VideoFrame: { @@ -25443,7 +25983,10 @@ interface WEBGL_provoking_vertex { /** Available only in secure contexts. */ interface WGSLLanguageFeatures { - forEach(callbackfn: (value: string, key: string, parent: WGSLLanguageFeatures) => void, thisArg?: any): void; + forEach( + callbackfn: (value: string, key: string, parent: WGSLLanguageFeatures) => void, + thisArg?: any + ): void; } declare var WGSLLanguageFeatures: { @@ -25513,7 +26056,10 @@ declare var WaveShaperNode: { }; interface WebBrowserPersistable { - startPersistence(aContext: BrowsingContext | null, aRecv: nsIWebBrowserPersistDocumentReceiver): void; + startPersistence( + aContext: BrowsingContext | null, + aRecv: nsIWebBrowserPersistDocumentReceiver + ): void; } interface WebExtensionContentScript extends MozDocumentMatcher { @@ -25526,7 +26072,10 @@ interface WebExtensionContentScript extends MozDocumentMatcher { declare var WebExtensionContentScript: { prototype: WebExtensionContentScript; - new (extension: WebExtensionPolicy, options: WebExtensionContentScriptInit): WebExtensionContentScript; + new ( + extension: WebExtensionPolicy, + options: WebExtensionContentScriptInit + ): WebExtensionContentScript; isInstance: IsInstance; }; @@ -25549,7 +26098,12 @@ interface WebExtensionPolicy { readonly readyPromise: any; readonly temporarilyInstalled: boolean; readonly type: string; - canAccessURI(uri: URI, explicit?: boolean, checkRestricted?: boolean, allowFilePermission?: boolean): boolean; + canAccessURI( + uri: URI, + explicit?: boolean, + checkRestricted?: boolean, + allowFilePermission?: boolean + ): boolean; canAccessWindow(window: WindowProxy): boolean; getURL(path?: string): string; hasPermission(permission: string): boolean; @@ -26150,7 +26704,13 @@ interface WebGL2RenderingContextBase { beginQuery(target: GLenum, query: WebGLQuery): void; beginTransformFeedback(primitiveMode: GLenum): void; bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer | null): void; - bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer | null, offset: GLintptr, size: GLsizeiptr): void; + bindBufferRange( + target: GLenum, + index: GLuint, + buffer: WebGLBuffer | null, + offset: GLintptr, + size: GLsizeiptr + ): void; bindSampler(unit: GLuint, sampler: WebGLSampler | null): void; bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback | null): void; bindVertexArray(array: WebGLVertexArrayObject | null): void; @@ -26169,10 +26729,22 @@ interface WebGL2RenderingContextBase { bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void; bufferData(target: GLenum, srcData: ArrayBuffer | null, usage: GLenum): void; bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum): void; - bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint): void; + bufferData( + target: GLenum, + srcData: ArrayBufferView, + usage: GLenum, + srcOffset: GLuint, + length?: GLuint + ): void; bufferSubData(target: GLenum, offset: GLintptr, srcData: ArrayBuffer): void; bufferSubData(target: GLenum, offset: GLintptr, srcData: ArrayBufferView): void; - bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint): void; + bufferSubData( + target: GLenum, + dstByteOffset: GLintptr, + srcData: ArrayBufferView, + srcOffset: GLuint, + length?: GLuint + ): void; clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint): void; clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint): void; clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint): void; @@ -26301,14 +26873,37 @@ interface WebGL2RenderingContextBase { deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void; drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void; drawBuffers(buffers: GLenum[]): void; - drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void; - drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr): void; + drawElementsInstanced( + mode: GLenum, + count: GLsizei, + type: GLenum, + offset: GLintptr, + instanceCount: GLsizei + ): void; + drawRangeElements( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type: GLenum, + offset: GLintptr + ): void; endQuery(target: GLenum): void; endTransformFeedback(): void; fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync | null; - framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture | null, level: GLint, layer: GLint): void; + framebufferTextureLayer( + target: GLenum, + attachment: GLenum, + texture: WebGLTexture | null, + level: GLint, + layer: GLint + ): void; getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): string | null; - getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): any; + getActiveUniformBlockParameter( + program: WebGLProgram, + uniformBlockIndex: GLuint, + pname: GLenum + ): any; getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum): any; getBufferSubData( target: GLenum, @@ -26328,7 +26923,14 @@ interface WebGL2RenderingContextBase { getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string): GLuint; getUniformIndices(program: WebGLProgram, uniformNames: string[]): GLuint[] | null; invalidateFramebuffer(target: GLenum, attachments: GLenum[]): void; - invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; + invalidateSubFramebuffer( + target: GLenum, + attachments: GLenum[], + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei + ): void; isQuery(query: WebGLQuery | null): GLboolean; isSampler(sampler: WebGLSampler | null): GLboolean; isSync(sync: WebGLSync | null): GLboolean; @@ -26345,7 +26947,15 @@ interface WebGL2RenderingContextBase { type: GLenum, dstData: ArrayBufferView | null ): void; - readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr): void; + readPixels( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type: GLenum, + offset: GLintptr + ): void; readPixels( x: GLint, y: GLint, @@ -26385,12 +26995,54 @@ interface WebGL2RenderingContextBase { type: GLenum, source: HTMLCanvasElement ): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLImageElement): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageBitmap): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageData): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: VideoFrame): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: HTMLImageElement + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: HTMLVideoElement + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: ImageBitmap + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: ImageData + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: OffscreenCanvas + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + source: VideoFrame + ): void; texImage2D( target: GLenum, level: GLint, @@ -26612,8 +27264,21 @@ interface WebGL2RenderingContextBase { srcData: ArrayBufferView, srcOffset: GLuint ): void; - texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void; - texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei): void; + texStorage2D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei + ): void; + texStorage3D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei + ): void; texSubImage2D( target: GLenum, level: GLint, @@ -26907,23 +27572,93 @@ interface WebGL2RenderingContextBase { srcOffset?: GLuint ): void; transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum): void; - uniform1fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform1iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void; + uniform1fv( + location: WebGLUniformLocation | null, + data: Float32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform1iv( + location: WebGLUniformLocation | null, + data: Int32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; uniform1ui(location: WebGLUniformLocation | null, v0: GLuint): void; - uniform1uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void; + uniform1uiv( + location: WebGLUniformLocation | null, + data: Uint32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform2fv( + location: WebGLUniformLocation | null, + data: Float32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform2iv( + location: WebGLUniformLocation | null, + data: Int32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; uniform2ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint): void; - uniform2uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void; + uniform2uiv( + location: WebGLUniformLocation | null, + data: Uint32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform3fv( + location: WebGLUniformLocation | null, + data: Float32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform3iv( + location: WebGLUniformLocation | null, + data: Int32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; uniform3ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint): void; - uniform3uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4fv(location: WebGLUniformLocation | null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4iv(location: WebGLUniformLocation | null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4ui(location: WebGLUniformLocation | null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint): void; - uniform4uiv(location: WebGLUniformLocation | null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint): void; + uniform3uiv( + location: WebGLUniformLocation | null, + data: Uint32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4fv( + location: WebGLUniformLocation | null, + data: Float32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4iv( + location: WebGLUniformLocation | null, + data: Int32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4ui( + location: WebGLUniformLocation | null, + v0: GLuint, + v1: GLuint, + v2: GLuint, + v3: GLuint + ): void; + uniform4uiv( + location: WebGLUniformLocation | null, + data: Uint32List, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniformBlockBinding( + program: WebGLProgram, + uniformBlockIndex: GLuint, + uniformBlockBinding: GLuint + ): void; uniformMatrix2fv( location: WebGLUniformLocation | null, transpose: GLboolean, @@ -26992,7 +27727,13 @@ interface WebGL2RenderingContextBase { vertexAttribI4iv(index: GLuint, values: Int32List): void; vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint): void; vertexAttribI4uiv(index: GLuint, values: Uint32List): void; - vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr): void; + vertexAttribIPointer( + index: GLuint, + size: GLint, + type: GLenum, + stride: GLsizei, + offset: GLintptr + ): void; waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64): void; readonly READ_BUFFER: 0x0c02; readonly UNPACK_ROW_LENGTH: 0x0cf2; @@ -27366,9 +28107,30 @@ interface WebGLRenderingContext extends WebGLRenderingContextBase { type: GLenum, pixels: ArrayBufferView | null ): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, pixels: ImageBitmap): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, pixels: ImageData): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, image: HTMLImageElement): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + pixels: ImageBitmap + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + pixels: ImageData + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + image: HTMLImageElement + ): void; texImage2D( target: GLenum, level: GLint, @@ -27377,9 +28139,30 @@ interface WebGLRenderingContext extends WebGLRenderingContextBase { type: GLenum, canvas: HTMLCanvasElement ): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, video: HTMLVideoElement): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, canvas: OffscreenCanvas): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, videoFrame: VideoFrame): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + video: HTMLVideoElement + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + canvas: OffscreenCanvas + ): void; + texImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + format: GLenum, + type: GLenum, + videoFrame: VideoFrame + ): void; texSubImage2D( target: GLenum, level: GLint, @@ -27462,9 +28245,21 @@ interface WebGLRenderingContext extends WebGLRenderingContextBase { uniform3iv(location: WebGLUniformLocation | null, data: Int32List): void; uniform4fv(location: WebGLUniformLocation | null, data: Float32List): void; uniform4iv(location: WebGLUniformLocation | null, data: Int32List): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Float32List): void; + uniformMatrix2fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Float32List + ): void; + uniformMatrix3fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Float32List + ): void; + uniformMatrix4fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Float32List + ): void; } declare var WebGLRenderingContext: { @@ -27845,7 +28640,13 @@ interface WebGLRenderingContextBase { renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null ): void; - framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void; + framebufferTexture2D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: WebGLTexture | null, + level: GLint + ): void; frontFace(mode: GLenum): void; generateMipmap(target: GLenum): void; getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null; @@ -27863,7 +28664,10 @@ interface WebGLRenderingContextBase { getRenderbufferParameter(target: GLenum, pname: GLenum): any; getShaderInfoLog(shader: WebGLShader): string | null; getShaderParameter(shader: WebGLShader, pname: GLenum): any; - getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null; + getShaderPrecisionFormat( + shadertype: GLenum, + precisiontype: GLenum + ): WebGLShaderPrecisionFormat | null; getShaderSource(shader: WebGLShader): string | null; getSupportedExtensions(): string[] | null; getTexParameter(target: GLenum, pname: GLenum): any; @@ -27885,7 +28689,12 @@ interface WebGLRenderingContextBase { makeXRCompatible(): Promise; pixelStorei(pname: GLenum, param: GLint): void; polygonOffset(factor: GLfloat, units: GLfloat): void; - renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void; + renderbufferStorage( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei + ): void; sampleCoverage(value: GLclampf, invert: GLboolean): void; scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; shaderSource(shader: WebGLShader, source: string): void; @@ -27903,7 +28712,13 @@ interface WebGLRenderingContextBase { uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void; uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void; uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void; - uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void; + uniform4f( + location: WebGLUniformLocation | null, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat + ): void; uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram): void; @@ -27915,7 +28730,14 @@ interface WebGLRenderingContextBase { vertexAttrib3fv(indx: GLuint, values: Float32List): void; vertexAttrib4f(indx: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void; vertexAttrib4fv(indx: GLuint, values: Float32List): void; - vertexAttribPointer(indx: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void; + vertexAttribPointer( + indx: GLuint, + size: GLint, + type: GLenum, + normalized: GLboolean, + stride: GLsizei, + offset: GLintptr + ): void; viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; readonly DEPTH_BUFFER_BIT: 0x00000100; readonly STENCIL_BUFFER_BIT: 0x00000400; @@ -28358,7 +29180,9 @@ interface WebTransport { readonly ready: Promise; readonly reliability: WebTransportReliabilityMode; close(closeInfo?: WebTransportCloseInfo): void; - createBidirectionalStream(options?: WebTransportSendStreamOptions): Promise; + createBidirectionalStream( + options?: WebTransportSendStreamOptions + ): Promise; createUnidirectionalStream(options?: WebTransportSendStreamOptions): Promise; getStats(): Promise; } @@ -28608,7 +29432,12 @@ interface Window mozScrollSnap(): void; notifyDefaultButtonLoaded(defaultButton: Element): void; open(url?: string | URL, target?: string, features?: string): WindowProxy | null; - openDialog(url?: string, name?: string, options?: string, ...extraArguments: any[]): WindowProxy | null; + openDialog( + url?: string, + name?: string, + options?: string, + ...extraArguments: any[] + ): WindowProxy | null; postMessage(message: any, targetOrigin: string, transfer?: any[]): void; postMessage(message: any, options?: WindowPostMessageOptions): void; print(): void; @@ -29024,7 +29853,13 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { getInterface(iid: any): any; getResponseHeader(header: string): string | null; open(method: string, url: string): void; - open(method: string, url: string, async: boolean, user?: string | null, password?: string | null): void; + open( + method: string, + url: string, + async: boolean, + user?: string | null, + password?: string | null + ): void; overrideMimeType(mime: string): void; send(body?: Document | XMLHttpRequestBodyInit | null): void; sendInputStream(body: InputStream): void; @@ -29166,7 +30001,13 @@ declare var XPathEvaluator: { interface XPathEvaluatorMixin { createExpression(expression: string, resolver?: XPathNSResolver | null): XPathExpression; createNSResolver(nodeResolver: Node): Node; - evaluate(expression: string, contextNode: Node, resolver?: XPathNSResolver | null, type?: number, result?: any): XPathResult; + evaluate( + expression: string, + contextNode: Node, + resolver?: XPathNSResolver | null, + type?: number, + result?: any + ): XPathResult; } interface XPathExpression { @@ -29287,7 +30128,10 @@ declare var XRInputSource: { /** Available only in secure contexts. */ interface XRInputSourceArray { readonly length: number; - forEach(callbackfn: (value: XRInputSource, key: number, parent: XRInputSourceArray) => void, thisArg?: any): void; + forEach( + callbackfn: (value: XRInputSource, key: number, parent: XRInputSourceArray) => void, + thisArg?: any + ): void; [index: number]: XRInputSource; } @@ -29579,7 +30423,11 @@ interface XRWebGLLayer { declare var XRWebGLLayer: { prototype: XRWebGLLayer; - new (session: XRSession, context: XRWebGLRenderingContext, layerInit?: XRWebGLLayerInit): XRWebGLLayer; + new ( + session: XRSession, + context: XRWebGLRenderingContext, + layerInit?: XRWebGLLayerInit + ): XRWebGLLayer; isInstance: IsInstance; getNativeFramebufferScaleFactor(session: XRSession): number; }; @@ -29767,7 +30615,13 @@ interface XULPopupElement extends XULElement { getOuterScreenRect(): DOMRect; hidePopup(cancel?: boolean): void; moveTo(left: number, top: number): void; - moveToAnchor(anchorElement?: Element | null, position?: string, x?: number, y?: number, attributesOverride?: boolean): void; + moveToAnchor( + anchorElement?: Element | null, + position?: string, + x?: number, + y?: number, + attributesOverride?: boolean + ): void; openPopup( anchorElement?: Element | null, options?: StringOrOpenPopupOptions, @@ -29777,7 +30631,12 @@ interface XULPopupElement extends XULElement { attributesOverride?: boolean, triggerEvent?: Event | null ): void; - openPopupAtScreen(x?: number, y?: number, isContextMenu?: boolean, triggerEvent?: Event | null): void; + openPopupAtScreen( + x?: number, + y?: number, + isContextMenu?: boolean, + triggerEvent?: Event | null + ): void; openPopupAtScreenRect( position?: string, x?: number, @@ -29955,27 +30814,43 @@ declare namespace ChromeUtils { var domProcessChild: nsIDOMProcessChild | null; var recentJSDevError: any; function CreateOriginAttributesFromOriginSuffix(suffix: string): OriginAttributesDictionary; - function addProfilerMarker(name: string, options?: ProfilerMarkerOptions | DOMHighResTimeStamp, text?: string): void; + function addProfilerMarker( + name: string, + options?: ProfilerMarkerOptions | DOMHighResTimeStamp, + text?: string + ): void; function base64URLDecode(string: string, options: Base64URLDecodeOptions): ArrayBuffer; function base64URLEncode(source: BufferSource, options: Base64URLEncodeOptions): string; function clearMessagingLayerSecurityState(): void; function clearMessagingLayerSecurityStateByPrincipal(principal: Principal): void; - function clearMessagingLayerSecurityStateBySite(schemelessSite: string, pattern?: OriginAttributesPatternDictionary): void; + function clearMessagingLayerSecurityStateBySite( + schemelessSite: string, + pattern?: OriginAttributesPatternDictionary + ): void; function clearRecentJSDevError(): void; function clearResourceCache(options?: ClearResourceCacheOptions): void; function collectPerfStats(): Promise; function collectScrollingData(): Promise; - function compileScript(url: string, options?: CompileScriptOptionsDictionary): Promise; + function compileScript( + url: string, + options?: CompileScriptOptionsDictionary + ): Promise; function consumeInteractionData(): Record; function createError(message: string, stack?: any): any; function createOriginAttributesFromOrigin(origin: string): OriginAttributesDictionary; function dateNow(): number; - function defineESModuleGetters(aTarget: any, aModules: any, aOptions?: ImportESModuleOptionsDictionary): void; + function defineESModuleGetters( + aTarget: any, + aModules: any, + aOptions?: ImportESModuleOptionsDictionary + ): void; function defineLazyGetter(aTarget: any, aName: any, aLambda: any): void; function endWheelTransaction(): void; function ensureHeadlessContentProcess(aRemoteType: string): Promise; function ensureJSOracleStarted(): void; - function fillNonDefaultOriginAttributes(originAttrs?: OriginAttributesDictionary): OriginAttributesDictionary; + function fillNonDefaultOriginAttributes( + originAttrs?: OriginAttributesDictionary + ): OriginAttributesDictionary; function generateQI(interfaces: any[]): MozQueryInterface; function getAllDOMProcesses(): nsIDOMProcessParent[]; function getAllPossibleUtilityActorNames(): string[]; @@ -29986,7 +30861,11 @@ declare namespace ChromeUtils { function getGMPContentDecryptionModuleInformation(): Promise; function getLibcConstants(): LibcConstants; function getObjectNodeId(obj: any): NodeId; - function getPartitionKeyFromURL(topLevelUrl: string, subresourceUrl: string, foreignContext?: boolean): string; + function getPartitionKeyFromURL( + topLevelUrl: string, + subresourceUrl: string, + foreignContext?: boolean + ): string; function getPopupControlState(): PopupBlockerState; function getWMFContentDecryptionModuleInformation(): Promise; function getXPCOMErrorName(aErrorCode: number): string; @@ -29998,7 +30877,10 @@ declare namespace ChromeUtils { function isDarkBackground(element: Element): boolean; function isDevToolsOpened(): boolean; function isISOStyleDate(str: string): boolean; - function isOriginAttributesEqual(aA?: OriginAttributesDictionary, aB?: OriginAttributesDictionary): boolean; + function isOriginAttributesEqual( + aA?: OriginAttributesDictionary, + aB?: OriginAttributesDictionary + ): boolean; function lastExternalProtocolIframeAllowed(): number; function nondeterministicGetWeakMapKeys(map: any): any; function nondeterministicGetWeakSetKeys(aSet: any): any; @@ -30059,7 +30941,11 @@ declare namespace IOUtils { var sendTelemetry: any; function computeHexDigest(path: string, method: HashAlgorithm): Promise; function copy(sourcePath: string, destPath: string, options?: CopyOptions): Promise; - function createUniqueDirectory(parent: string, prefix: string, permissions?: number): Promise; + function createUniqueDirectory( + parent: string, + prefix: string, + permissions?: number + ): Promise; function createUniqueFile(parent: string, prefix: string, permissions?: number): Promise; function delMacXAttr(path: string, attr: string): Promise; function exists(path: string): Promise; @@ -30101,9 +30987,16 @@ declare namespace InspectorUtils { function getCSSPropertyPrefs(): PropertyPref[]; function getCSSPseudoElementNames(): string[]; function getCSSRegisteredProperties(document: Document): InspectorCSSPropertyDefinition[]; - function getCSSRegisteredProperty(document: Document, name: string): InspectorCSSPropertyDefinition | null; + function getCSSRegisteredProperty( + document: Document, + name: string + ): InspectorCSSPropertyDefinition | null; function getCSSValuesForProperty(property: string): string[]; - function getChildrenForNode(node: Node, showingAnonymousContent: boolean, includeAssignedNodes: boolean): Node[]; + function getChildrenForNode( + node: Node, + showingAnonymousContent: boolean, + includeAssignedNodes: boolean + ): Node[]; function getContentState(element: Element): number; function getMatchingCSSRules( element: Element, @@ -30119,9 +31012,15 @@ declare namespace InspectorUtils { function getRuleColumn(rule: CSSRule): number; function getRuleIndex(rule: CSSRule): number[]; function getRuleLine(rule: CSSRule): number; - function getStyleSheetRuleCountAndAtRules(sheet: CSSStyleSheet): InspectorStyleSheetRuleCountAndAtRulesResult; + function getStyleSheetRuleCountAndAtRules( + sheet: CSSStyleSheet + ): InspectorStyleSheetRuleCountAndAtRulesResult; function getSubpropertiesForCSSProperty(property: string): string[]; - function getUsedFontFaces(range: Range, maxRanges?: number, skipCollapsedWhitespace?: boolean): InspectorFontFace[]; + function getUsedFontFaces( + range: Range, + maxRanges?: number, + skipCollapsedWhitespace?: boolean + ): InspectorFontFace[]; function hasPseudoClassLock(element: Element, pseudoClass: string): boolean; function hasRulesModifiedByCSSOM(sheet: CSSStyleSheet): boolean; function isCustomElementName(name: string | null, namespaceURI: string | null): boolean; @@ -30131,7 +31030,11 @@ declare namespace InspectorUtils { function isUsedColorSchemeDark(element: Element): boolean; function isValidCSSColor(colorString: string): boolean; function parseStyleSheet(sheet: CSSStyleSheet, input: string): void; - function removeContentState(element: Element, state: number, clearActiveDocument?: boolean): boolean; + function removeContentState( + element: Element, + state: number, + clearActiveDocument?: boolean + ): boolean; function removePseudoClassLock(element: Element, pseudoClass: string): void; function replaceBlockRuleBodyTextInStylesheet( styleSheetText: string, @@ -30146,7 +31049,10 @@ declare namespace InspectorUtils { } declare namespace L10nOverlays { - function translateElement(element: Element, translation?: L10nMessage): L10nOverlaysError[] | null; + function translateElement( + element: Element, + translation?: L10nMessage + ): L10nOverlaysError[] | null; } declare namespace MediaControlService { @@ -30213,8 +31119,14 @@ declare namespace SessionStoreUtils { function collectFormData(window: WindowProxy): CollectedData | null; function collectScrollPosition(window: WindowProxy): CollectedData | null; function constructSessionStoreRestoreData(): nsISessionStoreRestoreData; - function forEachNonDynamicChildFrame(window: WindowProxy, callback: SessionStoreUtilsFrameCallback): void; - function initializeRestore(browsingContext: CanonicalBrowsingContext, data: nsISessionStoreRestoreData | null): Promise; + function forEachNonDynamicChildFrame( + window: WindowProxy, + callback: SessionStoreUtilsFrameCallback + ): void; + function initializeRestore( + browsingContext: CanonicalBrowsingContext, + data: nsISessionStoreRestoreData | null + ): Promise; function removeDynamicFrameFilteredListener( target: EventTarget, type: string, @@ -30241,13 +31153,30 @@ declare namespace TestUtils { } declare namespace UniFFIScaffolding { - function callAsync(id: UniFFIFunctionId, ...args: UniFFIScaffoldingValue[]): Promise; - function callAsyncWrapper(id: UniFFIFunctionId, ...args: UniFFIScaffoldingValue[]): Promise; - function callSync(id: UniFFIFunctionId, ...args: UniFFIScaffoldingValue[]): UniFFIScaffoldingCallResult; + function callAsync( + id: UniFFIFunctionId, + ...args: UniFFIScaffoldingValue[] + ): Promise; + function callAsyncWrapper( + id: UniFFIFunctionId, + ...args: UniFFIScaffoldingValue[] + ): Promise; + function callSync( + id: UniFFIFunctionId, + ...args: UniFFIScaffoldingValue[] + ): UniFFIScaffoldingCallResult; function deregisterCallbackHandler(interfaceId: UniFFICallbackInterfaceId): void; function readPointer(id: UniFFIPointerId, buff: ArrayBuffer, position: number): UniFFIPointer; - function registerCallbackHandler(interfaceId: UniFFICallbackInterfaceId, handler: UniFFICallbackHandler): void; - function writePointer(id: UniFFIPointerId, ptr: UniFFIPointer, buff: ArrayBuffer, position: number): void; + function registerCallbackHandler( + interfaceId: UniFFICallbackInterfaceId, + handler: UniFFICallbackHandler + ): void; + function writePointer( + id: UniFFIPointerId, + ptr: UniFFIPointer, + buff: ArrayBuffer, + position: number + ): void; } declare namespace UserInteraction { @@ -30525,7 +31454,10 @@ interface TestThrowingCallback { } interface ValidateAssertionCallback { - (assertion: string, origin: string): RTCIdentityValidationResult | PromiseLike; + ( + assertion: string, + origin: string + ): RTCIdentityValidationResult | PromiseLike; } interface VideoFrameOutputCallback { @@ -30733,7 +31665,12 @@ declare var Image: { new (width?: number, height?: number): HTMLImageElement; }; declare var Option: { - new (text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; + new ( + text?: string, + value?: string, + defaultSelected?: boolean, + selected?: boolean + ): HTMLOptionElement; }; declare var webkitSpeechGrammar: { new (): SpeechGrammar; @@ -30853,8 +31790,14 @@ declare function find( declare function focus(): void; declare function getAttention(): void; declare function getAttentionWithCycleCount(aCycleCount: number): void; -declare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration | null; -declare function getDefaultComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration | null; +declare function getComputedStyle( + elt: Element, + pseudoElt?: string | null +): CSSStyleDeclaration | null; +declare function getDefaultComputedStyle( + elt: Element, + pseudoElt?: string +): CSSStyleDeclaration | null; declare function getGroupMessageManager(aGroup: string): ChromeMessageBroadcaster; declare function getInterface(iid: any): any; declare function getRegionalPrefsLocales(): string[]; @@ -30870,7 +31813,12 @@ declare function moveToWorkspace(workspaceID: string): void; declare function mozScrollSnap(): void; declare function notifyDefaultButtonLoaded(defaultButton: Element): void; declare function open(url?: string | URL, target?: string, features?: string): WindowProxy | null; -declare function openDialog(url?: string, name?: string, options?: string, ...extraArguments: any[]): WindowProxy | null; +declare function openDialog( + url?: string, + name?: string, + options?: string, + ...extraArguments: any[] +): WindowProxy | null; declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; declare function postMessage(message: any, options?: WindowPostMessageOptions): void; declare function print(): void; @@ -30882,7 +31830,10 @@ declare function printPreview( declare function promiseDocumentFlushed(callback: PromiseDocumentFlushedCallback): Promise; declare function prompt(message?: string, _default?: string): string | null; declare function releaseEvents(): void; -declare function requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number; +declare function requestIdleCallback( + callback: IdleRequestCallback, + options?: IdleRequestOptions +): number; declare function resizeBy(x: number, y: number): void; declare function resizeTo(x: number, y: number): void; declare function restore(): void; @@ -31044,7 +31995,10 @@ declare function atob(atob: string): string; declare function btoa(btoa: string): string; declare function clearInterval(handle?: number): void; declare function clearTimeout(handle?: number): void; -declare function createImageBitmap(aImage: ImageBitmapSource, aOptions?: ImageBitmapOptions): Promise; +declare function createImageBitmap( + aImage: ImageBitmapSource, + aOptions?: ImageBitmapOptions +): Promise; declare function createImageBitmap( aImage: ImageBitmapSource, aSx: number, @@ -31129,7 +32083,11 @@ type GPUBufferDynamicOffset = number; type GPUBufferUsageFlags = number; type GPUColor = number[] | GPUColorDict; type GPUColorWriteFlags = number; -type GPUCopyExternalImageSource = ImageBitmap | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas; +type GPUCopyExternalImageSource = + | ImageBitmap + | HTMLImageElement + | HTMLCanvasElement + | OffscreenCanvas; type GPUDepthBias = number; type GPUExtent3D = GPUIntegerCoordinate[] | GPUExtent3DDict; type GPUFlagsConstant = number; @@ -31224,14 +32182,30 @@ type AlphaOption = 'discard' | 'keep'; type AnimationPlayState = 'finished' | 'idle' | 'paused' | 'running'; type AnimationReplaceState = 'active' | 'persisted' | 'removed'; type AudioContextState = 'closed' | 'running' | 'suspended'; -type AudioSampleFormat = 'f32' | 'f32-planar' | 's16' | 's16-planar' | 's32' | 's32-planar' | 'u8' | 'u8-planar'; +type AudioSampleFormat = + | 'f32' + | 'f32-planar' + | 's16' + | 's16-planar' + | 's32' + | 's32-planar' + | 'u8' + | 'u8-planar'; type AutoKeyword = 'auto'; type AutoplayPolicy = 'allowed' | 'allowed-muted' | 'disallowed'; type AutoplayPolicyMediaType = 'audiocontext' | 'mediaelement'; type AvcBitstreamFormat = 'annexb' | 'avc'; type Base64URLDecodePadding = 'ignore' | 'reject' | 'require'; type BinaryType = 'arraybuffer' | 'blob'; -type BiquadFilterType = 'allpass' | 'bandpass' | 'highpass' | 'highshelf' | 'lowpass' | 'lowshelf' | 'notch' | 'peaking'; +type BiquadFilterType = + | 'allpass' + | 'bandpass' + | 'highpass' + | 'highshelf' + | 'lowpass' + | 'lowshelf' + | 'notch' + | 'peaking'; type BitrateMode = 'constant' | 'variable'; type CSSBoxType = 'border' | 'content' | 'margin' | 'padding'; type CSSStyleSheetParsingMode = 'agent' | 'author' | 'user'; @@ -31364,7 +32338,15 @@ type GPUBlendOperation = 'add' | 'max' | 'min' | 'reverse-subtract' | 'subtract' type GPUBufferBindingType = 'read-only-storage' | 'storage' | 'uniform'; type GPUBufferMapState = 'mapped' | 'pending' | 'unmapped'; type GPUCanvasAlphaMode = 'opaque' | 'premultiplied'; -type GPUCompareFunction = 'always' | 'equal' | 'greater' | 'greater-equal' | 'less' | 'less-equal' | 'never' | 'not-equal'; +type GPUCompareFunction = + | 'always' + | 'equal' + | 'greater' + | 'greater-equal' + | 'less' + | 'less-equal' + | 'never' + | 'not-equal'; type GPUCompilationMessageType = 'error' | 'info' | 'warning'; type GPUCullMode = 'back' | 'front' | 'none'; type GPUErrorFilter = 'internal' | 'out-of-memory' | 'validation'; @@ -31390,7 +32372,12 @@ type GPUIndexFormat = 'uint16' | 'uint32'; type GPULoadOp = 'clear' | 'load'; type GPUMipmapFilterMode = 'linear' | 'nearest'; type GPUPowerPreference = 'high-performance' | 'low-power'; -type GPUPrimitiveTopology = 'line-list' | 'line-strip' | 'point-list' | 'triangle-list' | 'triangle-strip'; +type GPUPrimitiveTopology = + | 'line-list' + | 'line-strip' + | 'point-list' + | 'triangle-list' + | 'triangle-strip'; type GPUQueryType = 'occlusion' | 'timestamp'; type GPUSamplerBindingType = 'comparison' | 'filtering' | 'non-filtering'; type GPUStencilOperation = @@ -31609,7 +32596,11 @@ type MediaControlKey = type MediaDecodingType = 'file' | 'media-source'; type MediaDeviceKind = 'audioinput' | 'audiooutput' | 'videoinput'; type MediaEncodingType = 'record' | 'transmission'; -type MediaKeyMessageType = 'individualization-request' | 'license-release' | 'license-renewal' | 'license-request'; +type MediaKeyMessageType = + | 'individualization-request' + | 'license-release' + | 'license-renewal' + | 'license-request'; type MediaKeySessionType = 'persistent-license' | 'temporary'; type MediaKeyStatus = | 'expired' @@ -31694,10 +32685,18 @@ type OrientationLockType = | 'portrait' | 'portrait-primary' | 'portrait-secondary'; -type OrientationType = 'landscape-primary' | 'landscape-secondary' | 'portrait-primary' | 'portrait-secondary'; +type OrientationType = + | 'landscape-primary' + | 'landscape-secondary' + | 'portrait-primary' + | 'portrait-secondary'; type OscillatorType = 'custom' | 'sawtooth' | 'sine' | 'square' | 'triangle'; type OverSampleType = '2x' | '4x' | 'none'; -type OverridableErrorCategory = 'domain-mismatch' | 'expired-or-not-yet-valid' | 'trust-error' | 'unset'; +type OverridableErrorCategory = + | 'domain-mismatch' + | 'expired-or-not-yet-valid' + | 'trust-error' + | 'unset'; type PCError = | 'InvalidAccessError' | 'InvalidCharacterError' @@ -31710,7 +32709,12 @@ type PCError = | 'SyntaxError' | 'TypeError' | 'UnknownError'; -type PCObserverStateType = 'ConnectionState' | 'IceConnectionState' | 'IceGatheringState' | 'None' | 'SignalingState'; +type PCObserverStateType = + | 'ConnectionState' + | 'IceConnectionState' + | 'IceGatheringState' + | 'None' + | 'SignalingState'; type PanningModelType = 'HRTF' | 'equalpower'; type PaymentComplete = 'fail' | 'success' | 'unknown'; type PaymentShippingType = 'delivery' | 'pickup' | 'shipping'; @@ -31745,7 +32749,12 @@ type PlacesEventType = | 'pages-rank-changed' | 'purge-caches'; type PlaybackDirection = 'alternate' | 'alternate-reverse' | 'normal' | 'reverse'; -type PopupBlockerState = 'openAbused' | 'openAllowed' | 'openBlocked' | 'openControlled' | 'openOverridden'; +type PopupBlockerState = + | 'openAbused' + | 'openAllowed' + | 'openBlocked' + | 'openControlled' + | 'openOverridden'; type PositionAlignSetting = 'auto' | 'center' | 'line-left' | 'line-right'; type PredefinedColorSpace = 'display-p3' | 'srgb'; type PrefersColorSchemeOverride = 'dark' | 'light' | 'none'; @@ -31763,16 +32772,40 @@ type RTCDtlsTransportState = 'closed' | 'connected' | 'connecting' | 'failed' | type RTCEncodedVideoFrameType = 'delta' | 'empty' | 'key'; type RTCIceCandidateType = 'host' | 'prflx' | 'relay' | 'srflx'; type RTCIceComponent = 'rtcp' | 'rtp'; -type RTCIceConnectionState = 'checking' | 'closed' | 'completed' | 'connected' | 'disconnected' | 'failed' | 'new'; +type RTCIceConnectionState = + | 'checking' + | 'closed' + | 'completed' + | 'connected' + | 'disconnected' + | 'failed' + | 'new'; type RTCIceCredentialType = 'password'; type RTCIceGathererState = 'complete' | 'gathering' | 'new'; type RTCIceGatheringState = 'complete' | 'gathering' | 'new'; type RTCIceProtocol = 'tcp' | 'udp'; type RTCIceTcpCandidateType = 'active' | 'passive' | 'so'; type RTCIceTransportPolicy = 'all' | 'relay'; -type RTCIceTransportState = 'checking' | 'closed' | 'completed' | 'connected' | 'disconnected' | 'failed' | 'new'; -type RTCLifecycleEvent = 'connectionstatechange' | 'iceconnectionstatechange' | 'icegatheringstatechange' | 'initialized'; -type RTCPeerConnectionState = 'closed' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'new'; +type RTCIceTransportState = + | 'checking' + | 'closed' + | 'completed' + | 'connected' + | 'disconnected' + | 'failed' + | 'new'; +type RTCLifecycleEvent = + | 'connectionstatechange' + | 'iceconnectionstatechange' + | 'icegatheringstatechange' + | 'initialized'; +type RTCPeerConnectionState = + | 'closed' + | 'connected' + | 'connecting' + | 'disconnected' + | 'failed' + | 'new'; type RTCPriorityType = 'high' | 'low' | 'medium' | 'very-low'; type RTCRtpTransceiverDirection = 'inactive' | 'recvonly' | 'sendonly' | 'sendrecv' | 'stopped'; type RTCSctpTransportState = 'closed' | 'connected' | 'connecting'; @@ -31784,7 +32817,13 @@ type RTCSignalingState = | 'have-remote-offer' | 'have-remote-pranswer' | 'stable'; -type RTCStatsIceCandidatePairState = 'cancelled' | 'failed' | 'frozen' | 'inprogress' | 'succeeded' | 'waiting'; +type RTCStatsIceCandidatePairState = + | 'cancelled' + | 'failed' + | 'frozen' + | 'inprogress' + | 'succeeded' + | 'waiting'; type RTCStatsType = | 'candidate-pair' | 'codec' @@ -31814,7 +32853,13 @@ type ReferrerPolicy = | 'strict-origin-when-cross-origin' | 'unsafe-url'; type RenderBlockingStatusType = 'blocking' | 'non-blocking'; -type RequestCache = 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload'; +type RequestCache = + | 'default' + | 'force-cache' + | 'no-cache' + | 'no-store' + | 'only-if-cached' + | 'reload'; type RequestCredentials = 'include' | 'omit' | 'same-origin'; type RequestDestination = | '' @@ -31855,7 +32900,13 @@ type ScrollState = 'started' | 'stopped'; type SecurityPolicyViolationEventDisposition = 'enforce' | 'report'; type SelectionMode = 'end' | 'preserve' | 'select' | 'start'; type SelectorWarningKind = 'UnconstrainedHas'; -type ServiceWorkerState = 'activated' | 'activating' | 'installed' | 'installing' | 'parsed' | 'redundant'; +type ServiceWorkerState = + | 'activated' + | 'activating' + | 'installed' + | 'installing' + | 'parsed' + | 'redundant'; type ServiceWorkerUpdateViaCache = 'all' | 'imports' | 'none'; type ShadowRootMode = 'closed' | 'open'; type SlotAssignmentMode = 'manual' | 'named'; @@ -31891,7 +32942,12 @@ type StreamFilterStatus = | 'transferringdata' | 'uninitialized'; type StringType = 'inline' | 'literal' | 'other' | 'stringbuffer'; -type SupportedType = 'application/xhtml+xml' | 'application/xml' | 'image/svg+xml' | 'text/html' | 'text/xml'; +type SupportedType = + | 'application/xhtml+xml' + | 'application/xml' + | 'image/svg+xml' + | 'text/html' + | 'text/xml'; type TCPReadyState = 'closed' | 'closing' | 'connecting' | 'open'; type TCPSocketBinaryType = 'arraybuffer' | 'string'; type TaskPriority = 'background' | 'user-blocking' | 'user-visible'; @@ -31929,7 +32985,13 @@ type VideoPixelFormat = | 'NV12' | 'RGBA' | 'RGBX'; -type VideoTransferCharacteristics = 'bt709' | 'hlg' | 'iec61966-2-1' | 'linear' | 'pq' | 'smpte170m'; +type VideoTransferCharacteristics = + | 'bt709' + | 'hlg' + | 'iec61966-2-1' + | 'linear' + | 'pq' + | 'smpte170m'; type VisibilityState = 'hidden' | 'visible'; type WakeLockType = 'screen'; type WebGLPowerPreference = 'default' | 'high-performance' | 'low-power'; @@ -31995,7 +33057,11 @@ interface AudioTrackList { interface BaseAudioContext { createIIRFilter(feedforward: Iterable, feedback: Iterable): IIRFilterNode; - createPeriodicWave(real: Iterable, imag: Iterable, constraints?: PeriodicWaveConstraints): PeriodicWave; + createPeriodicWave( + real: Iterable, + imag: Iterable, + constraints?: PeriodicWaveConstraints + ): PeriodicWave; } interface CSSKeyframesRule { @@ -32019,7 +33085,13 @@ interface CanvasPathDrawingStyles { } interface CanvasPathMethods { - roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable): void; + roundRect( + x: number, + y: number, + w: number, + h: number, + radii?: number | DOMPointInit | Iterable + ): void; } interface CookieStoreManager { @@ -32074,7 +33146,11 @@ interface FormData { } interface GPUBindingCommandsMixin { - setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup | null, dynamicOffsets?: Iterable): void; + setBindGroup( + index: GPUIndex32, + bindGroup: GPUBindGroup | null, + dynamicOffsets?: Iterable + ): void; } interface GPUCommandEncoder { @@ -32183,7 +33259,11 @@ interface IDBDatabase { } interface IDBObjectStore { - createIndex(name: string, keyPath: string | Iterable, optionalParameters?: IDBIndexParameters): IDBIndex; + createIndex( + name: string, + keyPath: string | Iterable, + optionalParameters?: IDBIndexParameters + ): IDBIndex; } interface ImageTrackList { @@ -32195,8 +33275,14 @@ interface IntlUtils { } interface L10nRegistry { - generateBundles(aLocales: Iterable, aResourceIds: Iterable): FluentBundleAsyncIterator; - generateBundlesSync(aLocales: Iterable, aResourceIds: Iterable): FluentBundleIterator; + generateBundles( + aLocales: Iterable, + aResourceIds: Iterable + ): FluentBundleAsyncIterator; + generateBundlesSync( + aLocales: Iterable, + aResourceIds: Iterable + ): FluentBundleIterator; registerSources(aSources: Iterable): void; removeSources(aSources: Iterable): void; updateSources(aSources: Iterable): void; @@ -32373,7 +33459,11 @@ interface SubtleCrypto { extractable: boolean, keyUsages: Iterable ): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable): Promise; + generateKey( + algorithm: AlgorithmIdentifier, + extractable: boolean, + keyUsages: Iterable + ): Promise; importKey( format: KeyFormat, keyData: any, @@ -32472,9 +33562,24 @@ interface WEBGL_draw_buffers { interface WGSLLanguageFeatures extends ReadonlySet {} interface WebGL2RenderingContextBase { - clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; - clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; - clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; + clearBufferfv( + buffer: GLenum, + drawbuffer: GLint, + values: Iterable, + srcOffset?: GLuint + ): void; + clearBufferiv( + buffer: GLenum, + drawbuffer: GLint, + values: Iterable, + srcOffset?: GLuint + ): void; + clearBufferuiv( + buffer: GLenum, + drawbuffer: GLint, + values: Iterable, + srcOffset?: GLuint + ): void; drawBuffers(buffers: Iterable): void; getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable, pname: GLenum): any; getUniformIndices(program: WebGLProgram, uniformNames: Iterable): Iterable | null; @@ -32487,19 +33592,83 @@ interface WebGL2RenderingContextBase { width: GLsizei, height: GLsizei ): void; - transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable, bufferMode: GLenum): void; - uniform1fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform1iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform1uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; + transformFeedbackVaryings( + program: WebGLProgram, + varyings: Iterable, + bufferMode: GLenum + ): void; + uniform1fv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform1iv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform1uiv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform2fv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform2iv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform2uiv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform3fv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform3iv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform3uiv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4fv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4iv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; + uniform4uiv( + location: WebGLUniformLocation | null, + data: Iterable, + srcOffset?: GLuint, + srcLength?: GLuint + ): void; uniformMatrix2fv( location: WebGLUniformLocation | null, transpose: GLboolean, @@ -32576,9 +33745,21 @@ interface WebGLRenderingContext { uniform3iv(location: WebGLUniformLocation | null, data: Iterable): void; uniform4fv(location: WebGLUniformLocation | null, data: Iterable): void; uniform4iv(location: WebGLUniformLocation | null, data: Iterable): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable): void; + uniformMatrix2fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Iterable + ): void; + uniformMatrix3fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Iterable + ): void; + uniformMatrix4fv( + location: WebGLUniformLocation | null, + transpose: GLboolean, + data: Iterable + ): void; } interface WebGLRenderingContextBase { @@ -32644,6 +33825,8 @@ interface TestInterfaceAsyncIterableSingle { } interface TestInterfaceAsyncIterableSingleWithArgs { - [Symbol.asyncIterator](options?: TestInterfaceAsyncIteratorOptions): AsyncIterableIterator; + [Symbol.asyncIterator]( + options?: TestInterfaceAsyncIteratorOptions + ): AsyncIterableIterator; values(options?: TestInterfaceAsyncIteratorOptions): AsyncIterableIterator; } diff --git a/src/zen/@types/lib.gecko.linux.d.ts b/src/zen/@types/lib.gecko.linux.d.ts index 3f91643d..e8b9e241 100644 --- a/src/zen/@types/lib.gecko.linux.d.ts +++ b/src/zen/@types/lib.gecko.linux.d.ts @@ -27,7 +27,10 @@ declare global { interface nsIApplicationChooser extends nsISupports { init(parent: mozIDOMWindowProxy, title: string): void; - open(contentType: string, applicationChooserFinishedCallback: nsIApplicationChooserFinishedCallback): void; + open( + contentType: string, + applicationChooserFinishedCallback: nsIApplicationChooserFinishedCallback + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsIGtkTaskbarProgress.idl diff --git a/src/zen/@types/lib.gecko.tweaks.d.ts b/src/zen/@types/lib.gecko.tweaks.d.ts index 3869a736..70999d6d 100644 --- a/src/zen/@types/lib.gecko.tweaks.d.ts +++ b/src/zen/@types/lib.gecko.tweaks.d.ts @@ -30,8 +30,14 @@ type nsIGleanPingWithReason = { interface MessageListenerManagerMixin { // Overloads that define `data` arg as required, since it's ~always expected. - addMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data }) }); - removeMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data }) }); + addMessageListener( + msg: string, + listener: { receiveMessage(_: ReceiveMessageArgument & { data }) } + ); + removeMessageListener( + msg: string, + listener: { receiveMessage(_: ReceiveMessageArgument & { data }) } + ); } interface MozQueryInterface { @@ -71,7 +77,12 @@ interface ComponentsExceptionOptions { interface nsIException extends Exception {} interface nsIXPCComponents_Exception { - (message?: string, resultOrOptions?: number | ComponentsExceptionOptions, stack?: nsIStackFrame, data?: object): nsIException; + ( + message?: string, + resultOrOptions?: number | ComponentsExceptionOptions, + stack?: nsIStackFrame, + data?: object + ): nsIException; } interface nsIXPCComponents_ID { diff --git a/src/zen/@types/lib.gecko.win32.d.ts b/src/zen/@types/lib.gecko.win32.d.ts index 0d597aa4..bf740cb0 100644 --- a/src/zen/@types/lib.gecko.win32.d.ts +++ b/src/zen/@types/lib.gecko.win32.d.ts @@ -31,7 +31,11 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/aboutwindowsmessages/nsIAboutWindowsMessages.idl interface nsIAboutWindowsMessages extends nsISupports { - getMessages(currentWindow: mozIDOMWindowProxy, messages: OutParam, windowTitles: OutParam): void; + getMessages( + currentWindow: mozIDOMWindowProxy, + messages: OutParam, + windowTitles: OutParam + ): void; } // https://searchfox.org/mozilla-central/source/toolkit/components/alerts/nsIWindowsAlertsService.idl @@ -48,7 +52,9 @@ declare global { type ImagePlacement = nsIWindowsAlertNotification_ImagePlacement; } - interface nsIWindowsAlertNotification extends nsIAlertNotification, Enums { + interface nsIWindowsAlertNotification + extends nsIAlertNotification, + Enums { imagePlacement: nsIWindowsAlertNotification.ImagePlacement; } @@ -157,7 +163,12 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/taskscheduler/nsIWinTaskSchedulerService.idl interface nsIWinTaskSchedulerService extends nsISupports { - registerTask(aFolderName: string, aTaskName: string, aDefinitionXML: string, aUpdateExisting?: boolean): void; + registerTask( + aFolderName: string, + aTaskName: string, + aDefinitionXML: string, + aUpdateExisting?: boolean + ): void; validateTaskDefinition(aDefinitionXML: string): i32; getTaskXML(aFolderName: string, aTaskName: string): string; getCurrentUserSid(): string; @@ -174,7 +185,11 @@ declare global { obtainAndCacheFaviconAsync(faviconURL: nsIURI): Promise; isAvailable(): Promise; checkForRemovals(): Promise; - populateJumpList(aTaskDescriptions: any, aCustomTitle: string, aCustomDescriptions: any): Promise; + populateJumpList( + aTaskDescriptions: any, + aCustomTitle: string, + aCustomDescriptions: any + ): Promise; clearJumpList(): Promise; } @@ -183,7 +198,11 @@ declare global { // https://searchfox.org/mozilla-central/source/widget/nsITaskbarOverlayIconController.idl interface nsITaskbarOverlayIconController extends nsISupports { - setOverlayIcon(statusIcon: imgIContainer, statusDescription: string, paintContext?: nsISVGPaintContext): void; + setOverlayIcon( + statusIcon: imgIContainer, + statusDescription: string, + paintContext?: nsISVGPaintContext + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreview.idl @@ -259,7 +278,10 @@ declare global { readonly available: boolean; readonly defaultGroupId: string; readonly defaultPrivateGroupId: string; - createTaskbarTabPreview(shell: nsIDocShell, controller: nsITaskbarPreviewController): nsITaskbarTabPreview; + createTaskbarTabPreview( + shell: nsIDocShell, + controller: nsITaskbarPreviewController + ): nsITaskbarTabPreview; getTaskbarWindowPreview(shell: nsIDocShell): nsITaskbarWindowPreview; getTaskbarProgress(shell: nsIDocShell): nsITaskbarProgress; getOverlayIconController(shell: nsIDocShell): nsITaskbarOverlayIconController; @@ -273,7 +295,11 @@ declare global { interface nsIWindowsUIUtils extends nsISupports { readonly systemSmallIconSize: i32; readonly systemLargeIconSize: i32; - setWindowIcon(aWindow: mozIDOMWindowProxy, aSmallIcon: imgIContainer, aLargeIcon: imgIContainer): void; + setWindowIcon( + aWindow: mozIDOMWindowProxy, + aSmallIcon: imgIContainer, + aLargeIcon: imgIContainer + ): void; setWindowIconFromExe(aWindow: mozIDOMWindowProxy, aExe: string, aIndex: u16): void; setWindowIconNoData(aWindow: mozIDOMWindowProxy): void; readonly inWin10TabletMode: boolean; @@ -346,13 +372,19 @@ declare global { nsIInstalledApplication: nsJSIID; nsIAboutThirdParty: nsJSIID; nsIAboutWindowsMessages: nsJSIID; - nsIWindowsAlertNotification: nsJSIID; + nsIWindowsAlertNotification: nsJSIID< + nsIWindowsAlertNotification, + typeof nsIWindowsAlertNotification_ImagePlacement + >; nsIWindowsAlertsService: nsJSIID; nsIDefaultAgent: nsJSIID; nsIWindowsMutex: nsJSIID; nsIWindowsMutexFactory: nsJSIID; nsIGeolocationUIUtilsWin: nsJSIID; - nsIWindowsShellService: nsJSIID; + nsIWindowsShellService: nsJSIID< + nsIWindowsShellService, + typeof nsIWindowsShellService_LaunchOnLoginEnabledEnumerator + >; nsIWinTaskSchedulerService: nsJSIID; nsIJumpListBuilder: nsJSIID; nsITaskbarOverlayIconController: nsJSIID; diff --git a/src/zen/@types/lib.gecko.xpcom.d.ts b/src/zen/@types/lib.gecko.xpcom.d.ts index 546370d5..d607824b 100644 --- a/src/zen/@types/lib.gecko.xpcom.d.ts +++ b/src/zen/@types/lib.gecko.xpcom.d.ts @@ -112,7 +112,11 @@ declare global { interface nsIBitsNewRequestCallback extends nsISupports { success(request: nsIBitsRequest): void; - failure(errorType: nsBitsErrorType, errorAction: nsBitsErrorAction, errorStage: nsBitsErrorStage): void; + failure( + errorType: nsBitsErrorType, + errorAction: nsBitsErrorAction, + errorStage: nsBitsErrorStage + ): void; failureNsresult( errorType: nsBitsErrorType, errorAction: nsBitsErrorAction, @@ -148,7 +152,11 @@ declare global { interface nsIBitsCallback extends nsISupports { success(): void; - failure(errorType: nsBitsErrorType, errorAction: nsBitsErrorAction, errorStage: nsBitsErrorStage): void; + failure( + errorType: nsBitsErrorType, + errorAction: nsBitsErrorAction, + errorStage: nsBitsErrorStage + ): void; failureNsresult( errorType: nsBitsErrorType, errorAction: nsBitsErrorAction, @@ -216,15 +224,29 @@ declare global { readonly attributes: nsIPersistentProperties; readonly cache: nsIPersistentProperties; readonly nativeInterface: nsISupports; - groupPosition(aGroupLevel: OutParam, aSimilarItemsInGroup: OutParam, aPositionInGroup: OutParam): void; + groupPosition( + aGroupLevel: OutParam, + aSimilarItemsInGroup: OutParam, + aPositionInGroup: OutParam + ): void; getChildAtPoint(x: i32, y: i32): nsIAccessible; getDeepestChildAtPoint(x: i32, y: i32): nsIAccessible; getDeepestChildAtPointInProcess(x: i32, y: i32): nsIAccessible; getChildAt(aChildIndex: i32): nsIAccessible; getRelationByType(aRelationType: u32): nsIAccessibleRelation; getRelations(): nsIArray; - getBounds(x: OutParam, y: OutParam, width: OutParam, height: OutParam): void; - getBoundsInCSSPixels(aX: OutParam, aY: OutParam, aWidth: OutParam, aHeight: OutParam): void; + getBounds( + x: OutParam, + y: OutParam, + width: OutParam, + height: OutParam + ): void; + getBoundsInCSSPixels( + aX: OutParam, + aY: OutParam, + aWidth: OutParam, + aHeight: OutParam + ): void; setSelected(isSelected: boolean): void; takeSelection(): void; takeFocus(): void; @@ -389,8 +411,16 @@ declare global { // https://searchfox.org/mozilla-central/source/accessible/interfaces/nsIAccessiblePivot.idl interface nsIAccessiblePivot extends nsISupports { - next(aAnchor: nsIAccessible, aRule: nsIAccessibleTraversalRule, aIncludeStart?: boolean): nsIAccessible; - prev(aAnchor: nsIAccessible, aRule: nsIAccessibleTraversalRule, aIncludeStart?: boolean): nsIAccessible; + next( + aAnchor: nsIAccessible, + aRule: nsIAccessibleTraversalRule, + aIncludeStart?: boolean + ): nsIAccessible; + prev( + aAnchor: nsIAccessible, + aRule: nsIAccessibleTraversalRule, + aIncludeStart?: boolean + ): nsIAccessible; first(aRule: nsIAccessibleTraversalRule): nsIAccessible; last(aRule: nsIAccessibleTraversalRule): nsIAccessible; atPoint(aX: i32, aY: i32, aRule: nsIAccessibleTraversalRule): nsIAccessible; @@ -685,7 +715,11 @@ declare global { getCellIndexAt(rowIndex: i32, columnIndex: i32): i32; getColumnIndexAt(cellIndex: i32): i32; getRowIndexAt(cellIndex: i32): i32; - getRowAndColumnIndicesAt(cellIndex: i32, rowIndex: OutParam, columnIndex: OutParam): void; + getRowAndColumnIndicesAt( + cellIndex: i32, + rowIndex: OutParam, + columnIndex: OutParam + ): void; getColumnExtentAt(row: i32, column: i32): i32; getRowExtentAt(row: i32, column: i32): i32; getColumnDescription(columnIndex: i32): string; @@ -737,7 +771,12 @@ declare global { readonly BOUNDARY_CLUSTER?: 8; caretOffset: i32; - getCaretRect(x: OutParam, y: OutParam, width: OutParam, height: OutParam): void; + getCaretRect( + x: OutParam, + y: OutParam, + width: OutParam, + height: OutParam + ): void; readonly characterCount: i32; readonly selectionCount: i32; getText(startOffset: i32, endOffset: i32): string; @@ -785,12 +824,22 @@ declare global { coordType: u32 ): void; getOffsetAtPoint(x: i32, y: i32, coordType: u32): i32; - getSelectionBounds(selectionNum: i32, startOffset: OutParam, endOffset: OutParam): void; + getSelectionBounds( + selectionNum: i32, + startOffset: OutParam, + endOffset: OutParam + ): void; setSelectionBounds(selectionNum: i32, startOffset: i32, endOffset: i32): void; addSelection(startOffset: i32, endOffset: i32): void; removeSelection(selectionNum: i32): void; scrollSubstringTo(startIndex: i32, endIndex: i32, scrollType: u32): void; - scrollSubstringToPoint(startIndex: i32, endIndex: i32, coordinateType: u32, x: i32, y: i32): void; + scrollSubstringToPoint( + startIndex: i32, + endIndex: i32, + coordinateType: u32, + x: i32, + y: i32 + ): void; readonly selectionRanges: nsIArray; } @@ -815,7 +864,11 @@ declare global { accessible: nsIAccessible; offset: i32; - findBoundary(aBoundaryType: AccessibleTextBoundary, aDirection: u32, aFlags: u32): nsIAccessibleTextLeafPoint; + findBoundary( + aBoundaryType: AccessibleTextBoundary, + aDirection: u32, + aFlags: u32 + ): nsIAccessibleTextLeafPoint; } // https://searchfox.org/mozilla-central/source/accessible/interfaces/nsIAccessibleTextRange.idl @@ -832,7 +885,11 @@ declare global { readonly endOffset: i32; readonly container: nsIAccessible; compare(aOtherRange: nsIAccessibleTextRange): boolean; - compareEndPoints(aEndPoint: u32, aOtherRange: nsIAccessibleTextRange, aOtherRangeEndPoint: u32): i32; + compareEndPoints( + aEndPoint: u32, + aOtherRange: nsIAccessibleTextRange, + aOtherRangeEndPoint: u32 + ): i32; crop(aContainer: nsIAccessible): boolean; } @@ -921,7 +978,11 @@ declare global { readonly actionable: boolean; readonly source: string; opaqueRelaunchData: string; - loadImage(aTimeout: u32, aListener: nsIAlertNotificationImageListener, aUserData?: nsISupports): nsICancelable; + loadImage( + aTimeout: u32, + aListener: nsIAlertNotificationImageListener, + aUserData?: nsISupports + ): nsICancelable; getAction(aName: string): nsIAlertAction; } @@ -1162,7 +1223,11 @@ declare global { closePopup(): void; invalidate(reason: u16): void; selectBy(reverse: boolean, page: boolean): void; - startSearch(searchString: string, element: Element, listener: nsIFormFillCompleteObserver): void; + startSearch( + searchString: string, + element: Element, + listener: nsIFormFillCompleteObserver + ): void; stopSearch(): void; selectEntry(): void; } @@ -1292,7 +1357,11 @@ declare global { addonHasPermission(aAddonId: string, aPerm: string): boolean; addonMayLoadURI(aAddonId: string, aURI: nsIURI, aExplicit?: boolean): boolean; getExtensionName(aAddonId: string): string; - sourceMayLoadExtensionURI(aSourceURI: nsIURI, aExtensionURI: nsIURI, aFromPrivateWindow?: boolean): boolean; + sourceMayLoadExtensionURI( + aSourceURI: nsIURI, + aExtensionURI: nsIURI, + aFromPrivateWindow?: boolean + ): boolean; extensionURIToAddonId(aURI: nsIURI): string; } @@ -1336,7 +1405,11 @@ declare global { subsumesConsideringDomain(other: nsIPrincipal): boolean; subsumesConsideringDomainIgnoringFPD(other: nsIPrincipal): boolean; checkMayLoad(uri: nsIURI, allowIfInheritsPrincipal: boolean): void; - checkMayLoadWithReporting(uri: nsIURI, allowIfInheritsPrincipal: boolean, innerWindowID: u64): void; + checkMayLoadWithReporting( + uri: nsIURI, + allowIfInheritsPrincipal: boolean, + innerWindowID: u64 + ): void; isThirdPartyURI(uri: nsIURI): boolean; isThirdPartyPrincipal(principal: nsIPrincipal): boolean; isThirdPartyChannel(channel: nsIChannel): boolean; @@ -1401,8 +1474,18 @@ declare global { readonly DEFAULT_USER_CONTEXT_ID?: 0; readonly DEFAULT_PRIVATE_BROWSING_ID?: 0; - checkLoadURIWithPrincipalXPCOM(aPrincipal: nsIPrincipal, uri: nsIURI, flags: u32, innerWindowID?: u64): void; - checkLoadURIWithPrincipal(aPrincipal: nsIPrincipal, uri: nsIURI, flags?: u32, innerWindowID?: u64): void; + checkLoadURIWithPrincipalXPCOM( + aPrincipal: nsIPrincipal, + uri: nsIURI, + flags: u32, + innerWindowID?: u64 + ): void; + checkLoadURIWithPrincipal( + aPrincipal: nsIPrincipal, + uri: nsIURI, + flags?: u32, + innerWindowID?: u64 + ): void; checkLoadURIStrWithPrincipalXPCOM(aPrincipal: nsIPrincipal, uri: string, flags: u32): void; checkLoadURIStrWithPrincipal(aPrincipal: nsIPrincipal, uri: string, flags?: u32): void; inFileURIAllowlist(aUri: nsIURI): boolean; @@ -1415,7 +1498,12 @@ declare global { principalToJSON(principal: nsIPrincipal): string; JSONToPrincipal(json: string): nsIPrincipal; createNullPrincipal(originAttributes: any): nsIPrincipal; - checkSameOriginURI(aSourceURI: nsIURI, aTargetURI: nsIURI, reportError: boolean, fromPrivateWindow: boolean): void; + checkSameOriginURI( + aSourceURI: nsIURI, + aTargetURI: nsIURI, + reportError: boolean, + fromPrivateWindow: boolean + ): void; getChannelResultPrincipal(aChannel: nsIChannel): nsIPrincipal; getChannelResultStoragePrincipal(aChannel: nsIChannel): nsIPrincipal; getChannelResultPrincipals( @@ -1482,8 +1570,16 @@ declare global { removeCommandObserver(aCommandObserver: nsIObserver, aCommandObserved: string): void; isCommandSupported(aCommandName: string, aTargetWindow: mozIDOMWindowProxy): boolean; isCommandEnabled(aCommandName: string, aTargetWindow: mozIDOMWindowProxy): boolean; - getCommandState(aCommandName: string, aTargetWindow: mozIDOMWindowProxy, aCommandParams: nsICommandParams): void; - doCommand(aCommandName: string, aCommandParams: nsICommandParams, aTargetWindow: mozIDOMWindowProxy): void; + getCommandState( + aCommandName: string, + aTargetWindow: mozIDOMWindowProxy, + aCommandParams: nsICommandParams + ): void; + doCommand( + aCommandName: string, + aCommandParams: nsICommandParams, + aTargetWindow: mozIDOMWindowProxy + ): void; } // https://searchfox.org/mozilla-central/source/dom/commandhandler/nsICommandParams.idl @@ -1517,9 +1613,17 @@ declare global { interface nsIControllerCommand extends nsISupports { isCommandEnabled(aCommandName: string, aCommandContext: nsISupports): boolean; - getCommandStateParams(aCommandName: string, aParams: nsICommandParams, aCommandContext: nsISupports): void; + getCommandStateParams( + aCommandName: string, + aParams: nsICommandParams, + aCommandContext: nsISupports + ): void; doCommand(aCommandName: string, aCommandContext: nsISupports): void; - doCommandParams(aCommandName: string, aParams: nsICommandParams, aCommandContext: nsISupports): void; + doCommandParams( + aCommandName: string, + aParams: nsICommandParams, + aCommandContext: nsISupports + ): void; } // https://searchfox.org/mozilla-central/source/dom/commandhandler/nsIControllerCommandTable.idl @@ -1533,8 +1637,16 @@ declare global { updateCommandState(aCommandName: string, aCommandRefCon: nsISupports): void; supportsCommand(aCommandName: string, aCommandRefCon: nsISupports): boolean; doCommand(aCommandName: string, aCommandRefCon: nsISupports): void; - doCommandParams(aCommandName: string, aParam: nsICommandParams, aCommandRefCon: nsISupports): void; - getCommandState(aCommandName: string, aParam: nsICommandParams, aCommandRefCon: nsISupports): void; + doCommandParams( + aCommandName: string, + aParam: nsICommandParams, + aCommandRefCon: nsISupports + ): void; + getCommandState( + aCommandName: string, + aParam: nsICommandParams, + aCommandRefCon: nsISupports + ): void; getSupportedCommands(): string[]; } @@ -1631,7 +1743,12 @@ declare global { aWantsUntrusted?: boolean, aSystemEventGroup?: boolean ): void; - removeListenerForAllEvents(target: EventTarget, listener: any, aUseCapture?: boolean, aSystemEventGroup?: boolean): void; + removeListenerForAllEvents( + target: EventTarget, + listener: any, + aUseCapture?: boolean, + aSystemEventGroup?: boolean + ): void; addListenerChangeListener(aListener: nsIListenerChangeListener): void; removeListenerChangeListener(aListener: nsIListenerChangeListener): void; } @@ -1716,7 +1833,10 @@ declare global { allowWindowControl: boolean; allowContentRetargeting: boolean; allowContentRetargetingOnChildren: boolean; - getAllDocShellsInSubtree(aItemType: i32, aDirection: nsIDocShell.DocShellEnumeratorDirection): nsIDocShell[]; + getAllDocShellsInSubtree( + aItemType: i32, + aDirection: nsIDocShell.DocShellEnumeratorDirection + ): nsIDocShell[]; appType: nsIDocShell.AppType; allowAuth: boolean; zoom: float; @@ -1735,7 +1855,12 @@ declare global { clearCachedPlatform(): void; readonly restoringDocument: boolean; useErrorPages: boolean; - displayLoadError(aError: nsresult, aURI: nsIURI, aURL: string, aFailedChannel?: nsIChannel): boolean; + displayLoadError( + aError: nsresult, + aURI: nsIURI, + aURL: string, + aFailedChannel?: nsIChannel + ): boolean; readonly failedChannel: nsIChannel; readonly previousEntryIndex: i32; readonly loadedEntryIndex: i32; @@ -1822,7 +1947,11 @@ declare global { setPrimaryContentSize(width: i32, height: i32): void; getRootShellSize(width: OutParam, height: OutParam): void; setRootShellSize(width: i32, height: i32): void; - setPersistence(aPersistPosition: boolean, aPersistSize: boolean, aPersistSizeMode: boolean): void; + setPersistence( + aPersistPosition: boolean, + aPersistSize: boolean, + aPersistSizeMode: boolean + ): void; getPersistence( aPersistPosition: OutParam, aPersistSize: OutParam, @@ -1843,7 +1972,11 @@ declare global { aExtraInfo: nsISupports, aDocListenerResult: OutParam ): nsIDocumentViewer; - createInstanceForDocument(aContainer: nsISupports, aDocument: Document, aCommand: string): nsIDocumentViewer; + createInstanceForDocument( + aContainer: nsISupports, + aDocument: Document, + aCommand: string + ): nsIDocumentViewer; } // https://searchfox.org/mozilla-central/source/docshell/base/nsIDocumentViewer.idl @@ -1868,7 +2001,9 @@ declare global { interface nsIDocumentViewer extends nsISupports, - Enums { + Enums< + typeof nsIDocumentViewer_PermitUnloadAction & typeof nsIDocumentViewer_PermitUnloadResult + > { readonly eDelayResize?: 1; container: nsIDocShell; @@ -1893,7 +2028,13 @@ declare global { isHidden: boolean; readonly deviceFullZoomForTest: float; authorStyleDisabled: boolean; - getContentSize(maxWidth: i32, maxHeight: i32, prefWidth: i32, width: OutParam, height: OutParam): void; + getContentSize( + maxWidth: i32, + maxHeight: i32, + prefWidth: i32, + width: OutParam, + height: OutParam + ): void; } // https://searchfox.org/mozilla-central/source/docshell/base/nsIDocumentViewerEdit.idl @@ -2148,7 +2289,9 @@ declare global { type nsContentPolicyType = nsIContentPolicy_nsContentPolicyType; } - interface nsIContentPolicy extends nsISupports, Enums { + interface nsIContentPolicy + extends nsISupports, + Enums { readonly REJECT_REQUEST?: -1; readonly REJECT_TYPE?: -2; readonly REJECT_SERVER?: -3; @@ -2239,10 +2382,15 @@ declare global { type IteratorType = nsIScriptableContentIterator_IteratorType; } - interface nsIScriptableContentIterator extends nsISupports, Enums { + interface nsIScriptableContentIterator + extends nsISupports, + Enums { initWithRootNode(aType: nsIScriptableContentIterator.IteratorType, aRoot: Node): void; initWithRange(aType: nsIScriptableContentIterator.IteratorType, aRange: Range): void; - initWithRangeAllowCrossShadowBoundary(aType: nsIScriptableContentIterator.IteratorType, aRange: Range): void; + initWithRangeAllowCrossShadowBoundary( + aType: nsIScriptableContentIterator.IteratorType, + aRange: Range + ): void; initWithPositions( aType: nsIScriptableContentIterator.IteratorType, aStartContainer: Node, @@ -2277,7 +2425,9 @@ declare global { type ControllerScrollFlags = nsISelectionController_ControllerScrollFlags; } - interface nsISelectionController extends nsISelectionDisplay, Enums { + interface nsISelectionController + extends nsISelectionDisplay, + Enums { readonly SELECTION_NONE?: 0; readonly SELECTION_NORMAL?: 1; readonly SELECTION_SPELLCHECK?: 2; @@ -2309,7 +2459,11 @@ declare global { setDisplaySelection(toggle: i16): void; getDisplaySelection(): i16; getSelection(type: i16): Selection; - scrollSelectionIntoView(type: i16, region: i16, flags: nsISelectionController.ControllerScrollFlags): void; + scrollSelectionIntoView( + type: i16, + region: i16, + flags: nsISelectionController.ControllerScrollFlags + ): void; repaintSelection(type: i16): void; setCaretEnabled(enabled: boolean): void; setCaretReadOnly(readOnly: boolean): void; @@ -2378,7 +2532,10 @@ declare global { }>; type nsISlowScriptDebugRemoteCallback = Callable<{ - handleSlowScriptDebug(aBrowser: EventTarget, aCallback: nsISlowScriptDebuggerStartupCallback): void; + handleSlowScriptDebug( + aBrowser: EventTarget, + aCallback: nsISlowScriptDebuggerStartupCallback + ): void; }>; interface nsISlowScriptDebug extends nsISupports { @@ -2540,7 +2697,13 @@ declare global { aTriggeringPrincipal: nsIPrincipal, aCsp?: nsIContentSecurityPolicy ): BrowsingContext; - createContentWindowInFrame(aURI: nsIURI, params: nsIOpenURIInFrameParams, aWhere: i16, aFlags: i32, aName: string): Element; + createContentWindowInFrame( + aURI: nsIURI, + params: nsIOpenURIInFrameParams, + aWhere: i16, + aFlags: i32, + aName: string + ): Element; openURI( aURI: nsIURI, aOpenWindowInfo: nsIOpenWindowInfo, @@ -2549,7 +2712,13 @@ declare global { aTriggeringPrincipal: nsIPrincipal, aCsp?: nsIContentSecurityPolicy ): BrowsingContext; - openURIInFrame(aURI: nsIURI, params: nsIOpenURIInFrameParams, aWhere: i16, aFlags: i32, aName: string): Element; + openURIInFrame( + aURI: nsIURI, + params: nsIOpenURIInFrameParams, + aWhere: i16, + aFlags: i32, + aName: string + ): Element; canClose(): boolean; readonly tabCount: u32; } @@ -2595,22 +2764,69 @@ declare global { readonly GROUP_NAME_MAX_LENGTH?: 2000; getByName(name: string, context: nsILoadContext, callback: nsIContentPrefCallback2): void; - getByDomainAndName(domain: string, name: string, context: nsILoadContext, callback: nsIContentPrefCallback2): void; - getBySubdomainAndName(domain: string, name: string, context: nsILoadContext, callback: nsIContentPrefCallback2): void; + getByDomainAndName( + domain: string, + name: string, + context: nsILoadContext, + callback: nsIContentPrefCallback2 + ): void; + getBySubdomainAndName( + domain: string, + name: string, + context: nsILoadContext, + callback: nsIContentPrefCallback2 + ): void; getGlobal(name: string, context: nsILoadContext, callback: nsIContentPrefCallback2): void; getCachedByDomainAndName(domain: string, name: string, context: nsILoadContext): nsIContentPref; - getCachedBySubdomainAndName(domain: string, name: string, context: nsILoadContext): nsIContentPref[]; + getCachedBySubdomainAndName( + domain: string, + name: string, + context: nsILoadContext + ): nsIContentPref[]; getCachedGlobal(name: string, context: nsILoadContext): nsIContentPref; - set(domain: string, name: string, value: nsIVariant, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - setGlobal(name: string, value: nsIVariant, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - removeByDomainAndName(domain: string, name: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - removeBySubdomainAndName(domain: string, name: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; + set( + domain: string, + name: string, + value: nsIVariant, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; + setGlobal( + name: string, + value: nsIVariant, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; + removeByDomainAndName( + domain: string, + name: string, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; + removeBySubdomainAndName( + domain: string, + name: string, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; removeGlobal(name: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - removeByDomain(domain: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - removeBySubdomain(domain: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; + removeByDomain( + domain: string, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; + removeBySubdomain( + domain: string, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; removeByName(name: string, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; removeAllDomains(context: nsILoadContext, callback?: nsIContentPrefCallback2): void; - removeAllDomainsSince(since: u64, context: nsILoadContext, callback?: nsIContentPrefCallback2): void; + removeAllDomainsSince( + since: u64, + context: nsILoadContext, + callback?: nsIContentPrefCallback2 + ): void; removeAllGlobals(context: nsILoadContext, callback?: nsIContentPrefCallback2): void; addObserverForName(name: string, observer: nsIContentPrefObserver): void; removeObserverForName(name: string, observer: nsIContentPrefObserver): void; @@ -2801,7 +3017,13 @@ declare global { aElement: Element, aPriority: u32 ): void; - setDisplayPortBaseForElement(aX: i32, aY: i32, aWidth: i32, aHeight: i32, aElement: Element): void; + setDisplayPortBaseForElement( + aX: i32, + aY: i32, + aWidth: i32, + aHeight: i32, + aElement: Element + ): void; getScrollbarSizes( aElement: Element, aVerticalScrollbarWidth: OutParam, @@ -2940,8 +3162,19 @@ declare global { aObserver?: nsIObserver, aElement?: Element ): void; - sendNativeTouchpadPinch(aEventPhase: u32, aScale: float, aScreenX: i32, aScreenY: i32, aModifierFlags: i32): void; - sendNativeTouchTap(aScreenX: i32, aScreenY: i32, aLongTap: boolean, aObserver?: nsIObserver): void; + sendNativeTouchpadPinch( + aEventPhase: u32, + aScale: float, + aScreenX: i32, + aScreenY: i32, + aModifierFlags: i32 + ): void; + sendNativeTouchTap( + aScreenX: i32, + aScreenY: i32, + aLongTap: boolean, + aObserver?: nsIObserver + ): void; sendNativePenInput( aPointerId: u32, aPointerState: u32, @@ -2983,7 +3216,12 @@ declare global { aModifiers: i32, aClickCount?: u32 ): void; - elementFromPoint(aX: float, aY: float, aIgnoreRootScrollFrame: boolean, aFlushLayout: boolean): Element; + elementFromPoint( + aX: float, + aY: float, + aIgnoreRootScrollFrame: boolean, + aFlushLayout: boolean + ): Element; nodesFromRect( aX: float, aY: float, @@ -2997,7 +3235,11 @@ declare global { aTransparencyThreshold?: float ): NodeList; getTranslationNodes(aRoot: Node): nsITranslationNodeList; - compareCanvases(aCanvas1: nsISupports, aCanvas2: nsISupports, aMaxDifference: OutParam): u32; + compareCanvases( + aCanvas1: nsISupports, + aCanvas2: nsISupports, + aMaxDifference: OutParam + ): u32; readonly isMozAfterPaintPending: boolean; readonly isWindowFullyOccluded: boolean; readonly isCompositorPaused: boolean; @@ -3005,18 +3247,30 @@ declare global { suppressEventHandling(aSuppress: boolean): void; disableNonTestMouseEvents(aDisable: boolean): void; getScrollXY(aFlushLayout: boolean, aScrollX: OutParam, aScrollY: OutParam): void; - getScrollXYFloat(aFlushLayout: boolean, aScrollX: OutParam, aScrollY: OutParam): void; + getScrollXYFloat( + aFlushLayout: boolean, + aScrollX: OutParam, + aScrollY: OutParam + ): void; getScrollbarSize(aFlushLayout: boolean, aWidth: OutParam, aHeight: OutParam): void; getBoundsWithoutFlushing(aElement: Element): DOMRect; getWidgetOpaqueRegion(): DOMRect[]; scrollToVisual(aOffsetX: float, aOffsetY: float, aUpdateType: i32, aScrollMode: i32): void; - getVisualViewportOffsetRelativeToLayoutViewport(aOffsetX: OutParam, aOffsetY: OutParam): void; + getVisualViewportOffsetRelativeToLayoutViewport( + aOffsetX: OutParam, + aOffsetY: OutParam + ): void; getVisualViewportOffset(aOffsetX: OutParam, aOffsetY: OutParam): void; transformRectLayoutToVisual(aX: float, aY: float, aWidth: float, aHeight: float): DOMRect; toScreenRectInCSSUnits(aX: float, aY: float, aWidth: float, aHeight: float): DOMRect; toScreenRect(aX: float, aY: float, aWidth: float, aHeight: float): DOMRect; toTopLevelWidgetRect(aX: float, aY: float, aWidth: float, aHeight: float): DOMRect; - convertFromParentProcessWidgetToLocal(aX: float, aY: float, aWidth: float, aHeight: float): DOMRect; + convertFromParentProcessWidgetToLocal( + aX: float, + aY: float, + aWidth: float, + aHeight: float + ): DOMRect; setDynamicToolbarMaxHeight(aHeightInScreen: u32): void; needsFlush(aFlushtype: i32): boolean; flushLayoutWithoutThrottledAnimations(): void; @@ -3051,7 +3305,11 @@ declare global { exitFullscreen(aDontRestoreViewSize?: boolean): void; sendSelectionSetEvent(aOffset: u32, aLength: u32, aAdditionalFlags?: u32): boolean; selectAtPoint(aX: float, aY: float, aSelectBehavior: u32): boolean; - getVisitedDependentComputedStyle(aElement: Element, aPseudoElement: string, aPropertyName: string): string; + getVisitedDependentComputedStyle( + aElement: Element, + aPseudoElement: string, + aPropertyName: string + ): string; enterModalState(): void; leaveModalState(): void; isInModalState(): boolean; @@ -3077,8 +3335,18 @@ declare global { flushApzRepaints(aElement?: Element): boolean; disableApzForElement(aElement: Element): void; zoomToFocusedInput(): void; - computeAnimationDistance(element: Element, property: string, value1: string, value2: string): double; - getUnanimatedComputedStyle(aElement: Element, aPseudoElement: string, aProperty: string, aFlushType: i32): string; + computeAnimationDistance( + element: Element, + property: string, + value1: string, + value2: string + ): double; + getUnanimatedComputedStyle( + aElement: Element, + aPseudoElement: string, + aProperty: string, + aFlushType: i32 + ): string; readonly canvasBackgroundColor: string; readonly focusedInputType: string; readonly focusedActionHint: string; @@ -3090,7 +3358,12 @@ declare global { checkAndClearDisplayListState(aElement: Element): boolean; getFileId(aFile: any): i64; getFilePath(aFile: any): string; - getFileReferences(aDatabaseName: string, aId: i64, aRefCnt?: OutParam, aDBRefCnt?: OutParam): boolean; + getFileReferences( + aDatabaseName: string, + aId: i64, + aRefCnt?: OutParam, + aDBRefCnt?: OutParam + ): boolean; flushPendingFileDeletions(): void; startPCCountProfiling(): void; stopPCCountProfiling(): void; @@ -3214,7 +3487,12 @@ declare global { readonly focusedElement: Element; getLastFocusMethod(window: mozIDOMWindowProxy): u32; setFocus(aElement: Element, aFlags: u32): void; - moveFocus(aWindow: mozIDOMWindowProxy, aStartElement: Element, aType: u32, aFlags: u32): Element; + moveFocus( + aWindow: mozIDOMWindowProxy, + aStartElement: Element, + aType: u32, + aFlags: u32 + ): Element; clearFocus(aWindow: mozIDOMWindowProxy): void; getFocusedElementForWindow( aWindow: mozIDOMWindowProxy, @@ -3248,7 +3526,13 @@ declare global { readonly width: i32; readonly height: i32; readonly text: string; - getCharacterRect(offset: i32, left: OutParam, top: OutParam, width: OutParam, height: OutParam): void; + getCharacterRect( + offset: i32, + left: OutParam, + top: OutParam, + width: OutParam, + height: OutParam + ): void; readonly succeeded: boolean; readonly notFound: boolean; readonly tentativeCaretOffsetNotFound: boolean; @@ -3281,8 +3565,14 @@ declare global { readonly browsingContext: BrowsingContext; readonly hasPresented: boolean; transmitPermissionsForPrincipal(aPrincipal: nsIPrincipal): void; - createAboutBlankDocumentViewer(aPrincipal: nsIPrincipal, aPartitionedPrincipal: nsIPrincipal): void; - maybeCancelContentJSExecution(aNavigationType: nsIRemoteTab.NavigationType, aCancelContentJSOptions?: any): void; + createAboutBlankDocumentViewer( + aPrincipal: nsIPrincipal, + aPartitionedPrincipal: nsIPrincipal + ): void; + maybeCancelContentJSExecution( + aNavigationType: nsIRemoteTab.NavigationType, + aCancelContentJSOptions?: any + ): void; } // https://searchfox.org/mozilla-central/source/dom/interfaces/base/nsIServiceWorkerManager.idl @@ -3356,15 +3646,34 @@ declare global { registerForTest(aPrincipal: nsIPrincipal, aScope: string, aScriptURL: string): Promise; registerForAddonPrincipal(aPrincipal: nsIPrincipal): Promise; getRegistrationForAddonPrincipal(aPrincipal: nsIPrincipal): nsIServiceWorkerRegistrationInfo; - wakeForExtensionAPIEvent(aExtensionBaseURL: string, aAPINamespace: string, aAPIEventName: string): Promise; - unregister(aPrincipal: nsIPrincipal, aCallback: nsIServiceWorkerUnregisterCallback, aScope: string): void; - getRegistrationByPrincipal(aPrincipal: nsIPrincipal, aScope: string): nsIServiceWorkerRegistrationInfo; + wakeForExtensionAPIEvent( + aExtensionBaseURL: string, + aAPINamespace: string, + aAPIEventName: string + ): Promise; + unregister( + aPrincipal: nsIPrincipal, + aCallback: nsIServiceWorkerUnregisterCallback, + aScope: string + ): void; + getRegistrationByPrincipal( + aPrincipal: nsIPrincipal, + aScope: string + ): nsIServiceWorkerRegistrationInfo; getScopeForUrl(aPrincipal: nsIPrincipal, aPath: string): string; getAllRegistrations(): nsIArray; removeRegistrationsByOriginAttributes(aOriginAttributes: string): void; - propagateUnregister(aPrincipal: nsIPrincipal, aCallback: nsIServiceWorkerUnregisterCallback, aScope: string): void; + propagateUnregister( + aPrincipal: nsIPrincipal, + aCallback: nsIServiceWorkerUnregisterCallback, + aScope: string + ): void; sendPushEvent(aOriginAttributes: string, aScope: string, aDataBytes?: u8[]): void; - sendPushSubscriptionChangeEvent(aOriginAttributes: string, scope: string, aOldSubscription?: nsIPushSubscription): void; + sendPushSubscriptionChangeEvent( + aOriginAttributes: string, + scope: string, + aOldSubscription?: nsIPushSubscription + ): void; addListener(aListener: nsIServiceWorkerManagerListener): void; removeListener(aListener: nsIServiceWorkerManagerListener): void; } @@ -3399,8 +3708,14 @@ declare global { readonly KEYPRESS_IS_CONSUMED?: 2; readonly hasComposition: boolean; - beginInputTransaction(aWindow: mozIDOMWindow, aCallback: nsITextInputProcessorCallback): boolean; - beginInputTransactionForTests(aWindow: mozIDOMWindow, aCallback?: nsITextInputProcessorCallback): boolean; + beginInputTransaction( + aWindow: mozIDOMWindow, + aCallback: nsITextInputProcessorCallback + ): boolean; + beginInputTransactionForTests( + aWindow: mozIDOMWindow, + aCallback?: nsITextInputProcessorCallback + ): boolean; startComposition(aKeyboardEvent?: Event, aKeyFlags?: u32): boolean; setPendingCompositionString(aString: string): void; appendClauseToPendingComposition(aLength: u32, aAttribute: u32): void; @@ -3415,8 +3730,14 @@ declare global { getModifierState(aModifierKey: string): boolean; shareModifierStateOf(aOther: nsITextInputProcessor): void; computeCodeValueOfNonPrintableKey(aKeyValue: string, aLocation?: any): string; - guessCodeValueOfPrintableKeyInUSEnglishKeyboardLayout(aKeyValue: string, aLocation?: any): string; - guessKeyCodeValueOfPrintableKeyInUSEnglishKeyboardLayout(aKeyValue: string, aLocation?: any): u32; + guessCodeValueOfPrintableKeyInUSEnglishKeyboardLayout( + aKeyValue: string, + aLocation?: any + ): string; + guessKeyCodeValueOfPrintableKeyInUSEnglishKeyboardLayout( + aKeyValue: string, + aLocation?: any + ): u32; } // https://searchfox.org/mozilla-central/source/dom/interfaces/base/nsITextInputProcessorCallback.idl @@ -3441,7 +3762,10 @@ declare global { } type nsITextInputProcessorCallback = Callable<{ - onNotify(aTextInputProcessor: nsITextInputProcessor, aNotification: nsITextInputProcessorNotification): boolean; + onNotify( + aTextInputProcessor: nsITextInputProcessor, + aNotification: nsITextInputProcessorNotification + ): boolean; }>; // https://searchfox.org/mozilla-central/source/dom/bindings/nsIScriptError.idl @@ -3557,7 +3881,11 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/credentialmanagement/nsICredentialChooserService.idl interface nsICredentialChooserService extends nsISupports { - showCredentialChooser(browsingContext: BrowsingContext, credentials: any[], callback: nsICredentialChosenCallback): void; + showCredentialChooser( + browsingContext: BrowsingContext, + credentials: any[], + callback: nsICredentialChosenCallback + ): void; cancelCredentialChooser(browsingContext: BrowsingContext): void; fetchImageToDataURI(window: mozIDOMWindow, uri: nsIURI): Promise; fetchWellKnown(uri: nsIURI, triggeringPrincipal: nsIPrincipal): Promise; @@ -3576,7 +3904,11 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/credentialmanagement/nsIIdentityCredentialPromptService.idl interface nsIIdentityCredentialPromptService extends nsISupports { - showProviderPrompt(browsingContext: BrowsingContext, identityProviders: any, identityManifests: any): Promise; + showProviderPrompt( + browsingContext: BrowsingContext, + identityProviders: any, + identityManifests: any + ): Promise; showPolicyPrompt( browsingContext: BrowsingContext, identityProvider: any, @@ -3610,7 +3942,11 @@ declare global { allowLogout: OutParam ): void; delete(rpPrincipal: nsIPrincipal, idpPrincipal: nsIPrincipal, credentialID: string): void; - connected(rpPrincipal: nsIPrincipal, idpPrincipal: nsIPrincipal, connected: OutParam): void; + connected( + rpPrincipal: nsIPrincipal, + idpPrincipal: nsIPrincipal, + connected: OutParam + ): void; disconnect(rpPrincipal: nsIPrincipal, idpPrincipal: nsIPrincipal): void; clear(): void; deleteFromBaseDomain(baseDomain: string): void; @@ -3758,7 +4094,12 @@ declare global { interface nsINotificationStorage extends nsISupports { put(aOrigin: string, aEntry: nsINotificationStorageEntry, aScope: string): void; - get(origin: string, scope: string, tag: string, aCallback: nsINotificationStorageCallback): void; + get( + origin: string, + scope: string, + tag: string, + aCallback: nsINotificationStorageCallback + ): void; delete(origin: string, id: string): void; } @@ -3966,8 +4307,17 @@ declare global { respondPayment(aResponse: nsIPaymentActionResponse): void; changeShippingAddress(requestId: string, aAddress: nsIPaymentAddress): void; changeShippingOption(requestId: string, option: string): void; - changePayerDetail(requestId: string, aPayerName: string, aPayerEmail: string, aPayerPhone: string): void; - changePaymentMethod(requestId: string, aMethodName: string, aMethodDetails: nsIMethodChangeDetails): void; + changePayerDetail( + requestId: string, + aPayerName: string, + aPayerEmail: string, + aPayerPhone: string + ): void; + changePaymentMethod( + requestId: string, + aMethodName: string, + aMethodDetails: nsIMethodChangeDetails + ): void; cleanup(): void; setTestingUIService(aUIService: nsIPaymentUIService): void; } @@ -4024,7 +4374,11 @@ declare global { interface nsIPushNotifier extends nsISupports { notifyPush(scope: string, principal: nsIPrincipal, messageId: string): void; notifyPushWithData(scope: string, principal: nsIPrincipal, messageId: string, data: u8[]): void; - notifySubscriptionChange(scope: string, principal: nsIPrincipal, oldSubscription?: nsIPushSubscription): void; + notifySubscriptionChange( + scope: string, + principal: nsIPrincipal, + oldSubscription?: nsIPushSubscription + ): void; notifySubscriptionModified(scope: string, principal: nsIPrincipal): void; notifyError(scope: string, principal: nsIPrincipal, message: string, flags: u32): void; } @@ -4071,10 +4425,27 @@ declare global { readonly subscriptionChangeTopic: string; readonly subscriptionModifiedTopic: string; subscribe(scope: string, principal: nsIPrincipal, callback: nsIPushSubscriptionCallback): void; - subscribeWithKey(scope: string, principal: nsIPrincipal, key: u8[], callback: nsIPushSubscriptionCallback): void; - unsubscribe(scope: string, principal: nsIPrincipal, callback: nsIUnsubscribeResultCallback): void; - getSubscription(scope: string, principal: nsIPrincipal, callback: nsIPushSubscriptionCallback): void; - clearForDomain(domain: string, originAttributesPattern: any, callback: nsIPushClearResultCallback): void; + subscribeWithKey( + scope: string, + principal: nsIPrincipal, + key: u8[], + callback: nsIPushSubscriptionCallback + ): void; + unsubscribe( + scope: string, + principal: nsIPrincipal, + callback: nsIUnsubscribeResultCallback + ): void; + getSubscription( + scope: string, + principal: nsIPrincipal, + callback: nsIPushSubscriptionCallback + ): void; + clearForDomain( + domain: string, + originAttributesPattern: any, + callback: nsIPushClearResultCallback + ): void; clearForPrincipal(principal: nsIPrincipal, callback: nsIPushClearResultCallback): void; } @@ -4098,7 +4469,9 @@ declare global { type Category = nsIQuotaArtificialFailure_Category; } - interface nsIQuotaArtificialFailure extends nsISupports, Enums {} + interface nsIQuotaArtificialFailure + extends nsISupports, + Enums {} // https://searchfox.org/mozilla-central/source/dom/quota/nsIQuotaCallbacks.idl @@ -4132,10 +4505,17 @@ declare global { aCreateIfNonExistent?: boolean ): nsIQuotaRequest; initializePersistentClient(aPrincipal: nsIPrincipal, aClientType: string): nsIQuotaRequest; - initializeTemporaryClient(aPersistenceType: string, aPrincipal: nsIPrincipal, aClientType: string): nsIQuotaRequest; + initializeTemporaryClient( + aPersistenceType: string, + aPrincipal: nsIPrincipal, + aClientType: string + ): nsIQuotaRequest; getFullOriginMetadata(aPersistenceType: string, aPrincipal: nsIPrincipal): nsIQuotaRequest; getUsage(aCallback: nsIQuotaUsageCallback, aGetAll?: boolean): nsIQuotaUsageRequest; - getUsageForPrincipal(aPrincipal: nsIPrincipal, aCallback: nsIQuotaUsageCallback): nsIQuotaUsageRequest; + getUsageForPrincipal( + aPrincipal: nsIPrincipal, + aCallback: nsIQuotaUsageCallback + ): nsIQuotaUsageRequest; getCachedUsageForPrincipal(aPrincipal: nsIPrincipal): nsIQuotaRequest; listOrigins(): nsIQuotaRequest; listCachedOrigins(): nsIQuotaRequest; @@ -4143,11 +4523,22 @@ declare global { clearStoragesForPrivateBrowsing(): nsIQuotaRequest; clearStoragesForOriginAttributesPattern(aPattern: string): nsIQuotaRequest; clearStoragesForPrincipal(aPrincipal: nsIPrincipal, aPersistenceType?: string): nsIQuotaRequest; - clearStoragesForClient(aPrincipal: nsIPrincipal, aClientType: string, aPersistenceType?: string): nsIQuotaRequest; - clearStoragesForOriginPrefix(aPrincipal: nsIPrincipal, aPersistenceType?: string): nsIQuotaRequest; + clearStoragesForClient( + aPrincipal: nsIPrincipal, + aClientType: string, + aPersistenceType?: string + ): nsIQuotaRequest; + clearStoragesForOriginPrefix( + aPrincipal: nsIPrincipal, + aPersistenceType?: string + ): nsIQuotaRequest; reset(): nsIQuotaRequest; resetStoragesForPrincipal(aPrincipal: nsIPrincipal, aPersistenceType?: string): nsIQuotaRequest; - resetStoragesForClient(aPrincipal: nsIPrincipal, aClientType: string, aPersistenceType?: string): nsIQuotaRequest; + resetStoragesForClient( + aPrincipal: nsIPrincipal, + aClientType: string, + aPersistenceType?: string + ): nsIQuotaRequest; persisted(aPrincipal: nsIPrincipal): nsIQuotaRequest; persist(aPrincipal: nsIPrincipal): nsIQuotaRequest; estimate(aPrincipal: nsIPrincipal): nsIQuotaRequest; @@ -4220,7 +4611,10 @@ declare global { // https://searchfox.org/mozilla-central/source/dom/interfaces/security/nsIContentSecurityManager.idl interface nsIContentSecurityManager extends nsISupports { - performSecurityCheck(aChannel: nsIChannel, aStreamListener: nsIStreamListener): nsIStreamListener; + performSecurityCheck( + aChannel: nsIChannel, + aStreamListener: nsIStreamListener + ): nsIStreamListener; } // https://searchfox.org/mozilla-central/source/dom/interfaces/security/nsIContentSecurityPolicy.idl @@ -4266,13 +4660,15 @@ declare enum nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState { declare global { namespace nsIContentSecurityPolicy { type CSPDirective = nsIContentSecurityPolicy_CSPDirective; - type RequireTrustedTypesForDirectiveState = nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState; + type RequireTrustedTypesForDirectiveState = + nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState; } interface nsIContentSecurityPolicy extends nsISerializable, Enums< - typeof nsIContentSecurityPolicy_CSPDirective & typeof nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState + typeof nsIContentSecurityPolicy_CSPDirective & + typeof nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState > { readonly VIOLATION_TYPE_EVAL?: 1; readonly VIOLATION_TYPE_WASM_EVAL?: 2; @@ -4360,14 +4756,20 @@ declare global { type ReferrerPolicyIDL = nsIReferrerInfo_ReferrerPolicyIDL; } - interface nsIReferrerInfo extends nsISerializable, Enums { + interface nsIReferrerInfo + extends nsISerializable, + Enums { readonly originalReferrer: nsIURI; readonly referrerPolicy: nsIReferrerInfo.ReferrerPolicyIDL; getReferrerPolicyString(): string; readonly sendReferrer: boolean; readonly computedReferrerSpec: string; equals(other: nsIReferrerInfo): boolean; - init(aReferrerPolicy: nsIReferrerInfo.ReferrerPolicyIDL, aSendReferrer?: boolean, aOriginalReferrer?: nsIURI): void; + init( + aReferrerPolicy: nsIReferrerInfo.ReferrerPolicyIDL, + aSendReferrer?: boolean, + aOriginalReferrer?: nsIURI + ): void; initWithDocument(aDocument: Document): void; initWithElement(aNode: Element): void; } @@ -4426,7 +4828,10 @@ declare global { readonly mimeType: string; encodeToStream(aStream: nsIOutputStream): void; encodeToString(): string; - encodeToStringWithContext(aContextString: OutParam, aInfoString: OutParam): string; + encodeToStringWithContext( + aContextString: OutParam, + aInfoString: OutParam + ): string; encodeToStringWithMaxLength(aMaxLength: u32): string; setNodeFixup(aFixup: nsIDocumentEncoderNodeFixup): void; } @@ -4493,7 +4898,12 @@ declare global { aDocumentURI: string, aPrivate?: boolean ): Storage; - getStorage(aWindow: mozIDOMWindow, aPrincipal: nsIPrincipal, aStoragePrincipal: nsIPrincipal, aPrivate?: boolean): Storage; + getStorage( + aWindow: mozIDOMWindow, + aPrincipal: nsIPrincipal, + aStoragePrincipal: nsIPrincipal, + aPrivate?: boolean + ): Storage; cloneStorage(aStorageToCloneFrom: Storage): void; checkStorage(aPrincipal: nsIPrincipal, aStorage: Storage): boolean; } @@ -4620,7 +5030,14 @@ declare global { } interface nsISpeechService extends nsISupports { - speak(aText: string, aUri: string, aVolume: float, aRate: float, aPitch: float, aTask: nsISpeechTask): void; + speak( + aText: string, + aUri: string, + aVolume: float, + aRate: float, + aPitch: float, + aTask: nsISpeechTask + ): void; } // https://searchfox.org/mozilla-central/source/dom/media/webspeech/synth/nsISynthVoiceRegistry.idl @@ -4771,7 +5188,10 @@ declare global { removeItemFromSelection(item: nsIDOMXULSelectControlItemElement): void; toggleItemSelection(item: nsIDOMXULSelectControlItemElement): void; selectItem(item: nsIDOMXULSelectControlItemElement): void; - selectItemRange(startItem: nsIDOMXULSelectControlItemElement, item: nsIDOMXULSelectControlItemElement): void; + selectItemRange( + startItem: nsIDOMXULSelectControlItemElement, + item: nsIDOMXULSelectControlItemElement + ): void; selectAll(): void; clearSelection(): void; readonly selectedCount: i32; @@ -4823,7 +5243,13 @@ declare global { readonly ZONE_INTERNET?: 3; readonly ZONE_RESTRICTED?: 4; - downloadDone(aSource: nsIURI, aReferrer: nsIURI, aTarget: nsIFile, aContentType: string, aIsPrivate: boolean): Promise; + downloadDone( + aSource: nsIURI, + aReferrer: nsIURI, + aTarget: nsIFile, + aContentType: string, + aIsPrivate: boolean + ): Promise; mapUrlToZone(aURL: string): u32; } @@ -4879,7 +5305,11 @@ declare global { sourceAttrValue: string, aSuppressTransaction: boolean ): void; - removeAttributeOrEquivalent(element: Element, sourceAttrName: string, aSuppressTransaction: boolean): void; + removeAttributeOrEquivalent( + element: Element, + sourceAttrName: string, + aSuppressTransaction: boolean + ): void; flags: u32; contentsMIMEType: string; readonly isDocumentEditable: boolean; @@ -4956,7 +5386,11 @@ declare global { readonly FILTERTYPE_MAIL?: 2; canSpellCheck(): boolean; - InitSpellChecker(editor: nsIEditor, enableSelectionChecking: boolean, callback?: nsIEditorSpellCheckCallback): void; + InitSpellChecker( + editor: nsIEditor, + enableSelectionChecking: boolean, + callback?: nsIEditorSpellCheckCallback + ): void; GetNextMisspelledWord(): string; GetSuggestedWord(): string; CheckCurrentWord(suggestedWord: string): boolean; @@ -5013,8 +5447,18 @@ declare global { getParagraphState(aMixed: OutParam): string; getFontFaceState(aMixed: OutParam): string; getHighlightColorState(aMixed: OutParam): string; - getListState(aMixed: OutParam, aOL: OutParam, aUL: OutParam, aDL: OutParam): void; - getListItemState(aMixed: OutParam, aLI: OutParam, aDT: OutParam, aDD: OutParam): void; + getListState( + aMixed: OutParam, + aOL: OutParam, + aUL: OutParam, + aDL: OutParam + ): void; + getListItemState( + aMixed: OutParam, + aLI: OutParam, + aDT: OutParam, + aDD: OutParam + ): void; getAlignment(aMixed: OutParam, aAlign: OutParam): void; makeOrChangeList(aListType: string, entireList: boolean, aBulletType: string): void; removeList(aListType: string): void; @@ -5077,8 +5521,16 @@ declare global { joinTableCells(aMergeNonContiguousContents: boolean): void; splitTableCell(): void; normalizeTable(aTable: Element): void; - getCellIndexes(aCellElement: Element, aRowIndex: OutParam, aColumnIndex: OutParam): void; - getTableSize(aTableOrElementInTable: Element, aRowCount: OutParam, aColCount: OutParam): void; + getCellIndexes( + aCellElement: Element, + aRowIndex: OutParam, + aColumnIndex: OutParam + ): void; + getTableSize( + aTableOrElementInTable: Element, + aRowCount: OutParam, + aColCount: OutParam + ): void; getCellAt(aTableElement: Element, aRowIndex: i32, aColumnIndex: i32): Element; getCellDataAt( aTableElement: Element, @@ -5200,7 +5652,10 @@ declare global { externalProtocolHandlerExists(aProtocolScheme: string): boolean; isExposedProtocol(aProtocolScheme: string): boolean; getProtocolHandlerInfo(aProtocolScheme: string): nsIHandlerInfo; - getProtocolHandlerInfoFromOS(aProtocolScheme: string, aFound: OutParam): nsIHandlerInfo; + getProtocolHandlerInfoFromOS( + aProtocolScheme: string, + aFound: OutParam + ): nsIHandlerInfo; setProtocolHandlerDefaults(aHandlerInfo: nsIHandlerInfo, aOSHandlerExists: boolean): void; loadURI( aURI: nsIURI, @@ -5237,7 +5692,11 @@ declare global { readonly REASON_SERVERREQUEST?: 1; readonly REASON_TYPESNIFFED?: 2; - show(aLauncher: nsIHelperAppLauncher, aWindowContext: nsIInterfaceRequestor, aReason: u32): void; + show( + aLauncher: nsIHelperAppLauncher, + aWindowContext: nsIInterfaceRequestor, + aReason: u32 + ): void; promptForSaveToFileAsync( aLauncher: nsIHelperAppLauncher, aWindowContext: nsIInterfaceRequestor, @@ -5286,7 +5745,11 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/glean/xpcom/nsIFOG.idl interface nsIFOG extends nsISupports { - initializeFOG(aDataPathOverride?: string, aAppIdOverride?: string, aDisableInternalPings?: boolean): void; + initializeFOG( + aDataPathOverride?: string, + aAppIdOverride?: string, + aDisableInternalPings?: boolean + ): void; registerCustomPings(): void; setLogPings(aEnableLogPings: boolean): void; setTagPings(aDebugTag: string): void; @@ -5360,17 +5823,35 @@ declare global { sanitize(src: string, flags: u32): string; removeConditionalCSS(src: string): string; convertToPlainText(src: string, flags: u32, wrapCol: u32): string; - parseFragment(fragment: string, flags: u32, isXML: boolean, baseURI: nsIURI, element: Element): DocumentFragment; + parseFragment( + fragment: string, + flags: u32, + isXML: boolean, + baseURI: nsIURI, + element: Element + ): DocumentFragment; } // https://searchfox.org/mozilla-central/source/parser/htmlparser/nsIExpatSink.idl interface nsIExpatSink extends nsISupports { - HandleStartElement(aName: string, aAtts: string[], aAttsCount: u32, aLineNumber: u32, aColumnNumber: u32): void; + HandleStartElement( + aName: string, + aAtts: string[], + aAttsCount: u32, + aLineNumber: u32, + aColumnNumber: u32 + ): void; HandleEndElement(aName: string): void; HandleComment(aCommentText: string): void; HandleCDataSection(aData: string, aLength: u32): void; - HandleDoctypeDecl(aSubset: string, aName: string, aSystemId: string, aPublicId: string, aCatalogData: nsISupports): void; + HandleDoctypeDecl( + aSubset: string, + aName: string, + aSystemId: string, + aPublicId: string, + aCatalogData: nsISupports + ): void; HandleCharacterData(aData: string, aLength: u32): void; HandleProcessingInstruction(aTarget: string, aData: string): void; HandleXMLDeclaration(aVersion: string, aEncoding: string, aStandalone: i32): void; @@ -5548,9 +6029,25 @@ declare global { readonly INPUT_FORMAT_RGBA?: 1; readonly INPUT_FORMAT_HOSTARGB?: 2; - initFromData(data: u8[], length: u32, width: u32, height: u32, stride: u32, inputFormat: u32, outputOptions: string): void; + initFromData( + data: u8[], + length: u32, + width: u32, + height: u32, + stride: u32, + inputFormat: u32, + outputOptions: string + ): void; startImageEncode(width: u32, height: u32, inputFormat: u32, outputOptions: string): void; - addImageFrame(data: u8[], length: u32, width: u32, height: u32, stride: u32, frameFormat: u32, frameOptions: string): void; + addImageFrame( + data: u8[], + length: u32, + width: u32, + height: u32, + stride: u32, + frameFormat: u32, + frameOptions: string + ): void; endImageEncode(): void; } @@ -5666,7 +6163,11 @@ declare global { aCallback: imgIContainerCallback, aEventTarget: nsIEventTarget ): void; - encodeImage(aContainer: imgIContainer, aMimeType: string, outputOptions?: string): nsIInputStream; + encodeImage( + aContainer: imgIContainer, + aMimeType: string, + outputOptions?: string + ): nsIInputStream; encodeScaledImage( aContainer: imgIContainer, aMimeType: string, @@ -5817,7 +6318,9 @@ declare global { type RecoveryStrategy = nsIKeyValueService_RecoveryStrategy; } - interface nsIKeyValueService extends nsISupports, Enums { + interface nsIKeyValueService + extends nsISupports, + Enums { getOrCreate(callback: nsIKeyValueDatabaseCallback, path: string, name: string): void; getOrCreateWithOptions( callback: nsIKeyValueDatabaseCallback, @@ -5861,8 +6364,12 @@ declare global { } interface nsIKeyValueDatabaseImportOptions extends nsISupports { - setConflictPolicy(conflictPolicy: nsIKeyValueImporter.ConflictPolicy): nsIKeyValueDatabaseImportOptions; - setCleanupPolicy(cleanupPolicy: nsIKeyValueImporter.CleanupPolicy): nsIKeyValueDatabaseImportOptions; + setConflictPolicy( + conflictPolicy: nsIKeyValueImporter.ConflictPolicy + ): nsIKeyValueDatabaseImportOptions; + setCleanupPolicy( + cleanupPolicy: nsIKeyValueImporter.CleanupPolicy + ): nsIKeyValueDatabaseImportOptions; } interface nsIKeyValueDatabase extends nsISupports { @@ -5927,7 +6434,13 @@ declare global { aAllowScrollOriginDowngrade: OutParam, aRes: OutParam ): void; - addNewPresState(aKey: string, aScrollX: float, aScrollY: float, aAllowScrollOriginDowngrade: boolean, aRes: float): void; + addNewPresState( + aKey: string, + aScrollX: float, + aScrollY: float, + aAllowScrollOriginDowngrade: boolean, + aRes: float + ): void; } // https://searchfox.org/mozilla-central/source/layout/base/nsIPreloadedStyleSheet.idl @@ -6028,7 +6541,12 @@ declare global { readonly appLocalesAsBCP47: string[]; readonly regionalPrefsLocales: string[]; readonly webExposedLocales: string[]; - negotiateLanguages(aRequested: string[], aAvailable: string[], aDefaultLocale?: string, langNegStrategy?: i32): string[]; + negotiateLanguages( + aRequested: string[], + aAvailable: string[], + aDefaultLocale?: string, + langNegStrategy?: i32 + ): string[]; readonly appLocaleAsLangTag: string; readonly appLocaleAsBCP47: string; requestedLocales: string[]; @@ -6165,7 +6683,11 @@ declare global { autoFilledLoginGuid?: string, possibleValues?: any ): nsIPromptInstance; - promptToChangePasswordWithUsernames(aBrowser: Element, logins: nsILoginInfo[], aNewLogin: nsILoginInfo): nsIPromptInstance; + promptToChangePasswordWithUsernames( + aBrowser: Element, + logins: nsILoginInfo[], + aNewLogin: nsILoginInfo + ): nsIPromptInstance; } // https://searchfox.org/mozilla-central/source/toolkit/components/passwordmgr/nsILoginMetaInfo.idl @@ -6292,9 +6814,18 @@ declare global { getDefaultTypeFromURI(aURI: nsIURI): string; getTypeFromFile(aFile: nsIFile): string; getPrimaryExtension(aMIMEType: string, aFileExt: string): string; - getMIMEInfoFromOS(aType: string, aFileExtension: string, aFound: OutParam): nsIMIMEInfo; + getMIMEInfoFromOS( + aType: string, + aFileExtension: string, + aFound: OutParam + ): nsIMIMEInfo; updateDefaultAppInfo(aMIMEInfo: nsIMIMEInfo): void; - getValidFileName(aChannel: nsIChannel, aType: string, aOriginalURI: nsIURI, aFlags: u32): string; + getValidFileName( + aChannel: nsIChannel, + aType: string, + aOriginalURI: nsIURI, + aFlags: u32 + ): string; validateFileNameForSaving(aFileName: string, aType: string, aFlags: u32): string; } @@ -6598,10 +7129,13 @@ declare enum nsICacheInfoChannel_PreferredAlternativeDataDeliveryType { declare global { namespace nsICacheInfoChannel { - type PreferredAlternativeDataDeliveryType = nsICacheInfoChannel_PreferredAlternativeDataDeliveryType; + type PreferredAlternativeDataDeliveryType = + nsICacheInfoChannel_PreferredAlternativeDataDeliveryType; } - interface nsICacheInfoChannel extends nsISupports, Enums { + interface nsICacheInfoChannel + extends nsISupports, + Enums { readonly cacheTokenFetchCount: u32; readonly cacheTokenExpirationTime: u32; isFromCache(): boolean; @@ -6789,7 +7323,9 @@ declare global { type ClassificationFlags = nsIClassifiedChannel_ClassificationFlags; } - interface nsIClassifiedChannel extends nsISupports, Enums { + interface nsIClassifiedChannel + extends nsISupports, + Enums { setMatchedInfo(aList: string, aProvider: string, aFullHash: string): void; readonly matchedList: string; readonly matchedProvider: string; @@ -6827,7 +7363,13 @@ declare global { requestHttpConnections(cb: nsINetDashboardCallback): void; requestWebsocketConnections(cb: nsINetDashboardCallback): void; requestDNSInfo(cb: nsINetDashboardCallback): void; - requestConnection(aHost: string, aPort: u32, aProtocol: string, aTimeout: u32, cb: nsINetDashboardCallback): void; + requestConnection( + aHost: string, + aPort: u32, + aProtocol: string, + aTimeout: u32, + cb: nsINetDashboardCallback + ): void; enableLogging: boolean; requestDNSLookup(aHost: string, cb: nsINetDashboardCallback): void; requestDNSHTTPSRRLookup(aHost: string, cb: nsINetDashboardCallback): void; @@ -6844,7 +7386,12 @@ declare global { } interface nsIDownloadObserver extends nsISupports { - onDownloadComplete(downloader: nsIDownloader, request: nsIRequest, status: nsresult, result: nsIFile): void; + onDownloadComplete( + downloader: nsIDownloader, + request: nsIRequest, + status: nsresult, + result: nsIFile + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIEncodedChannel.idl @@ -6977,7 +7524,12 @@ declare global { ): nsIChannel; readonly socketProcessLaunched: boolean; readonly socketProcessId: u64; - registerProtocolHandler(aScheme: string, aHandler: nsIProtocolHandler, aProtocolFlags: u32, aDefaultPort: i32): void; + registerProtocolHandler( + aScheme: string, + aHandler: nsIProtocolHandler, + aProtocolFlags: u32, + aDefaultPort: i32 + ): void; unregisterProtocolHandler(aScheme: string): void; setSimpleURIUnknownRemoteSchemes(aRemoteSchemes: string[]): void; addEssentialDomainMapping(aFrom: string, aTo: string): void; @@ -6987,7 +7539,13 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/base/nsIIncrementalDownload.idl interface nsIIncrementalDownload extends nsIRequest { - init(uri: nsIURI, destination: nsIFile, chunkSize: i32, intervalInSeconds: i32, extraHeaders: string): void; + init( + uri: nsIURI, + destination: nsIFile, + chunkSize: i32, + intervalInSeconds: i32, + extraHeaders: string + ): void; readonly URI: nsIURI; readonly finalURI: nsIURI; readonly destination: nsIFile; @@ -7405,8 +7963,16 @@ declare global { readonly ESCAPE_URL_SKIP_CONTROL?: 32768; readonly ESCAPE_URL_EXT_HANDLER?: 131072; - parseRequestContentType(aTypeHeader: string, aCharset: OutParam, aHadCharset: OutParam): string; - parseResponseContentType(aTypeHeader: string, aCharset: OutParam, aHadCharset: OutParam): string; + parseRequestContentType( + aTypeHeader: string, + aCharset: OutParam, + aHadCharset: OutParam + ): string; + parseResponseContentType( + aTypeHeader: string, + aCharset: OutParam, + aHadCharset: OutParam + ): string; protocolHasFlags(aURI: nsIURI, aFlag: u32): boolean; URIChainHasFlags(aURI: nsIURI, aFlags: u32): boolean; escapeString(aString: string, aEscapeType: u32): string; @@ -7436,7 +8002,9 @@ declare global { type ConnectivityState = nsINetworkConnectivityService_ConnectivityState; } - interface nsINetworkConnectivityService extends nsISupports, Enums { + interface nsINetworkConnectivityService + extends nsISupports, + Enums { DNSv4: nsINetworkConnectivityService.ConnectivityState; DNSv6: nsINetworkConnectivityService.ConnectivityState; DNS_HTTPS: nsINetworkConnectivityService.ConnectivityState; @@ -7533,7 +8101,12 @@ declare global { originAttributes: any, verifier: nsINetworkPredictorVerifier ): void; - learn(targetURI: nsIURI, sourceURI: nsIURI, reason: PredictorLearnReason, originAttributes: any): void; + learn( + targetURI: nsIURI, + sourceURI: nsIURI, + reason: PredictorLearnReason, + originAttributes: any + ): void; reset(): void; } @@ -7588,9 +8161,24 @@ declare global { getAllWithTypePrefix(prefix: string): nsIPermission[]; getAllByTypes(types: string[]): nsIPermission[]; getAllByTypeSince(type: string, since: i64): nsIPermission[]; - addFromPrincipal(principal: nsIPrincipal, type: string, permission: u32, expireType?: u32, expireTime?: i64): void; - testAddFromPrincipalByTime(principal: nsIPrincipal, type: string, permission: u32, modificationTime: i64): void; - addFromPrincipalAndPersistInPrivateBrowsing(principal: nsIPrincipal, type: string, permission: u32): void; + addFromPrincipal( + principal: nsIPrincipal, + type: string, + permission: u32, + expireType?: u32, + expireTime?: i64 + ): void; + testAddFromPrincipalByTime( + principal: nsIPrincipal, + type: string, + permission: u32, + modificationTime: i64 + ): void; + addFromPrincipalAndPersistInPrivateBrowsing( + principal: nsIPrincipal, + type: string, + permission: u32 + ): void; addDefaultFromPrincipal(principal: nsIPrincipal, type: string, permission: u32): void; removeFromPrincipal(principal: nsIPrincipal, type: string): void; removePermission(perm: nsIPermission): void; @@ -7605,7 +8193,11 @@ declare global { testExactPermanentPermission(principal: nsIPrincipal, type: string): u32; getPermissionObject(principal: nsIPrincipal, type: string, exactHost: boolean): nsIPermission; readonly all: nsIPermission[]; - removePermissionsWithAttributes(patternAsJSON: string, typeInclusions: string[], typeExceptions: string[]): void; + removePermissionsWithAttributes( + patternAsJSON: string, + typeInclusions: string[], + typeExceptions: string[] + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIPrivateBrowsingChannel.idl @@ -7652,9 +8244,19 @@ declare global { readonly MODAL_TYPE_INTERNAL_WINDOW?: 4; alert(dialogTitle: string, text: string): void; - alertCheck(dialogTitle: string, text: string, checkMsg: string, checkValue: InOutParam): void; + alertCheck( + dialogTitle: string, + text: string, + checkMsg: string, + checkValue: InOutParam + ): void; confirm(dialogTitle: string, text: string): boolean; - confirmCheck(dialogTitle: string, text: string, checkMsg: string, checkValue: InOutParam): boolean; + confirmCheck( + dialogTitle: string, + text: string, + checkMsg: string, + checkValue: InOutParam + ): boolean; confirmEx( dialogTitle: string, text: string, @@ -7679,7 +8281,12 @@ declare global { username: InOutParam, password: InOutParam ): boolean; - select(dialogTitle: string, text: string, selectList: string[], outSelection: OutParam): boolean; + select( + dialogTitle: string, + text: string, + selectList: string[], + outSelection: OutParam + ): boolean; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIProtocolHandler.idl @@ -7724,7 +8331,12 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/base/nsIProtocolProxyCallback.idl interface nsIProtocolProxyCallback extends nsISupports { - onProxyAvailable(aRequest: nsICancelable, aChannel: nsIChannel, aProxyInfo: nsIProxyInfo, aStatus: nsresult): void; + onProxyAvailable( + aRequest: nsICancelable, + aChannel: nsIChannel, + aProxyInfo: nsIProxyInfo, + aStatus: nsresult + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIProtocolProxyFilter.idl @@ -7738,7 +8350,11 @@ declare global { } interface nsIProtocolProxyChannelFilter extends nsISupports { - applyFilter(aChannel: nsIChannel, aProxy: nsIProxyInfo, aCallback: nsIProxyProtocolFilterResult): void; + applyFilter( + aChannel: nsIChannel, + aProxy: nsIProxyInfo, + aCallback: nsIProxyProtocolFilterResult + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIProtocolProxyService.idl @@ -8107,7 +8723,12 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/base/nsISpeculativeConnect.idl interface nsISpeculativeConnect extends nsISupports { - speculativeConnect(aURI: nsIURI, aPrincipal: nsIPrincipal, aCallbacks: nsIInterfaceRequestor, aAnonymous: boolean): void; + speculativeConnect( + aURI: nsIURI, + aPrincipal: nsIPrincipal, + aCallbacks: nsIInterfaceRequestor, + aAnonymous: boolean + ): void; speculativeConnectWithOriginAttributes( aURI: nsIURI, originAttributes: any, @@ -8125,20 +8746,35 @@ declare global { } interface nsIStandardURLMutator extends nsISupports { - init(aUrlType: u32, aDefaultPort: i32, aSpec: string, aOriginCharset: string, aBaseURI: nsIURI): nsIURIMutator; + init( + aUrlType: u32, + aDefaultPort: i32, + aSpec: string, + aOriginCharset: string, + aBaseURI: nsIURI + ): nsIURIMutator; setDefaultPort(aNewDefaultPort: i32): nsIURIMutator; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIStreamListener.idl interface nsIStreamListener extends nsIRequestObserver { - onDataAvailable(aRequest: nsIRequest, aInputStream: nsIInputStream, aOffset: u64, aCount: u32): void; + onDataAvailable( + aRequest: nsIRequest, + aInputStream: nsIInputStream, + aOffset: u64, + aCount: u32 + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIStreamListenerTee.idl interface nsIStreamListenerTee extends nsIThreadRetargetableStreamListener { - init(listener: nsIStreamListener, sink: nsIOutputStream, requestObserver?: nsIRequestObserver): void; + init( + listener: nsIStreamListener, + sink: nsIOutputStream, + requestObserver?: nsIRequestObserver + ): void; initAsync( listener: nsIStreamListener, eventTarget: nsIEventTarget, @@ -8150,7 +8786,13 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/base/nsIStreamLoader.idl interface nsIStreamLoaderObserver extends nsISupports { - onStreamComplete(loader: nsIStreamLoader, ctxt: nsISupports, status: nsresult, resultLength: u32, result: u8[]): void; + onStreamComplete( + loader: nsIStreamLoader, + ctxt: nsISupports, + status: nsresult, + resultLength: u32, + result: u8[] + ): void; } interface nsIStreamLoader extends nsIThreadRetargetableStreamListener { @@ -8299,7 +8941,10 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/base/nsITraceableChannel.idl interface nsITraceableChannel extends nsISupports { - setNewListener(aListener: nsIStreamListener, aMustApplyContentConversion?: boolean): nsIStreamListener; + setNewListener( + aListener: nsIStreamListener, + aMustApplyContentConversion?: boolean + ): nsIStreamListener; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsITransport.idl @@ -8317,13 +8962,23 @@ declare global { } interface nsITransportEventSink extends nsISupports { - onTransportStatus(aTransport: nsITransport, aStatus: nsresult, aProgress: i64, aProgressMax: i64): void; + onTransportStatus( + aTransport: nsITransport, + aStatus: nsresult, + aProgress: i64, + aProgressMax: i64 + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/base/nsIUDPSocket.idl interface nsIUDPSocket extends nsISupports { - init(aPort: i32, aLoopbackOnly: boolean, aPrincipal: nsIPrincipal, aAddressReuse?: boolean): void; + init( + aPort: i32, + aLoopbackOnly: boolean, + aPrincipal: nsIPrincipal, + aAddressReuse?: boolean + ): void; init2(aAddr: string, aPort: i32, aPrincipal: nsIPrincipal, aAddressReuse?: boolean): void; close(): void; asyncListen(aListener: nsIUDPSocketListener): void; @@ -8644,10 +9299,20 @@ declare global { readonly OPEN_SECRETLY?: 32; readonly OPEN_INTERCEPTED?: 64; - asyncOpenURI(aURI: nsIURI, aIdExtension: string, aFlags: u32, aCallback: nsICacheEntryOpenCallback): void; + asyncOpenURI( + aURI: nsIURI, + aIdExtension: string, + aFlags: u32, + aCallback: nsICacheEntryOpenCallback + ): void; openTruncate(aURI: nsIURI, aIdExtension: string): nsICacheEntry; exists(aURI: nsIURI, aIdExtension: string): boolean; - getCacheIndexEntryAttrs(aURI: nsIURI, aIdExtension: string, aHasAltData: OutParam, aSizeInKB: OutParam): void; + getCacheIndexEntryAttrs( + aURI: nsIURI, + aIdExtension: string, + aHasAltData: OutParam, + aSizeInKB: OutParam + ): void; asyncDoomURI(aURI: nsIURI, aIdExtension: string, aCallback: nsICacheEntryDoomCallback): void; asyncEvictStorage(aCallback: nsICacheEntryDoomCallback): void; asyncVisitStorage(aVisitor: nsICacheStorageVisitor, aVisitEntries: boolean): void; @@ -8680,7 +9345,12 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/cache2/nsICacheStorageVisitor.idl interface nsICacheStorageVisitor extends nsISupports { - onCacheStorageInfo(aEntryCount: u32, aConsumption: u64, aCapacity: u64, aDiskDirectory: nsIFile): void; + onCacheStorageInfo( + aEntryCount: u32, + aConsumption: u64, + aCapacity: u64, + aDiskDirectory: nsIFile + ): void; onCacheEntryInfo( aURI: nsIURI, aIdEnhance: string, @@ -8785,13 +9455,19 @@ declare global { cookieExists(aHost: string, aPath: string, aName: string, aOriginAttributes: any): boolean; countCookiesFromHost(aHost: string): u32; getCookiesFromHost(aHost: string, aOriginAttributes: any, aSorted?: boolean): nsICookie[]; - getCookiesWithOriginAttributes(aPattern: string, aHost?: string, aSorted?: boolean): nsICookie[]; + getCookiesWithOriginAttributes( + aPattern: string, + aHost?: string, + aSorted?: boolean + ): nsICookie[]; removeCookiesWithOriginAttributes(aPattern: string, aHost?: string): void; removeCookiesFromExactHost(aHost: string, aPattern: string): void; removeAllSince(aSinceWhen: i64): Promise; getCookiesSince(aSinceWhen: i64): nsICookie[]; addThirdPartyCookieBlockingExceptions(aExcpetions: nsIThirdPartyCookieExceptionEntry[]): void; - removeThirdPartyCookieBlockingExceptions(aExceptions: nsIThirdPartyCookieExceptionEntry[]): void; + removeThirdPartyCookieBlockingExceptions( + aExceptions: nsIThirdPartyCookieExceptionEntry[] + ): void; testGet3PCBExceptions(): string[]; } @@ -8924,7 +9600,11 @@ declare global { interface nsIDNSHTTPSSVCRecord extends nsISupports { readonly records: nsISVCBRecord[]; GetServiceModeRecord(aNoHttp2: boolean, aNoHttp3: boolean): nsISVCBRecord; - GetServiceModeRecordWithCname(aNoHttp2: boolean, aNoHttp3: boolean, aCName: string): nsISVCBRecord; + GetServiceModeRecordWithCname( + aNoHttp2: boolean, + aNoHttp3: boolean, + aCName: string + ): nsISVCBRecord; readonly hasIPAddresses: boolean; readonly allRecordsExcluded: boolean; readonly ttl: u32; @@ -9050,7 +9730,11 @@ declare global { aReason: nsresult, aOriginAttributes?: any ): void; - resolve(aHostName: string, aFlags: nsIDNSService.DNSFlags, aOriginAttributes?: any): nsIDNSRecord; + resolve( + aHostName: string, + aFlags: nsIDNSService.DNSFlags, + aOriginAttributes?: any + ): nsIDNSRecord; clearCache(aTrrToo: boolean): void; reloadParentalControlEnabled(): void; setDetectedTrrURI(aURI: string): void; @@ -9347,7 +10031,11 @@ declare global { readonly encodedBodySize: u64; getRequestHeader(aHeader: string): string; setRequestHeader(aHeader: string, aValue: string, aMerge: boolean): void; - setNewReferrerInfo(aUrl: string, aPolicy: nsIReferrerInfo.ReferrerPolicyIDL, aSendReferrer: boolean): void; + setNewReferrerInfo( + aUrl: string, + aPolicy: nsIReferrerInfo.ReferrerPolicyIDL, + aSendReferrer: boolean + ): void; setEmptyRequestHeader(aHeader: string): void; visitRequestHeaders(aVisitor: nsIHttpHeaderVisitor): void; visitNonDefaultRequestHeaders(aVisitor: nsIHttpHeaderVisitor): void; @@ -9371,7 +10059,12 @@ declare global { topLevelContentWindowId: u64; browserId: u64; logBlockedCORSRequest(aMessage: string, aCategory: string, aIsWarning: boolean): void; - logMimeTypeMismatch(aMessageName: string, aWarning: boolean, aURL: string, aContentType: string): void; + logMimeTypeMismatch( + aMessageName: string, + aWarning: boolean, + aURL: string, + aContentType: string + ): void; classicScriptHintCharset: string; documentCharacterSet: string; requestObserversCalled: boolean; @@ -9614,7 +10307,13 @@ declare global { scanTXT(text: string, whattodo: u32): string; scanHTML(text: string, whattodo: u32): string; citeLevelTXT(line: string, logLineStart: OutParam): u32; - findURLInPlaintext(text: string, aLength: i32, aPos: i32, aStartPos: OutParam, aEndPos: OutParam): void; + findURLInPlaintext( + text: string, + aLength: i32, + aPos: i32, + aStartPos: OutParam, + aEndPos: OutParam + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/streamconv/nsIDirIndex.idl @@ -9644,8 +10343,18 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/streamconv/nsIStreamConverter.idl interface nsIStreamConverter extends nsIThreadRetargetableStreamListener { - convert(aFromStream: nsIInputStream, aFromType: string, aToType: string, aCtxt: nsISupports): nsIInputStream; - asyncConvertData(aFromType: string, aToType: string, aListener: nsIStreamListener, aCtxt: nsISupports): void; + convert( + aFromStream: nsIInputStream, + aFromType: string, + aToType: string, + aCtxt: nsISupports + ): nsIInputStream; + asyncConvertData( + aFromType: string, + aToType: string, + aListener: nsIStreamListener, + aCtxt: nsISupports + ): void; maybeRetarget(request: nsIRequest): void; getConvertedType(aFromType: string, aChannel: nsIChannel): string; } @@ -9655,7 +10364,12 @@ declare global { interface nsIStreamConverterService extends nsISupports { canConvert(aFromType: string, aToType: string): boolean; convertedType(aFromType: string, aChannel: nsIChannel): string; - convert(aFromStream: nsIInputStream, aFromType: string, aToType: string, aContext: nsISupports): nsIInputStream; + convert( + aFromStream: nsIInputStream, + aFromType: string, + aToType: string, + aContext: nsISupports + ): nsIInputStream; asyncConvertData( aFromType: string, aToType: string, @@ -9856,7 +10570,10 @@ declare global { onResetReceived(aStreamId: u64, aError: nsresult): void; onDatagramReceived(aData: u8[]): void; onMaxDatagramSize(aSize: u64): void; - onOutgoingDatagramOutCome(aId: u64, aOutCome: WebTransportSessionEventListener.DatagramOutcome): void; + onOutgoingDatagramOutCome( + aId: u64, + aOutCome: WebTransportSessionEventListener.DatagramOutcome + ): void; } interface nsIWebTransportStreamCallback extends nsISupports { @@ -10116,7 +10833,11 @@ declare global { // https://searchfox.org/mozilla-central/source/security/manager/ssl/nsICertificateDialogs.idl interface nsICertificateDialogs extends nsISupports { - confirmDownloadCACert(ctx: nsIInterfaceRequestor, cert: nsIX509Cert, trust: OutParam): boolean; + confirmDownloadCACert( + ctx: nsIInterfaceRequestor, + cert: nsIX509Cert, + trust: OutParam + ): boolean; setPKCS12FilePassword(ctx: nsIInterfaceRequestor, password: OutParam): boolean; getPKCS12FilePassword(ctx: nsIInterfaceRequestor, password: OutParam): boolean; } @@ -10124,7 +10845,10 @@ declare global { // https://searchfox.org/mozilla-central/source/security/manager/ssl/nsIClientAuthDialogService.idl type nsIClientAuthDialogCallback = Callable<{ - certificateChosen(cert: nsIX509Cert, rememberDuration: nsIClientAuthRememberService.Duration): void; + certificateChosen( + cert: nsIX509Cert, + rememberDuration: nsIClientAuthRememberService.Duration + ): void; }>; interface nsIClientAuthDialogService extends nsISupports { @@ -10156,7 +10880,9 @@ declare global { type Duration = nsIClientAuthRememberService_Duration; } - interface nsIClientAuthRememberService extends nsISupports, Enums { + interface nsIClientAuthRememberService + extends nsISupports, + Enums { forgetRememberedDecision(key: string): void; getDecisions(): nsIClientAuthRememberRecord[]; rememberDecisionScriptable( @@ -10165,7 +10891,11 @@ declare global { aClientCert: nsIX509Cert, aDuration: nsIClientAuthRememberService.Duration ): void; - hasRememberedDecisionScriptable(aHostName: string, originAttributes: any, aCertDBKey: OutParam): boolean; + hasRememberedDecisionScriptable( + aHostName: string, + originAttributes: any, + aCertDBKey: OutParam + ): boolean; clearRememberedDecisions(): void; deleteDecisionsByHost(aHostName: string, aOriginAttributes: any): void; } @@ -10217,7 +10947,9 @@ declare global { type DataStorage = nsIDataStorageManager_DataStorage; } - interface nsIDataStorageManager extends nsISupports, Enums { + interface nsIDataStorageManager + extends nsISupports, + Enums { get(dataStorage: nsIDataStorageManager.DataStorage): nsIDataStorage; } } // global @@ -10309,7 +11041,11 @@ declare global { // https://searchfox.org/mozilla-central/source/security/manager/ssl/nsIOSReauthenticator.idl interface nsIOSReauthenticator extends nsISupports { - asyncReauthenticateUser(prompt: string, caption: string, parentWindow: mozIDOMWindow): Promise; + asyncReauthenticateUser( + prompt: string, + caption: string, + parentWindow: mozIDOMWindow + ): Promise; } // https://searchfox.org/mozilla-central/source/security/manager/ssl/nsIPK11Token.idl @@ -10352,7 +11088,12 @@ declare global { interface nsIPKCS11ModuleDB extends nsISupports { deleteModule(moduleName: string): void; - addModule(moduleName: string, libraryFullPath: string, cryptoMechanismFlags: i32, cipherFlags: i32): void; + addModule( + moduleName: string, + libraryFullPath: string, + cryptoMechanismFlags: i32, + cipherFlags: i32 + ): void; listModules(): nsISimpleEnumerator; readonly canToggleFIPS: boolean; toggleFIPSMode(): void; @@ -10422,7 +11163,9 @@ declare global { type ResetStateBy = nsISiteSecurityService_ResetStateBy; } - interface nsISiteSecurityService extends nsISupports, Enums { + interface nsISiteSecurityService + extends nsISupports, + Enums { readonly Success?: 0; readonly ERROR_UNKNOWN?: 1; readonly ERROR_COULD_NOT_PARSE_HEADER?: 3; @@ -10441,7 +11184,11 @@ declare global { aIncludeSubdomains?: OutParam, aFailureResult?: OutParam ): void; - resetState(aURI: nsIURI, aOriginAttributes?: any, aScope?: nsISiteSecurityService.ResetStateBy): void; + resetState( + aURI: nsIURI, + aOriginAttributes?: any, + aScope?: nsISiteSecurityService.ResetStateBy + ): void; isSecureURI(aURI: nsIURI, aOriginAttributes?: any): boolean; clearAll(): void; } @@ -10511,7 +11258,9 @@ declare global { type OverridableErrorCategory = nsITransportSecurityInfo_OverridableErrorCategory; } - interface nsITransportSecurityInfo extends nsISupports, Enums { + interface nsITransportSecurityInfo + extends nsISupports, + Enums { readonly SSL_VERSION_3?: 0; readonly TLS_VERSION_1?: 1; readonly TLS_VERSION_1_1?: 2; @@ -10596,13 +11345,19 @@ declare global { type SignatureAlgorithm = nsIAppSignatureInfo_SignatureAlgorithm; } - interface nsIAppSignatureInfo extends nsISupports, Enums { + interface nsIAppSignatureInfo + extends nsISupports, + Enums { readonly signerCert: nsIX509Cert; readonly signatureAlgorithm: nsIAppSignatureInfo.SignatureAlgorithm; } type nsIOpenSignedAppFileCallback = Callable<{ - openSignedAppFileFinished(rv: nsresult, aZipReader: nsIZipReader, aSignatureInfos: nsIAppSignatureInfo[]): void; + openSignedAppFileFinished( + rv: nsresult, + aZipReader: nsIZipReader, + aSignatureInfos: nsIAppSignatureInfo[] + ): void; }>; type nsIAsyncBoolCallback = Callable<{ @@ -10610,7 +11365,11 @@ declare global { }>; type nsICertVerificationCallback = Callable<{ - verifyCertFinished(aPRErrorCode: i32, aVerifiedChain: nsIX509Cert[], aHasEVPolicy: boolean): void; + verifyCertFinished( + aPRErrorCode: i32, + aVerifiedChain: nsIX509Cert[], + aHasEVPolicy: boolean + ): void; }>; } // global @@ -10661,7 +11420,11 @@ declare global { exportPKCS12File(aFile: nsIFile, aCerts: nsIX509Cert[], aPassword: string): u32; constructX509FromBase64(base64: string): nsIX509Cert; constructX509(certDER: u8[]): nsIX509Cert; - openSignedAppFileAsync(trustedRoot: AppTrustedRoot, aJarFile: nsIFile, callback: nsIOpenSignedAppFileCallback): void; + openSignedAppFileAsync( + trustedRoot: AppTrustedRoot, + aJarFile: nsIFile, + callback: nsIOpenSignedAppFileCallback + ): void; addCert(certDER: string, trust: string): nsIX509Cert; asyncVerifyCertAtTime( aCert: nsIX509Cert, @@ -10801,7 +11564,10 @@ declare global { interface mozISyncedBookmarksMerger extends nsISupports, - Enums { + Enums< + typeof mozISyncedBookmarksMerger_SyncedItemKinds & + typeof mozISyncedBookmarksMerger_SyncedItemValidity + > { db: mozIStorageConnection; logger: mozIServicesLogSink; merge( @@ -10833,13 +11599,32 @@ declare global { aExpiration?: PRTime, isRichIcon?: boolean ): Promise; - getFaviconURLForPage(aPageURI: nsIURI, aCallback: nsIFaviconDataCallback, aPreferredWidth?: u16): void; - getFaviconDataForPage(aPageURI: nsIURI, aCallback: nsIFaviconDataCallback, aPreferredWidth?: u16): void; - copyFavicons(aFromPageURI: nsIURI, aToPageURI: nsIURI, aFaviconLoadType: u32, aCallback?: nsIFaviconDataCallback): void; + getFaviconURLForPage( + aPageURI: nsIURI, + aCallback: nsIFaviconDataCallback, + aPreferredWidth?: u16 + ): void; + getFaviconDataForPage( + aPageURI: nsIURI, + aCallback: nsIFaviconDataCallback, + aPreferredWidth?: u16 + ): void; + copyFavicons( + aFromPageURI: nsIURI, + aToPageURI: nsIURI, + aFaviconLoadType: u32, + aCallback?: nsIFaviconDataCallback + ): void; } type nsIFaviconDataCallback = Callable<{ - onComplete(aFaviconURI: nsIURI, aDataLen: u32, aData: u8[], aMimeType: string, aWidth: u16): void; + onComplete( + aFaviconURI: nsIURI, + aDataLen: u32, + aData: u8[], + aMimeType: string, + aWidth: u16 + ): void; }>; // https://searchfox.org/mozilla-central/source/toolkit/components/places/nsINavBookmarksService.idl @@ -10862,7 +11647,14 @@ declare global { readonly tagsFolder: i64; readonly totalSyncChanges: i64; - insertBookmark(aParentId: i64, aURI: nsIURI, aIndex: i32, aTitle: string, aGuid?: string, aSource?: u16): i64; + insertBookmark( + aParentId: i64, + aURI: nsIURI, + aIndex: i32, + aTitle: string, + aGuid?: string, + aSource?: u16 + ): i64; removeItem(aItemId: i64, aSource?: u16): void; createFolder(aParentFolder: i64, name: string, index: i32, aGuid?: string, aSource?: u16): i64; setItemTitle(aItemId: i64, aTitle: string, aSource?: u16): void; @@ -10921,8 +11713,16 @@ declare global { interface nsINavHistoryResultObserver extends nsISupports { readonly skipHistoryDetailsNotifications: boolean; - nodeInserted(aParent: nsINavHistoryContainerResultNode, aNode: nsINavHistoryResultNode, aNewIndex: u32): void; - nodeRemoved(aParent: nsINavHistoryContainerResultNode, aItem: nsINavHistoryResultNode, aOldIndex: u32): void; + nodeInserted( + aParent: nsINavHistoryContainerResultNode, + aNode: nsINavHistoryResultNode, + aNewIndex: u32 + ): void; + nodeRemoved( + aParent: nsINavHistoryContainerResultNode, + aItem: nsINavHistoryResultNode, + aOldIndex: u32 + ): void; nodeMoved( aNode: nsINavHistoryResultNode, aOldParent: nsINavHistoryContainerResultNode, @@ -10933,12 +11733,20 @@ declare global { nodeTitleChanged(aNode: nsINavHistoryResultNode, aNewTitle: string): void; nodeURIChanged(aNode: nsINavHistoryResultNode, aOldURI: string): void; nodeIconChanged(aNode: nsINavHistoryResultNode): void; - nodeHistoryDetailsChanged(aNode: nsINavHistoryResultNode, aOldVisitDate: PRTime, aOldAccessCount: u32): void; + nodeHistoryDetailsChanged( + aNode: nsINavHistoryResultNode, + aOldVisitDate: PRTime, + aOldAccessCount: u32 + ): void; nodeTagsChanged(aNode: nsINavHistoryResultNode): void; nodeKeywordChanged(aNode: nsINavHistoryResultNode, aNewKeyword: string): void; nodeDateAddedChanged(aNode: nsINavHistoryResultNode, aNewValue: PRTime): void; nodeLastModifiedChanged(aNode: nsINavHistoryResultNode, aNewValue: PRTime): void; - containerStateChanged(aContainerNode: nsINavHistoryContainerResultNode, aOldState: u32, aNewState: u32): void; + containerStateChanged( + aContainerNode: nsINavHistoryContainerResultNode, + aOldState: u32, + aNewState: u32 + ): void; invalidateContainer(aContainerNode: nsINavHistoryContainerResultNode): void; sortingChanged(sortingMode: u16): void; batching(aToggleMode: boolean): void; @@ -11058,7 +11866,10 @@ declare global { canAddURI(aURI: nsIURI): boolean; getNewQuery(): nsINavHistoryQuery; getNewQueryOptions(): nsINavHistoryQueryOptions; - executeQuery(aQuery: nsINavHistoryQuery, options: nsINavHistoryQueryOptions): nsINavHistoryResult; + executeQuery( + aQuery: nsINavHistoryQuery, + options: nsINavHistoryQueryOptions + ): nsINavHistoryResult; queryStringToQuery( aQueryString: string, aQuery: OutParam, @@ -11139,9 +11950,21 @@ declare global { }>; interface nsIPrefObserver extends nsISupports { - onStringPref(kind: string, name: string, value: string, isSticky: boolean, isLocked: boolean): void; + onStringPref( + kind: string, + name: string, + value: string, + isSticky: boolean, + isLocked: boolean + ): void; onIntPref(kind: string, name: string, value: i32, isSticky: boolean, isLocked: boolean): void; - onBoolPref(kind: string, name: string, value: boolean, isSticky: boolean, isLocked: boolean): void; + onBoolPref( + kind: string, + name: string, + value: boolean, + isSticky: boolean, + isLocked: boolean + ): void; onError(message: string): void; } @@ -11170,8 +11993,18 @@ declare global { // https://searchfox.org/mozilla-central/source/uriloader/prefetch/nsIPrefetchService.idl interface nsIPrefetchService extends nsISupports { - prefetchURI(aURI: nsIURI, aReferrerInfo: nsIReferrerInfo, aSource: Node, aExplicit: boolean): void; - preloadURI(aURI: nsIURI, aReferrerInfo: nsIReferrerInfo, aSource: Node, aPolicyType: nsContentPolicyType): void; + prefetchURI( + aURI: nsIURI, + aReferrerInfo: nsIReferrerInfo, + aSource: Node, + aExplicit: boolean + ): void; + preloadURI( + aURI: nsIURI, + aReferrerInfo: nsIReferrerInfo, + aSource: Node, + aPolicyType: nsContentPolicyType + ): void; hasMoreElements(): boolean; cancelPrefetchPreloadURI(aURI: nsIURI, aSource: Node): void; } @@ -11179,7 +12012,13 @@ declare global { // https://searchfox.org/mozilla-central/source/dom/privateattribution/nsIPrivateAttributionService.idl interface nsIPrivateAttributionService extends nsISupports { - onAttributionEvent(sourceHost: string, type: string, index: u32, ad: string, targetHost: string): void; + onAttributionEvent( + sourceHost: string, + type: string, + index: u32, + ad: string, + targetHost: string + ): void; onAttributionConversion( targetHost: string, task: string, @@ -11230,7 +12069,11 @@ declare global { GetFeatures(): string[]; readonly activeConfiguration: any; GetAllFeatures(): string[]; - GetBufferInfo(aCurrentPosition: OutParam, aTotalSize: OutParam, aGeneration: OutParam): void; + GetBufferInfo( + aCurrentPosition: OutParam, + aTotalSize: OutParam, + aGeneration: OutParam + ): void; getElapsedTime(): double; readonly sharedLibraries: any; getSymbolTable(aDebugPath: string, aBreakpadID: string): Promise; @@ -11265,7 +12108,10 @@ declare global { readonly VERDICT_POTENTIALLY_UNWANTED?: 3; readonly VERDICT_DANGEROUS_HOST?: 4; - queryReputation(aQuery: nsIApplicationReputationQuery, aCallback: nsIApplicationReputationCallback): void; + queryReputation( + aQuery: nsIApplicationReputationQuery, + aCallback: nsIApplicationReputationCallback + ): void; isBinary(aFilename: string): boolean; isExecutable(aFilename: string): boolean; } @@ -11357,7 +12203,11 @@ declare global { syncStarted(callback: mozIBridgedSyncEngineCallback): void; storeIncoming(incomingEnvelopesAsJSON: string[], callback: mozIBridgedSyncEngineCallback): void; apply(callback: mozIBridgedSyncEngineApplyCallback): void; - setUploaded(newTimestampMillis: i64, uploadedIds: string[], callback: mozIBridgedSyncEngineCallback): void; + setUploaded( + newTimestampMillis: i64, + uploadedIds: string[], + callback: mozIBridgedSyncEngineCallback + ): void; syncFinished(callback: mozIBridgedSyncEngineCallback): void; reset(callback: mozIBridgedSyncEngineCallback): void; wipe(callback: mozIBridgedSyncEngineCallback): void; @@ -11416,7 +12266,12 @@ declare global { addTextField(aIsXPath: boolean, aIdOrXPath: string, aValue: string): void; addCheckbox(aIsXPath: boolean, aIdOrXPath: string, aValue: boolean): void; addFileList(aIsXPath: boolean, aIdOrXPath: string, aType: string, aFileList: string[]): void; - addSingleSelect(aIsXPath: boolean, aIdOrXPath: string, aSelectedIndex: u32, aValue: string): void; + addSingleSelect( + aIsXPath: boolean, + aIdOrXPath: string, + aSelectedIndex: u32, + aValue: string + ): void; addMultipleSelect(aIsXPath: boolean, aIdOrXPath: string, aValues: string[]): void; addCustomElement(aIsXPath: boolean, aIdOrXPath: string, aValue: any, aState: any): void; addChild(aChild: nsISessionStoreRestoreData, aIndex: u32): void; @@ -11588,17 +12443,27 @@ declare global { asyncClone(aReadOnly: boolean, aCallback: mozIStorageCompletionCallback): void; readonly databaseFile: nsIFile; interrupt(): void; - asyncVacuum(aCallback?: mozIStorageCompletionCallback, aUseIncremental?: boolean, aSetPageSize?: i32): void; + asyncVacuum( + aCallback?: mozIStorageCompletionCallback, + aUseIncremental?: boolean, + aSetPageSize?: i32 + ): void; createAsyncStatement(aSQLStatement: string): mozIStorageAsyncStatement; executeAsync( aStatements: mozIStorageBaseStatement[], aCallback?: mozIStorageStatementCallback ): mozIStoragePendingStatement; - executeSimpleSQLAsync(aSQLStatement: string, aCallback?: mozIStorageStatementCallback): mozIStoragePendingStatement; + executeSimpleSQLAsync( + aSQLStatement: string, + aCallback?: mozIStorageStatementCallback + ): mozIStoragePendingStatement; loadExtension(aExtensionName: string, aCallback?: mozIStorageCompletionCallback): void; createFunction(aFunctionName: string, aNumArguments: i32, aFunction: mozIStorageFunction): void; removeFunction(aFunctionName: string): void; - setProgressHandler(aGranularity: i32, aHandler: mozIStorageProgressHandler): mozIStorageProgressHandler; + setProgressHandler( + aGranularity: i32, + aHandler: mozIStorageProgressHandler + ): mozIStorageProgressHandler; removeProgressHandler(): mozIStorageProgressHandler; backupToFileAsync( aDestinationFile: nsIFile, @@ -11766,10 +12631,18 @@ declare global { aConnectionFlags: u32, aCallback: mozIStorageCompletionCallback ): void; - openSpecialDatabase(aStorageKey: string, aName?: string, aConnectionFlags?: u32): mozIStorageConnection; + openSpecialDatabase( + aStorageKey: string, + aName?: string, + aConnectionFlags?: u32 + ): mozIStorageConnection; openDatabase(aDatabaseFile: nsIFile, aConnectionFlags?: u32): mozIStorageConnection; openUnsharedDatabase(aDatabaseFile: nsIFile, aConnectionFlags?: u32): mozIStorageConnection; - openDatabaseWithFileURL(aFileURL: nsIFileURL, aTelemetryFilename?: string, aConnectionFlags?: u32): mozIStorageConnection; + openDatabaseWithFileURL( + aFileURL: nsIFileURL, + aTelemetryFilename?: string, + aConnectionFlags?: u32 + ): mozIStorageConnection; } // https://searchfox.org/mozilla-central/source/storage/mozIStorageStatement.idl @@ -11873,10 +12746,22 @@ declare global { readonly EXCLUDE_STACKINFO_FROM_LOADEVENTS?: 8; getCategoricalLabels(): any; - getSnapshotForHistograms(aStoreName?: string, aClearStore?: boolean, aFilterTest?: boolean): any; - getSnapshotForKeyedHistograms(aStoreName?: string, aClearStore?: boolean, aFilterTest?: boolean): any; + getSnapshotForHistograms( + aStoreName?: string, + aClearStore?: boolean, + aFilterTest?: boolean + ): any; + getSnapshotForKeyedHistograms( + aStoreName?: string, + aClearStore?: boolean, + aFilterTest?: boolean + ): any; getSnapshotForScalars(aStoreName?: string, aClearStore?: boolean, aFilterTest?: boolean): any; - getSnapshotForKeyedScalars(aStoreName?: string, aClearStore?: boolean, aFilterTest?: boolean): any; + getSnapshotForKeyedScalars( + aStoreName?: string, + aClearStore?: boolean, + aFilterTest?: boolean + ): any; readonly lastShutdownDuration: u32; readonly failedProfileLockCount: u32; readonly slowSQL: any; @@ -12049,10 +12934,15 @@ declare global { type Modes = nsIBounceTrackingProtection_Modes; } - interface nsIBounceTrackingProtection extends nsISupports, Enums { + interface nsIBounceTrackingProtection + extends nsISupports, + Enums { clearAll(): void; clearBySiteHostAndOriginAttributes(aSiteHost: string, originAttributes: any): void; - clearBySiteHostAndOriginAttributesPattern(aSiteHost: string, aOriginAttributesPattern: any): void; + clearBySiteHostAndOriginAttributesPattern( + aSiteHost: string, + aOriginAttributesPattern: any + ): void; clearByTimeRange(aFrom: PRTime, aTo: PRTime): void; clearByOriginAttributesPattern(aPattern: string): void; addSiteHostExceptions(aSiteHosts: string[]): void; @@ -12063,7 +12953,11 @@ declare global { testClearExpiredUserActivations(): void; testGetBounceTrackerCandidateHosts(originAttributes: any): nsIBounceTrackingMapEntry[]; testGetUserActivationHosts(originAttributes: any): nsIBounceTrackingMapEntry[]; - testAddBounceTrackerCandidate(originAttributes: any, aSiteHost: string, aBounceTime: PRTime): void; + testAddBounceTrackerCandidate( + originAttributes: any, + aSiteHost: string, + aBounceTime: PRTime + ): void; testAddUserActivation(originAttributes: any, aSiteHost: string, aActivationTime: PRTime): void; testGetRecentlyPurgedTrackers(originAttributes: any): nsIBounceTrackingPurgeEntry[]; testMaybeMigrateUserInteractionPermissions(): void; @@ -12158,7 +13052,12 @@ declare global { interface nsIAsyncShutdownClient extends nsISupports { readonly name: string; readonly isClosed: boolean; - addBlocker(aBlocker: nsIAsyncShutdownBlocker, aFileName: string, aLineNumber: i32, aStack: string): void; + addBlocker( + aBlocker: nsIAsyncShutdownBlocker, + aFileName: string, + aLineNumber: i32, + aStack: string + ): void; removeBlocker(aBlocker: nsIAsyncShutdownBlocker): void; readonly jsclient: any; } @@ -12260,8 +13159,17 @@ declare global { readonly CLEAR_COOKIES_AND_SITE_DATA?: 2013739649; readonly CLEAR_STATE_FOR_TRACKER_PURGING?: 2043624143; - deleteDataFromLocalFiles(aIsUserRequest: boolean, aFlags: u32, aCallback: nsIClearDataCallback): void; - deleteDataFromHost(aHost: string, aIsUserRequest: boolean, aFlags: u32, aCallback: nsIClearDataCallback): void; + deleteDataFromLocalFiles( + aIsUserRequest: boolean, + aFlags: u32, + aCallback: nsIClearDataCallback + ): void; + deleteDataFromHost( + aHost: string, + aIsUserRequest: boolean, + aFlags: u32, + aCallback: nsIClearDataCallback + ): void; deleteDataFromSite( aSchemelessSite: string, aOriginAttributesPattern: any, @@ -12290,14 +13198,22 @@ declare global { aCallback: nsIClearDataCallback ): void; deleteData(aFlags: u32, aCallback: nsIClearDataCallback): void; - deleteDataFromOriginAttributesPattern(aOriginAttributesPattern: any, aCallback?: nsIClearDataCallback): void; + deleteDataFromOriginAttributesPattern( + aOriginAttributesPattern: any, + aCallback?: nsIClearDataCallback + ): void; deleteUserInteractionForClearingHistory( aPrincipalsWithStorage: nsIPrincipal[], aFrom?: PRTime, aCallback?: nsIClearDataCallback ): void; cleanupAfterDeletionAtShutdown(aFlags: u32, aCallback: nsIClearDataCallback): void; - hostMatchesSite(aHost: string, aOriginAttributes: any, aSchemelessSite: string, aOriginAttributesPattern?: any): boolean; + hostMatchesSite( + aHost: string, + aOriginAttributes: any, + aSchemelessSite: string, + aOriginAttributesPattern?: any + ): boolean; } type nsIClearDataCallback = Callable<{ @@ -12329,7 +13245,10 @@ declare global { interface nsIContentAnalysisAcknowledgement extends nsISupports, - Enums { + Enums< + typeof nsIContentAnalysisAcknowledgement_Result & + typeof nsIContentAnalysisAcknowledgement_FinalAction + > { readonly result: nsIContentAnalysisAcknowledgement.Result; readonly finalAction: nsIContentAnalysisAcknowledgement.FinalAction; } @@ -12366,7 +13285,9 @@ declare global { interface nsIContentAnalysisResponse extends nsIContentAnalysisResult, - Enums { + Enums< + typeof nsIContentAnalysisResponse_Action & typeof nsIContentAnalysisResponse_CancelError + > { readonly action: nsIContentAnalysisResponse.Action; readonly cancelError: nsIContentAnalysisResponse.CancelError; readonly requestToken: string; @@ -12469,7 +13390,10 @@ declare global { readonly isActive: boolean; readonly mightBeActive: boolean; isSetByEnterprisePolicy: boolean; - analyzeContentRequests(aCars: nsIContentAnalysisRequest[], aAutoAcknowledge: boolean): Promise; + analyzeContentRequests( + aCars: nsIContentAnalysisRequest[], + aAutoAcknowledge: boolean + ): Promise; analyzeContentRequestsCallback( aCars: nsIContentAnalysisRequest[], aAutoAcknowledge: boolean, @@ -12488,7 +13412,11 @@ declare global { getDiagnosticInfo(): Promise; getURIForBrowsingContext(aBrowsingContext: BrowsingContext): nsIURI; getURIForDropEvent(aEvent: DragEvent): nsIURI; - setCachedResponse(aURI: nsIURI, aSequenceNumber: i32, aAction: nsIContentAnalysisResponse.Action): void; + setCachedResponse( + aURI: nsIURI, + aSequenceNumber: i32, + aAction: nsIContentAnalysisResponse.Action + ): void; getCachedResponse( aURI: nsIURI, aSequenceNumber: i32, @@ -12595,11 +13523,22 @@ declare global { removeRule(aRule: nsICookieBannerRule): void; hasRuleForBrowsingContextTree(aBrowsingContext: BrowsingContext): boolean; getDomainPref(aTopLevelURI: nsIURI, aIsPrivate: boolean): nsICookieBannerService.Modes; - setDomainPref(aTopLevelURI: nsIURI, aMode: nsICookieBannerService.Modes, aIsPrivate: boolean): void; - setDomainPrefAndPersistInPrivateBrowsing(aTopLevelURI: nsIURI, aMode: nsICookieBannerService.Modes): void; + setDomainPref( + aTopLevelURI: nsIURI, + aMode: nsICookieBannerService.Modes, + aIsPrivate: boolean + ): void; + setDomainPrefAndPersistInPrivateBrowsing( + aTopLevelURI: nsIURI, + aMode: nsICookieBannerService.Modes + ): void; removeDomainPref(aTopLevelURI: nsIURI, aIsPrivate: boolean): void; removeAllDomainPrefs(aIsPrivate: boolean): void; - shouldStopBannerClickingForSite(aSite: string, aIsTopLevel: boolean, aIsPrivate: boolean): boolean; + shouldStopBannerClickingForSite( + aSite: string, + aIsTopLevel: boolean, + aIsPrivate: boolean + ): boolean; markSiteExecuted(aSite: string, aIsTopLevel: boolean, aIsPrivate: boolean): void; removeExecutedRecordForSite(aSite: string, aIsPrivate: boolean): void; removeAllExecutedRecords(aIsPrivate: boolean): void; @@ -12773,7 +13712,10 @@ declare global { interface nsISearchService extends nsISupports, - Enums { + Enums< + typeof nsISearchService_OpenSearchInstallErrors & + typeof nsISearchService_DefaultEngineChangeReason + > { init(): Promise; readonly promiseInitialized: Promise; readonly isInitialized: boolean; @@ -13181,7 +14123,11 @@ declare global { // https://searchfox.org/mozilla-central/source/uriloader/base/nsIContentHandler.idl interface nsIContentHandler extends nsISupports { - handleContent(aContentType: string, aWindowContext: nsIInterfaceRequestor, aRequest: nsIRequest): void; + handleContent( + aContentType: string, + aWindowContext: nsIInterfaceRequestor, + aRequest: nsIRequest + ): void; } // https://searchfox.org/mozilla-central/source/uriloader/base/nsIDocumentLoader.idl @@ -13246,7 +14192,11 @@ declare global { aContentHandler: OutParam ): boolean; isPreferred(aContentType: string, aDesiredContentType: OutParam): boolean; - canHandleContent(aContentType: string, aIsContentPreferred: boolean, aDesiredContentType: OutParam): boolean; + canHandleContent( + aContentType: string, + aIsContentPreferred: boolean, + aDesiredContentType: OutParam + ): boolean; loadCookie: nsISupports; parentContentListener: nsIURIContentListener; } @@ -13260,7 +14210,11 @@ declare global { registerContentListener(aContentListener: nsIURIContentListener): void; unRegisterContentListener(aContentListener: nsIURIContentListener): void; openURI(aChannel: nsIChannel, aFlags: u32, aWindowContext: nsIInterfaceRequestor): void; - openChannel(aChannel: nsIChannel, aFlags: u32, aWindowContext: nsIInterfaceRequestor): nsIStreamListener; + openChannel( + aChannel: nsIChannel, + aFlags: u32, + aWindowContext: nsIInterfaceRequestor + ): nsIStreamListener; stop(aLoadCookie: nsISupports): void; } @@ -13357,7 +14311,12 @@ declare global { readonly LOCATION_CHANGE_HASHCHANGE?: 8; readonly LOCATION_CHANGE_SESSION_STORE?: 16; - onStateChange(aWebProgress: nsIWebProgress, aRequest: nsIRequest, aStateFlags: u32, aStatus: nsresult): void; + onStateChange( + aWebProgress: nsIWebProgress, + aRequest: nsIRequest, + aStateFlags: u32, + aStatus: nsresult + ): void; onProgressChange( aWebProgress: nsIWebProgress, aRequest: nsIRequest, @@ -13366,8 +14325,18 @@ declare global { aCurTotalProgress: i32, aMaxTotalProgress: i32 ): void; - onLocationChange(aWebProgress: nsIWebProgress, aRequest: nsIRequest, aLocation: nsIURI, aFlags?: u32): void; - onStatusChange(aWebProgress: nsIWebProgress, aRequest: nsIRequest, aStatus: nsresult, aMessage: string): void; + onLocationChange( + aWebProgress: nsIWebProgress, + aRequest: nsIRequest, + aLocation: nsIURI, + aFlags?: u32 + ): void; + onStatusChange( + aWebProgress: nsIWebProgress, + aRequest: nsIRequest, + aStatus: nsresult, + aMessage: string + ): void; onSecurityChange(aWebProgress: nsIWebProgress, aRequest: nsIRequest, aState: u32): void; onContentBlockingEvent(aWebProgress: nsIWebProgress, aRequest: nsIRequest, aEvent: u32): void; } @@ -13383,7 +14352,12 @@ declare global { aCurTotalProgress: i64, aMaxTotalProgress: i64 ): void; - onRefreshAttempted(aWebProgress: nsIWebProgress, aRefreshURI: nsIURI, aMillis: u32, aSameURI: boolean): boolean; + onRefreshAttempted( + aWebProgress: nsIWebProgress, + aRefreshURI: nsIURI, + aMillis: u32, + aSameURI: boolean + ): boolean; } // https://searchfox.org/mozilla-central/source/netwerk/url-classifier/nsIChannelClassifierService.idl @@ -13413,7 +14387,12 @@ declare global { // https://searchfox.org/mozilla-central/source/netwerk/url-classifier/nsIURIClassifier.idl type nsIURIClassifierCallback = Callable<{ - onClassifyComplete(aErrorCode: nsresult, aList: string, aProvider: string, aFullHash: string): void; + onClassifyComplete( + aErrorCode: nsresult, + aList: string, + aProvider: string, + aFullHash: string + ): void; }>; interface nsIURIClassifier extends nsISupports { @@ -13433,8 +14412,17 @@ declare global { ): void; getFeatureByName(aFeatureName: string): nsIUrlClassifierFeature; getFeatureNames(): string[]; - createFeatureWithTables(aName: string, aBlocklistTables: string[], aEntitylistTables: string[]): nsIUrlClassifierFeature; - sendThreatHitReport(aChannel: nsIChannel, aProvider: string, aList: string, aFullHash: string): void; + createFeatureWithTables( + aName: string, + aBlocklistTables: string[], + aEntitylistTables: string[] + ): nsIUrlClassifierFeature; + sendThreatHitReport( + aChannel: nsIChannel, + aProvider: string, + aList: string, + aFullHash: string + ): void; } // https://searchfox.org/mozilla-central/source/netwerk/url-classifier/nsIUrlClassifierExceptionListService.idl @@ -13449,7 +14437,10 @@ declare global { aPrefName: string, aObserver: nsIUrlClassifierExceptionListObserver ): void; - unregisterExceptionListObserver(aFeature: string, aObserver: nsIUrlClassifierExceptionListObserver): void; + unregisterExceptionListObserver( + aFeature: string, + aObserver: nsIUrlClassifierExceptionListObserver + ): void; clear(): void; } @@ -13566,12 +14557,22 @@ declare global { interface nsIUrlClassifierHashCompleterCallback extends nsISupports { completionV2(hash: string, table: string, chunkId: u32): void; - completionV4(partialHash: string, table: string, negativeCacheDuration: u32, fullHashes: nsIArray): void; + completionV4( + partialHash: string, + table: string, + negativeCacheDuration: u32, + fullHashes: nsIArray + ): void; completionFinished(status: nsresult): void; } interface nsIUrlClassifierHashCompleter extends nsISupports { - complete(partialHash: string, gethashUrl: string, tableName: string, callback: nsIUrlClassifierHashCompleterCallback): void; + complete( + partialHash: string, + gethashUrl: string, + tableName: string, + callback: nsIUrlClassifierHashCompleterCallback + ): void; } // https://searchfox.org/mozilla-central/source/toolkit/components/url-classifier/nsIUrlClassifierInfo.idl @@ -13634,7 +14635,11 @@ declare global { // https://searchfox.org/mozilla-central/source/toolkit/components/url-classifier/nsIUrlClassifierUtils.idl interface nsIUrlClassifierParseFindFullHashCallback extends nsISupports { - onCompleteHashFound(aCompleteHash: string, aTableNames: string, aPerHashCacheDuration: u32): void; + onCompleteHashFound( + aCompleteHash: string, + aTableNames: string, + aPerHashCacheDuration: u32 + ): void; onResponseParsed(aMinWaitDuration: u32, aNegCacheDuration: u32): void; } @@ -13646,9 +14651,16 @@ declare global { convertThreatTypeToListNames(threatType: u32): string; convertListNameToThreatType(listName: string): u32; makeUpdateRequestV4(aListNames: string[], aStatesBase64: string[]): string; - makeFindFullHashRequestV4(aListNames: string[], aListStatesBase64: string[], aPrefixes: string[]): string; + makeFindFullHashRequestV4( + aListNames: string[], + aListStatesBase64: string[], + aPrefixes: string[] + ): string; makeThreatHitReport(aChannel: nsIChannel, aListName: string, aHashBase64: string): string; - parseFindFullHashResponseV4(aResponse: string, aCallback: nsIUrlClassifierParseFindFullHashCallback): void; + parseFindFullHashResponseV4( + aResponse: string, + aCallback: nsIUrlClassifierParseFindFullHashCallback + ): void; } // https://searchfox.org/mozilla-central/source/toolkit/components/url-classifier/nsIUrlListManager.idl @@ -13656,7 +14668,12 @@ declare global { interface nsIUrlListManager extends nsISupports { getGethashUrl(tableName: string): string; getUpdateUrl(tableName: string): string; - registerTable(tableName: string, providerName: string, updateUrl: string, gethashUrl: string): boolean; + registerTable( + tableName: string, + providerName: string, + updateUrl: string, + gethashUrl: string + ): boolean; unregisterTable(tableName: string): void; enableUpdate(tableName: string): void; disableAllUpdates(): void; @@ -13851,14 +14868,26 @@ declare global { } interface nsIWebBrowserPersistResourceVisitor extends nsISupports { - visitResource(aDocument: nsIWebBrowserPersistDocument, aURI: string, aContentPolicyType: nsContentPolicyType): void; - visitDocument(aDocument: nsIWebBrowserPersistDocument, aSubDocument: nsIWebBrowserPersistDocument): void; + visitResource( + aDocument: nsIWebBrowserPersistDocument, + aURI: string, + aContentPolicyType: nsContentPolicyType + ): void; + visitDocument( + aDocument: nsIWebBrowserPersistDocument, + aSubDocument: nsIWebBrowserPersistDocument + ): void; visitBrowsingContext(aDocument: nsIWebBrowserPersistDocument, aContext: BrowsingContext): void; endVisit(aDocument: nsIWebBrowserPersistDocument, aStatus: nsresult): void; } type nsIWebBrowserPersistWriteCompletion = Callable<{ - onFinish(aDocument: nsIWebBrowserPersistDocument, aStream: nsIOutputStream, aContentType: string, aStatus: nsresult): void; + onFinish( + aDocument: nsIWebBrowserPersistDocument, + aStream: nsIOutputStream, + aContentType: string, + aStatus: nsresult + ): void; }>; interface nsIWebBrowserPersistDocumentReceiver extends nsISupports { @@ -13910,7 +14939,10 @@ declare global { interface mozIExtensionListenerCallOptions extends nsISupports, - Enums { + Enums< + typeof mozIExtensionListenerCallOptions_APIObjectType & + typeof mozIExtensionListenerCallOptions_CallbackType + > { readonly apiObjectType: mozIExtensionListenerCallOptions.APIObjectType; readonly apiObjectDescriptor: any; readonly apiObjectPrepended: boolean; @@ -13936,7 +14968,9 @@ declare global { type RequestType = mozIExtensionAPIRequest_RequestType; } - interface mozIExtensionAPIRequest extends nsISupports, Enums { + interface mozIExtensionAPIRequest + extends nsISupports, + Enums { toString(): string; readonly requestType: string; readonly apiNamespace: string; @@ -13961,14 +14995,22 @@ declare global { type ResultType = mozIExtensionAPIRequestResult_ResultType; } - interface mozIExtensionAPIRequestResult extends nsISupports, Enums { + interface mozIExtensionAPIRequestResult + extends nsISupports, + Enums { readonly type: mozIExtensionAPIRequestResult.ResultType; readonly value: any; } interface mozIExtensionAPIRequestHandler extends nsISupports { - handleAPIRequest(extension: nsISupports, apiRequest: mozIExtensionAPIRequest): mozIExtensionAPIRequestResult; - initExtensionWorker(extension: nsISupports, serviceWorkerInfo: mozIExtensionServiceWorkerInfo): void; + handleAPIRequest( + extension: nsISupports, + apiRequest: mozIExtensionAPIRequest + ): mozIExtensionAPIRequestResult; + initExtensionWorker( + extension: nsISupports, + serviceWorkerInfo: mozIExtensionServiceWorkerInfo + ): void; onExtensionWorkerLoaded(extension: nsISupports, serviceWorkerDescriptorId: u64): void; onExtensionWorkerDestroyed(extension: nsISupports, serviceWorkerDescriptorId: u64): void; } @@ -13977,7 +15019,10 @@ declare global { interface mozIExtensionProcessScript extends nsISupports { preloadContentScript(contentScript: nsISupports): void; - loadContentScript(contentScript: WebExtensionContentScript, window: mozIDOMWindow): Promise; + loadContentScript( + contentScript: WebExtensionContentScript, + window: mozIDOMWindow + ): Promise; initExtensionDocument(extension: nsISupports, doc: Document, privileged: boolean): void; } @@ -14009,7 +15054,12 @@ declare global { watch(callback: nsIWebVTTListener): void; cancel(): void; convertCueToDOMTree(window: mozIDOMWindow, cue: nsISupports): DocumentFragment; - processCues(window: mozIDOMWindow, cues: nsIVariant, overlay: nsISupports, controls: nsISupports): void; + processCues( + window: mozIDOMWindow, + cues: nsIVariant, + overlay: nsISupports, + controls: nsISupports + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsIAppShell.idl @@ -14027,7 +15077,12 @@ declare global { setSize(cx: i32, cy: i32, fRepaint: boolean): void; getSize(cx: OutParam, cy: OutParam): void; setPositionAndSize(x: i32, y: i32, cx: i32, cy: i32, flags: u32): void; - getPositionAndSize(x: OutParam, y: OutParam, cx: OutParam, cy: OutParam): void; + getPositionAndSize( + x: OutParam, + y: OutParam, + cx: OutParam, + cy: OutParam + ): void; repaint(force: boolean): void; readonly nativeHandle: string; visibility: boolean; @@ -14110,7 +15165,10 @@ declare global { aRequestingWindowContext?: WindowContext ): nsIClipboardDataSnapshot; emptyClipboard(aWhichClipboard: nsIClipboard.ClipboardType): void; - hasDataMatchingFlavors(aFlavorList: string[], aWhichClipboard: nsIClipboard.ClipboardType): boolean; + hasDataMatchingFlavors( + aFlavorList: string[], + aWhichClipboard: nsIClipboard.ClipboardType + ): boolean; isClipboardTypeSupported(aWhichClipboard: nsIClipboard.ClipboardType): boolean; } @@ -14134,7 +15192,11 @@ declare global { aSettingWindowContext?: WindowContext, aSensitive?: nsIClipboardHelper.SensitiveData ): void; - copyString(aString: string, aSettingWindowContext?: WindowContext, aSensitive?: nsIClipboardHelper.SensitiveData): void; + copyString( + aString: string, + aSettingWindowContext?: WindowContext, + aSensitive?: nsIClipboardHelper.SensitiveData + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsIClipboardOwner.idl @@ -14151,7 +15213,12 @@ declare global { } interface nsIColorPicker extends nsISupports { - init(browsingContext: BrowsingContext, title: string, initialColor: string, defaultColors: string[]): void; + init( + browsingContext: BrowsingContext, + title: string, + initialColor: string, + defaultColors: string[] + ): void; open(aColorPickerShownCallback: nsIColorPickerShownCallback): void; } @@ -14238,7 +15305,11 @@ declare global { interface nsIFilePicker extends nsISupports, - Enums { + Enums< + typeof nsIFilePicker_Mode & + typeof nsIFilePicker_ResultCode & + typeof nsIFilePicker_CaptureTarget + > { readonly filterAll?: 1; readonly filterHTML?: 2; readonly filterText?: 4; @@ -14284,7 +15355,12 @@ declare global { getInputDataFlavors(): string[]; getOutputDataFlavors(): string[]; canConvert(aFromDataFlavor: string, aToDataFlavor: string): boolean; - convert(aFromDataFlavor: string, aFromData: nsISupports, aToDataFlavor: string, aToData: OutParam): void; + convert( + aFromDataFlavor: string, + aFromData: nsISupports, + aToDataFlavor: string, + aToData: OutParam + ): void; } // https://searchfox.org/mozilla-central/source/widget/nsIGfxInfo.idl @@ -14320,7 +15396,9 @@ declare global { type FontVisibilityDeviceDetermination = nsIGfxInfo_FontVisibilityDeviceDetermination; } - interface nsIGfxInfo extends nsISupports, Enums { + interface nsIGfxInfo + extends nsISupports, + Enums { readonly D2DEnabled: boolean; readonly DWriteEnabled: boolean; readonly EmbeddedInFirefoxReality: boolean; @@ -14403,7 +15481,9 @@ declare global { type EventType = nsIMockDragServiceController_EventType; } - interface nsIMockDragServiceController extends nsISupports, Enums { + interface nsIMockDragServiceController + extends nsISupports, + Enums { readonly mockDragService: nsIDragService; sendEvent( aBC: BrowsingContext, @@ -14438,7 +15518,11 @@ declare global { interface nsIPrintDialogService extends nsISupports { init(): void; - showPrintDialog(aParent: mozIDOMWindowProxy, aHaveSelection: boolean, aPrintSettings: nsIPrintSettings): void; + showPrintDialog( + aParent: mozIDOMWindowProxy, + aHaveSelection: boolean, + aPrintSettings: nsIPrintSettings + ): void; showPageSetupDialog(aParent: mozIDOMWindowProxy, aPrintSettings: nsIPrintSettings): void; } @@ -14456,7 +15540,9 @@ declare global { type OutputDestinationType = nsIPrintSettings_OutputDestinationType; } - interface nsIPrintSettings extends nsISupports, Enums { + interface nsIPrintSettings + extends nsISupports, + Enums { readonly kInitSaveHeaderLeft?: 2; readonly kInitSaveHeaderCenter?: 4; readonly kInitSaveHeaderRight?: 8; @@ -14557,7 +15643,11 @@ declare global { createNewPrintSettings(): nsIPrintSettings; readonly lastUsedPrinterName: string; initPrintSettingsFromPrinter(aPrinterName: string, aPrintSettings: nsIPrintSettings): void; - initPrintSettingsFromPrefs(aPrintSettings: nsIPrintSettings, aUsePrinterNamePrefix: boolean, aFlags: u32): void; + initPrintSettingsFromPrefs( + aPrintSettings: nsIPrintSettings, + aUsePrinterNamePrefix: boolean, + aFlags: u32 + ): void; maybeSavePrintSettingsToPrefs(aPrintSettings: nsIPrintSettings, aFlags: u32): void; maybeSaveLastUsedPrinterNameToPrefs(aPrinterName: string): void; } @@ -14595,10 +15685,30 @@ declare global { // https://searchfox.org/mozilla-central/source/widget/nsIScreen.idl interface nsIScreen extends nsISupports { - GetRect(left: OutParam, top: OutParam, width: OutParam, height: OutParam): void; - GetAvailRect(left: OutParam, top: OutParam, width: OutParam, height: OutParam): void; - GetRectDisplayPix(left: OutParam, top: OutParam, width: OutParam, height: OutParam): void; - GetAvailRectDisplayPix(left: OutParam, top: OutParam, width: OutParam, height: OutParam): void; + GetRect( + left: OutParam, + top: OutParam, + width: OutParam, + height: OutParam + ): void; + GetAvailRect( + left: OutParam, + top: OutParam, + width: OutParam, + height: OutParam + ): void; + GetRectDisplayPix( + left: OutParam, + top: OutParam, + width: OutParam, + height: OutParam + ): void; + GetAvailRectDisplayPix( + left: OutParam, + top: OutParam, + width: OutParam, + height: OutParam + ): void; readonly pixelDepth: i32; readonly colorDepth: i32; readonly contentsScaleFactor: double; @@ -14652,7 +15762,11 @@ declare global { // https://searchfox.org/mozilla-central/source/widget/nsITransferable.idl interface nsIFlavorDataProvider extends nsISupports { - getFlavorData(aTransferable: nsITransferable, aFlavor: string, aData: OutParam): void; + getFlavorData( + aTransferable: nsITransferable, + aFlavor: string, + aData: OutParam + ): void; } interface nsITransferable extends nsISupports { @@ -14768,8 +15882,18 @@ declare global { readonly MODAL_TYPE_INTERNAL_WINDOW?: 4; alert(aParent: mozIDOMWindowProxy, aDialogTitle: string, aText: string): void; - alertBC(aBrowsingContext: BrowsingContext, modalType: u32, aDialogTitle: string, aText: string): void; - asyncAlert(aBrowsingContext: BrowsingContext, modalType: u32, aDialogTitle: string, aText: string): Promise; + alertBC( + aBrowsingContext: BrowsingContext, + modalType: u32, + aDialogTitle: string, + aText: string + ): void; + asyncAlert( + aBrowsingContext: BrowsingContext, + modalType: u32, + aDialogTitle: string, + aText: string + ): Promise; alertCheck( aParent: mozIDOMWindowProxy, aDialogTitle: string, @@ -14794,8 +15918,18 @@ declare global { aCheckState: boolean ): Promise; confirm(aParent: mozIDOMWindowProxy, aDialogTitle: string, aText: string): boolean; - confirmBC(aBrowsingContext: BrowsingContext, modalType: u32, aDialogTitle: string, aText: string): boolean; - asyncConfirm(aBrowsingContext: BrowsingContext, modalType: u32, aDialogTitle: string, aText: string): Promise; + confirmBC( + aBrowsingContext: BrowsingContext, + modalType: u32, + aDialogTitle: string, + aText: string + ): boolean; + asyncConfirm( + aBrowsingContext: BrowsingContext, + modalType: u32, + aDialogTitle: string, + aText: string + ): Promise; confirmCheck( aParent: mozIDOMWindowProxy, aDialogTitle: string, @@ -14904,7 +16038,12 @@ declare global { aUsername: string, aPassword: string ): Promise; - promptPassword(aParent: mozIDOMWindowProxy, aDialogTitle: string, aText: string, aPassword: InOutParam): boolean; + promptPassword( + aParent: mozIDOMWindowProxy, + aDialogTitle: string, + aText: string, + aPassword: InOutParam + ): boolean; promptPasswordBC( aBrowsingContext: BrowsingContext, modalType: u32, @@ -14941,7 +16080,12 @@ declare global { aText: string, aSelectList: string[] ): Promise; - promptAuth(aParent: mozIDOMWindowProxy, aChannel: nsIChannel, level: u32, authInfo: nsIAuthInformation): boolean; + promptAuth( + aParent: mozIDOMWindowProxy, + aChannel: nsIChannel, + level: u32, + authInfo: nsIAuthInformation + ): boolean; promptAuthBC( aBrowsingContext: BrowsingContext, modalType: u32, @@ -15045,7 +16189,12 @@ declare global { interface nsICycleCollectorHandler extends nsISupports { noteRefCountedObject(aAddress: string, aRefCount: u32, aObjectDescription: string): void; - noteGCedObject(aAddress: string, aMarked: boolean, aObjectDescription: string, aCompartmentAddress: string): void; + noteGCedObject( + aAddress: string, + aMarked: boolean, + aObjectDescription: string, + aCompartmentAddress: string + ): void; noteEdge(aFromAddress: string, aToAddress: string, aEdgeName: string): void; describeRoot(aAddress: string, aKnownEdges: u32): void; describeGarbage(aAddress: string): void; @@ -15127,7 +16276,11 @@ declare global { aAnonymize: boolean, aMinimizeMemoryUsage: boolean ): void; - dumpMemoryInfoToTempDir(aIdentifier: string, aAnonymize: boolean, aMinimizeMemoryUsage: boolean): void; + dumpMemoryInfoToTempDir( + aIdentifier: string, + aAnonymize: boolean, + aMinimizeMemoryUsage: boolean + ): void; dumpGCAndCCLogsToFile( aIdentifier: string, aDumpAllTraces: boolean, @@ -15140,7 +16293,15 @@ declare global { // https://searchfox.org/mozilla-central/source/xpcom/base/nsIMemoryReporter.idl type nsIHandleReportCallback = Callable<{ - callback(process: string, path: string, kind: i32, units: i32, amount: i64, description: string, data: nsISupports): void; + callback( + process: string, + path: string, + kind: i32, + units: i32, + amount: i64, + description: string, + data: nsISupports + ): void; }>; interface nsIMemoryReporter extends nsISupports { @@ -15268,7 +16429,13 @@ declare global { interface nsICategoryManager extends nsISupports { getCategoryEntry(aCategory: string, aEntry: string): string; - addCategoryEntry(aCategory: string, aEntry: string, aValue: string, aPersist: boolean, aReplace: boolean): string; + addCategoryEntry( + aCategory: string, + aEntry: string, + aValue: string, + aPersist: boolean, + aReplace: boolean + ): string; deleteCategoryEntry(aCategory: string, aEntry: string, aPersist: boolean): void; deleteCategory(aCategory: string): void; enumerateCategory(aCategory: string): nsISimpleEnumerator; @@ -15305,7 +16472,12 @@ declare global { interface nsIComponentRegistrar extends nsISupports { autoRegister(aSpec: nsIFile): void; - registerFactory(aClass: nsID, aClassName: string, aContractID: string, aFactory: nsIFactory): void; + registerFactory( + aClass: nsID, + aClassName: string, + aContractID: string, + aFactory: nsIFactory + ): void; unregisterFactory(aClass: nsID, aFactory: nsIFactory): void; isCIDRegistered(aClass: nsID): boolean; isContractIDRegistered(aContractID: string): boolean; @@ -15694,7 +16866,12 @@ declare global { readonly WAIT_CLOSURE_ONLY?: 1; closeWithStatus(aStatus: nsresult): void; - asyncWait(aCallback: nsIInputStreamCallback, aFlags: u32, aRequestedCount: u32, aEventTarget: nsIEventTarget): void; + asyncWait( + aCallback: nsIInputStreamCallback, + aFlags: u32, + aRequestedCount: u32, + aEventTarget: nsIEventTarget + ): void; } type nsIInputStreamCallback = Callable<{ @@ -15707,7 +16884,12 @@ declare global { readonly WAIT_CLOSURE_ONLY?: 1; closeWithStatus(reason: nsresult): void; - asyncWait(aCallback: nsIOutputStreamCallback, aFlags: u32, aRequestedCount: u32, aEventTarget: nsIEventTarget): void; + asyncWait( + aCallback: nsIOutputStreamCallback, + aFlags: u32, + aRequestedCount: u32, + aEventTarget: nsIEventTarget + ): void; } type nsIOutputStreamCallback = Callable<{ @@ -15944,13 +17126,23 @@ declare global { // https://searchfox.org/mozilla-central/source/xpcom/io/nsIPipe.idl interface nsIPipe extends nsISupports { - init(nonBlockingInput: boolean, nonBlockingOutput: boolean, segmentSize: u32, segmentCount: u32): void; + init( + nonBlockingInput: boolean, + nonBlockingOutput: boolean, + segmentSize: u32, + segmentCount: u32 + ): void; readonly inputStream: nsIAsyncInputStream; readonly outputStream: nsIAsyncOutputStream; } interface nsISearchableInputStream extends nsISupports { - search(forString: string, ignoreCase: boolean, found: OutParam, offsetSearchedTo: OutParam): void; + search( + forString: string, + ignoreCase: boolean, + found: OutParam, + offsetSearchedTo: OutParam + ): void; } // https://searchfox.org/mozilla-central/source/xpcom/io/nsIRandomAccessStream.idl @@ -16436,8 +17628,14 @@ declare global { dispatchToMainThreadWithMicroTask(event: nsIRunnable, priority?: u32): void; idleDispatchToMainThread(event: nsIRunnable, timeout?: u32): void; dispatchDirectTaskToCurrentThread(event: nsIRunnable): void; - spinEventLoopUntil(aVeryGoodReasonToDoThis: string, condition: nsINestedEventLoopCondition): void; - spinEventLoopUntilOrQuit(aVeryGoodReasonToDoThis: string, condition: nsINestedEventLoopCondition): void; + spinEventLoopUntil( + aVeryGoodReasonToDoThis: string, + condition: nsINestedEventLoopCondition + ): void; + spinEventLoopUntilOrQuit( + aVeryGoodReasonToDoThis: string, + condition: nsINestedEventLoopCondition + ): void; spinEventLoopUntilEmpty(): void; readonly mainThreadEventTarget: nsIEventTarget; } @@ -16723,13 +17921,22 @@ declare global { testJsval(a: any, b: InOutParam): any; testShortSequence(a: i16[], b: InOutParam): i16[]; testDoubleSequence(a: double[], b: InOutParam): double[]; - testInterfaceSequence(a: nsIXPCTestInterfaceA[], b: InOutParam): nsIXPCTestInterfaceA[]; + testInterfaceSequence( + a: nsIXPCTestInterfaceA[], + b: InOutParam + ): nsIXPCTestInterfaceA[]; testAStringSequence(a: string[], b: InOutParam): string[]; testACStringSequence(a: string[], b: InOutParam): string[]; testJsvalSequence(a: any[], b: InOutParam): any[]; testSequenceSequence(a: i16[][], b: InOutParam): i16[][]; testOptionalSequence(arr?: u8[]): u8[]; - testShortArray(aLength: u32, a: i16[], bLength: InOutParam, b: InOutParam, rvLength: OutParam): i16[]; + testShortArray( + aLength: u32, + a: i16[], + bLength: InOutParam, + b: InOutParam, + rvLength: OutParam + ): i16[]; testDoubleArray( aLength: u32, a: double[], @@ -16759,9 +17966,27 @@ declare global { rvLength: OutParam ): nsIXPCTestInterfaceA[]; testByteArrayOptionalLength(a: u8[], aLength?: u32): u32; - testSizedString(aLength: u32, a: string, bLength: InOutParam, b: InOutParam, rvLength: OutParam): string; - testSizedWstring(aLength: u32, a: string, bLength: InOutParam, b: InOutParam, rvLength: OutParam): string; - testJsvalArray(aLength: u32, a: any[], bLength: InOutParam, b: InOutParam, rvLength: OutParam): any[]; + testSizedString( + aLength: u32, + a: string, + bLength: InOutParam, + b: InOutParam, + rvLength: OutParam + ): string; + testSizedWstring( + aLength: u32, + a: string, + bLength: InOutParam, + b: InOutParam, + rvLength: OutParam + ): string; + testJsvalArray( + aLength: u32, + a: any[], + bLength: InOutParam, + b: InOutParam, + rvLength: OutParam + ): any[]; testOutAString(o: OutParam): void; testStringArrayOptionalSize(a: string[], aLength?: u32): string; testOmittedOptionalOut(aJSObj: nsIXPCTestParams, aOut?: OutParam): void; @@ -16801,7 +18026,11 @@ declare global { // https://searchfox.org/mozilla-central/source/dom/xul/nsIBrowserController.idl interface nsIBrowserController extends nsISupports { - enableDisableCommands(action: string, enabledCommands: string[], disabledCommands: string[]): void; + enableDisableCommands( + action: string, + enabledCommands: string[], + disabledCommands: string[] + ): void; } // https://searchfox.org/mozilla-central/source/dom/xul/nsIController.idl @@ -16865,8 +18094,20 @@ declare global { hasEntry(aZipEntry: string): boolean; addEntryDirectory(aZipEntry: string, aModTime: PRTime, aQueue: boolean): void; addEntryFile(aZipEntry: string, aCompression: i32, aFile: nsIFile, aQueue: boolean): void; - addEntryChannel(aZipEntry: string, aModTime: PRTime, aCompression: i32, aChannel: nsIChannel, aQueue: boolean): void; - addEntryStream(aZipEntry: string, aModTime: PRTime, aCompression: i32, aStream: nsIInputStream, aQueue: boolean): void; + addEntryChannel( + aZipEntry: string, + aModTime: PRTime, + aCompression: i32, + aChannel: nsIChannel, + aQueue: boolean + ): void; + addEntryStream( + aZipEntry: string, + aModTime: PRTime, + aCompression: i32, + aStream: nsIInputStream, + aQueue: boolean + ): void; removeEntry(aZipEntry: string, aQueue: boolean): void; processQueue(aObserver: nsIRequestObserver, aContext: nsISupports): void; close(): void; @@ -16998,8 +18239,14 @@ declare global { nsIImageLoadingContent: nsJSIID; nsIMessageSender: nsJSIID; nsIObjectLoadingContent: nsJSIID; - nsIScriptableContentIterator: nsJSIID; - nsISelectionController: nsJSIID; + nsIScriptableContentIterator: nsJSIID< + nsIScriptableContentIterator, + typeof nsIScriptableContentIterator_IteratorType + >; + nsISelectionController: nsJSIID< + nsISelectionController, + typeof nsISelectionController_ControllerScrollFlags + >; nsISelectionDisplay: nsJSIID; nsISelectionListener: nsJSIID; nsISlowScriptDebugCallback: nsJSIID; @@ -17103,7 +18350,10 @@ declare global { nsIPushClearResultCallback: nsJSIID; nsIPushService: nsJSIID; nsIPushQuotaManager: nsJSIID; - nsIQuotaArtificialFailure: nsJSIID; + nsIQuotaArtificialFailure: nsJSIID< + nsIQuotaArtificialFailure, + typeof nsIQuotaArtificialFailure_Category + >; nsIQuotaUsageCallback: nsJSIID; nsIQuotaCallback: nsJSIID; nsIQuotaManagerService: nsJSIID; @@ -17119,7 +18369,8 @@ declare global { nsIContentSecurityManager: nsJSIID; nsIContentSecurityPolicy: nsJSIID< nsIContentSecurityPolicy, - typeof nsIContentSecurityPolicy_CSPDirective & typeof nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState + typeof nsIContentSecurityPolicy_CSPDirective & + typeof nsIContentSecurityPolicy_RequireTrustedTypesForDirectiveState >; nsICSPEventListener: nsJSIID; nsIReferrerInfo: nsJSIID; @@ -17293,7 +18544,10 @@ declare global { nsIBufferedOutputStream: nsJSIID; nsIByteRangeRequest: nsJSIID; nsIInputStreamReceiver: nsJSIID; - nsICacheInfoChannel: nsJSIID; + nsICacheInfoChannel: nsJSIID< + nsICacheInfoChannel, + typeof nsICacheInfoChannel_PreferredAlternativeDataDeliveryType + >; nsICachingChannel: nsJSIID; nsICancelable: nsJSIID; nsICaptivePortalServiceCallback: nsJSIID; @@ -17303,7 +18557,10 @@ declare global { nsIChannelEventSink: nsJSIID; nsIChildChannel: nsJSIID; nsIClassOfService: nsJSIID; - nsIClassifiedChannel: nsJSIID; + nsIClassifiedChannel: nsJSIID< + nsIClassifiedChannel, + typeof nsIClassifiedChannel_ClassificationFlags + >; nsIContentSniffer: nsJSIID; nsIDHCPClient: nsJSIID; nsINetDashboardCallback: nsJSIID; @@ -17535,7 +18792,10 @@ declare global { nsIWebSocketEventService: nsJSIID; nsIWebSocketImpl: nsJSIID; nsIWebSocketListener: nsJSIID; - nsIWebTransport: nsJSIID; + nsIWebTransport: nsJSIID< + nsIWebTransport, + typeof nsIWebTransport_WebTransportError & typeof nsIWebTransport_HTTPVersion + >; WebTransportSessionEventListener: nsJSIID< WebTransportSessionEventListener, typeof WebTransportSessionEventListener_DatagramOutcome @@ -17569,7 +18829,10 @@ declare global { nsIClientAuthDialogCallback: nsJSIID; nsIClientAuthDialogService: nsJSIID; nsIClientAuthRememberRecord: nsJSIID; - nsIClientAuthRememberService: nsJSIID; + nsIClientAuthRememberService: nsJSIID< + nsIClientAuthRememberService, + typeof nsIClientAuthRememberService_Duration + >; nsIContentSignatureVerifier: nsJSIID; nsICryptoHash: nsJSIID; nsIDataStorageManager: nsJSIID; @@ -17588,12 +18851,21 @@ declare global { nsIPublicKeyPinningService: nsJSIID; nsISecretDecoderRing: nsJSIID; nsISecurityUITelemetry: nsJSIID; - nsISiteSecurityService: nsJSIID; + nsISiteSecurityService: nsJSIID< + nsISiteSecurityService, + typeof nsISiteSecurityService_ResetStateBy + >; nsITLSSocketControl: nsJSIID; nsITokenPasswordDialogs: nsJSIID; - nsITransportSecurityInfo: nsJSIID; + nsITransportSecurityInfo: nsJSIID< + nsITransportSecurityInfo, + typeof nsITransportSecurityInfo_OverridableErrorCategory + >; nsIX509Cert: nsJSIID; - nsIAppSignatureInfo: nsJSIID; + nsIAppSignatureInfo: nsJSIID< + nsIAppSignatureInfo, + typeof nsIAppSignatureInfo_SignatureAlgorithm + >; nsIOpenSignedAppFileCallback: nsJSIID; nsIAsyncBoolCallback: nsJSIID; nsICertVerificationCallback: nsJSIID; @@ -17611,7 +18883,8 @@ declare global { mozISyncedBookmarksMirrorLogger: nsJSIID; mozISyncedBookmarksMerger: nsJSIID< mozISyncedBookmarksMerger, - typeof mozISyncedBookmarksMerger_SyncedItemKinds & typeof mozISyncedBookmarksMerger_SyncedItemValidity + typeof mozISyncedBookmarksMerger_SyncedItemKinds & + typeof mozISyncedBookmarksMerger_SyncedItemValidity >; nsIFaviconService: nsJSIID; nsIFaviconDataCallback: nsJSIID; @@ -17695,7 +18968,10 @@ declare global { nsIBTPRemoteExceptionList: nsJSIID; nsIBounceTrackingMapEntry: nsJSIID; nsIBounceTrackingPurgeEntry: nsJSIID; - nsIBounceTrackingProtection: nsJSIID; + nsIBounceTrackingProtection: nsJSIID< + nsIBounceTrackingProtection, + typeof nsIBounceTrackingProtection_Modes + >; nsIContentBlockingAllowList: nsJSIID; nsIPartitioningExceptionListObserver: nsJSIID; nsIPartitioningExceptionListService: nsJSIID; @@ -17718,7 +18994,8 @@ declare global { nsIClearDataCallback: nsJSIID; nsIContentAnalysisAcknowledgement: nsJSIID< nsIContentAnalysisAcknowledgement, - typeof nsIContentAnalysisAcknowledgement_Result & typeof nsIContentAnalysisAcknowledgement_FinalAction + typeof nsIContentAnalysisAcknowledgement_Result & + typeof nsIContentAnalysisAcknowledgement_FinalAction >; nsIContentAnalysisResult: nsJSIID; nsIContentAnalysisResponse: nsJSIID< @@ -17757,7 +19034,8 @@ declare global { nsISearchParseSubmissionResult: nsJSIID; nsISearchService: nsJSIID< nsISearchService, - typeof nsISearchService_OpenSearchInstallErrors & typeof nsISearchService_DefaultEngineChangeReason + typeof nsISearchService_OpenSearchInstallErrors & + typeof nsISearchService_DefaultEngineChangeReason >; nsIToolkitShellService: nsJSIID; nsITerminatorTest: nsJSIID; @@ -17847,11 +19125,18 @@ declare global { mozIExtensionServiceWorkerInfo: nsJSIID; mozIExtensionListenerCallOptions: nsJSIID< mozIExtensionListenerCallOptions, - typeof mozIExtensionListenerCallOptions_APIObjectType & typeof mozIExtensionListenerCallOptions_CallbackType + typeof mozIExtensionListenerCallOptions_APIObjectType & + typeof mozIExtensionListenerCallOptions_CallbackType >; mozIExtensionEventListener: nsJSIID; - mozIExtensionAPIRequest: nsJSIID; - mozIExtensionAPIRequestResult: nsJSIID; + mozIExtensionAPIRequest: nsJSIID< + mozIExtensionAPIRequest, + typeof mozIExtensionAPIRequest_RequestType + >; + mozIExtensionAPIRequestResult: nsJSIID< + mozIExtensionAPIRequestResult, + typeof mozIExtensionAPIRequestResult_ResultType + >; mozIExtensionAPIRequestHandler: nsJSIID; mozIExtensionProcessScript: nsJSIID; nsINativeMessagingPortal: nsJSIID; @@ -17873,13 +19158,18 @@ declare global { nsIDragSession: nsJSIID; nsIFilePicker: nsJSIID< nsIFilePicker, - typeof nsIFilePicker_Mode & typeof nsIFilePicker_ResultCode & typeof nsIFilePicker_CaptureTarget + typeof nsIFilePicker_Mode & + typeof nsIFilePicker_ResultCode & + typeof nsIFilePicker_CaptureTarget >; nsIFilePickerShownCallback: nsJSIID; nsIFormatConverter: nsJSIID; nsIGfxInfo: nsJSIID; nsIGfxInfoDebug: nsJSIID; - nsIMockDragServiceController: nsJSIID; + nsIMockDragServiceController: nsJSIID< + nsIMockDragServiceController, + typeof nsIMockDragServiceController_EventType + >; nsIPaper: nsJSIID; nsIPaperMargin: nsJSIID; nsIPrintDialogService: nsJSIID; @@ -18110,7 +19400,8 @@ type PRTime = i64; type PivotMoveReason = i16; type PredictorLearnReason = u32; type PredictorPredictReason = u32; -type RequireTrustedTypesForDirectiveState = nsIContentSecurityPolicy.RequireTrustedTypesForDirectiveState; +type RequireTrustedTypesForDirectiveState = + nsIContentSecurityPolicy.RequireTrustedTypesForDirectiveState; type nsBitsErrorAction = i32; type nsBitsErrorStage = i32; type nsBitsErrorType = i32; diff --git a/src/zen/@types/zen.d.ts b/src/zen/@types/zen.d.ts index 6e49453c..de613258 100644 --- a/src/zen/@types/zen.d.ts +++ b/src/zen/@types/zen.d.ts @@ -164,7 +164,11 @@ declare namespace MockedExports { removeObserver: (aDomain: string, aObserver: PrefObserver) => void; }; - type PrefObserverFunction = (aSubject: nsIPrefBranch, aTopic: 'nsPref:changed', aData: string) => unknown; + type PrefObserverFunction = ( + aSubject: nsIPrefBranch, + aTopic: 'nsPref:changed', + aData: string + ) => unknown; type PrefObserver = PrefObserverFunction | { observe: PrefObserverFunction }; interface nsIURI {} @@ -216,7 +220,9 @@ declare namespace MockedExports { GetFeatures: () => string[]; getProfileDataAsync: (sinceTime?: number) => Promise; getProfileDataAsArrayBuffer: (sinceTime?: number) => Promise; - getProfileDataAsGzippedArrayBuffer: (sinceTime?: number) => Promise; + getProfileDataAsGzippedArrayBuffer: ( + sinceTime?: number + ) => Promise; IsActive: () => boolean; sharedLibraries: SharedLibrary[]; }; @@ -273,7 +279,10 @@ declare namespace MockedExports { const PlaceUtilsSYSMJS: { PlacesUtils: { - promiseFaviconData: (pageUrl: string | URL | nsIURI, preferredWidth?: number) => Promise; + promiseFaviconData: ( + pageUrl: string | URL | nsIURI, + preferredWidth?: number + ) => Promise; // TS-TODO: Add the rest. }; }; @@ -429,8 +438,16 @@ declare interface XULCommandEvent extends Event { } declare interface XULElementWithCommandHandler { - addEventListener: (type: 'command', handler: (event: XULCommandEvent) => void, isCapture?: boolean) => void; - removeEventListener: (type: 'command', handler: (event: XULCommandEvent) => void, isCapture?: boolean) => void; + addEventListener: ( + type: 'command', + handler: (event: XULCommandEvent) => void, + isCapture?: boolean + ) => void; + removeEventListener: ( + type: 'command', + handler: (event: XULCommandEvent) => void, + isCapture?: boolean + ) => void; } declare type nsIPrefBranch = MockedExports.nsIPrefBranch; diff --git a/src/zen/common/ZenCommonUtils.mjs b/src/zen/common/ZenCommonUtils.mjs index 054a2219..50927343 100644 --- a/src/zen/common/ZenCommonUtils.mjs +++ b/src/zen/common/ZenCommonUtils.mjs @@ -65,7 +65,9 @@ var gZenCommonActions = { if (currentUrl) { let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString); str.data = currentUrl; - let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable); + let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance( + Ci.nsITransferable + ); transferable.init(getLoadContext()); transferable.addDataFlavor('text/plain'); transferable.setTransferData('text/plain', str); @@ -80,7 +82,9 @@ var gZenCommonActions = { const markdownLink = `[${tabTitle}](${currentUrl})`; let str = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString); str.data = markdownLink; - let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable); + let transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance( + Ci.nsITransferable + ); transferable.init(getLoadContext()); transferable.addDataFlavor('text/plain'); transferable.setTransferData('text/plain', str); diff --git a/src/zen/common/ZenCustomizableUI.sys.mjs b/src/zen/common/ZenCustomizableUI.sys.mjs index cbc30ea2..a61a5905 100644 --- a/src/zen/common/ZenCustomizableUI.sys.mjs +++ b/src/zen/common/ZenCustomizableUI.sys.mjs @@ -103,8 +103,13 @@ export var ZenCustomizableUI = new (class { _moveWindowButtons(window) { const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container'); - const toolboxIcons = window.document.getElementById('zen-sidebar-top-buttons-customization-target'); - if (window.AppConstants.platform === 'macosx' || window.matchMedia('(-moz-gtk-csd-reversed-placement)').matches) { + const toolboxIcons = window.document.getElementById( + 'zen-sidebar-top-buttons-customization-target' + ); + if ( + window.AppConstants.platform === 'macosx' || + window.matchMedia('(-moz-gtk-csd-reversed-placement)').matches + ) { for (let i = 0; i < windowControls.length; i++) { if (i === 0) { toolboxIcons.prepend(windowControls[i]); @@ -131,7 +136,11 @@ export var ZenCustomizableUI = new (class { } registerToolbarNodes(window) { - window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons')); - window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-bottom-buttons')); + window.CustomizableUI.registerToolbarNode( + window.document.getElementById('zen-sidebar-top-buttons') + ); + window.CustomizableUI.registerToolbarNode( + window.document.getElementById('zen-sidebar-bottom-buttons') + ); } })(); diff --git a/src/zen/common/ZenStartup.mjs b/src/zen/common/ZenStartup.mjs index 80364024..fa2989f2 100644 --- a/src/zen/common/ZenStartup.mjs +++ b/src/zen/common/ZenStartup.mjs @@ -37,7 +37,10 @@ this._checkForWelcomePage(); - document.l10n.setAttributes(document.getElementById('tabs-newtab-button'), 'tabs-toolbar-new-tab'); + document.l10n.setAttributes( + document.getElementById('tabs-newtab-button'), + 'tabs-toolbar-new-tab' + ); } catch (e) { console.error('ZenThemeModifier: Error initializing browser layout', e); } @@ -104,7 +107,9 @@ } ) .then(() => { - for (let elem of document.querySelectorAll('#browser > *, #urlbar, #tabbrowser-tabbox > *')) { + for (let elem of document.querySelectorAll( + '#browser > *, #urlbar, #tabbrowser-tabbox > *' + )) { elem.style.removeProperty('opacity'); } }); @@ -141,7 +146,10 @@ _initSidebarScrolling() { // Disable smooth scroll - const canSmoothScroll = Services.prefs.getBoolPref('zen.startup.smooth-scroll-in-tabs', false); + const canSmoothScroll = Services.prefs.getBoolPref( + 'zen.startup.smooth-scroll-in-tabs', + false + ); const tabsWrapper = document.getElementById('zen-tabs-wrapper'); gBrowser.tabContainer.addEventListener('wheel', (event) => { if (canSmoothScroll) return; @@ -162,7 +170,9 @@ window.requestAnimationFrame(() => { tabContainer.arrowScrollbox.toggleAttribute('overflowing', overflowing); - tabContainer.arrowScrollbox.dispatchEvent(new CustomEvent(overflowing ? 'overflow' : 'underflow')); + tabContainer.arrowScrollbox.dispatchEvent( + new CustomEvent(overflowing ? 'overflow' : 'underflow') + ); }); }); observer.observe(tabsWrapper); @@ -180,7 +190,10 @@ _checkForWelcomePage() { if (!Services.prefs.getBoolPref('zen.welcome-screen.seen', false)) { Services.prefs.setBoolPref('zen.welcome-screen.seen', true); - Services.scriptloader.loadSubScript('chrome://browser/content/zen-components/ZenWelcome.mjs', window); + Services.scriptloader.loadSubScript( + 'chrome://browser/content/zen-components/ZenWelcome.mjs', + window + ); } }, }; diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index 533d131f..245d4070 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -9,22 +9,41 @@ var gZenUIManager = { init() { document.addEventListener('popupshowing', this.onPopupShowing.bind(this)); document.addEventListener('popuphidden', this.onPopupHidden.bind(this)); - XPCOMUtils.defineLazyPreferenceGetter(this, 'sidebarHeightThrottle', 'zen.view.sidebar-height-throttle', 500); - XPCOMUtils.defineLazyPreferenceGetter(this, 'contentElementSeparation', 'zen.theme.content-element-separation', 0); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'sidebarHeightThrottle', + 'zen.view.sidebar-height-throttle', + 500 + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'contentElementSeparation', + 'zen.theme.content-element-separation', + 0 + ); XPCOMUtils.defineLazyPreferenceGetter(this, 'urlbarWaitToClear', 'zen.urlbar.wait-to-clear', 0); - XPCOMUtils.defineLazyPreferenceGetter(this, 'urlbarShowDomainOnly', 'zen.urlbar.show-domain-only-in-sidebar', true); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'urlbarShowDomainOnly', + 'zen.urlbar.show-domain-only-in-sidebar', + true + ); gURLBar._zenTrimURL = this.urlbarTrim.bind(this); ChromeUtils.defineLazyGetter(this, 'motion', () => { - return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { global: 'current' }); + return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { + global: 'current', + }); }); ChromeUtils.defineLazyGetter(this, '_toastContainer', () => { return document.getElementById('zen-toast-container'); }); - new ResizeObserver(this.updateTabsToolbar.bind(this)).observe(document.getElementById('TabsToolbar')); + new ResizeObserver(this.updateTabsToolbar.bind(this)).observe( + document.getElementById('TabsToolbar') + ); new ResizeObserver( gZenCommonActions.throttle( @@ -132,7 +151,8 @@ var gZenUIManager = { // we also ignore menus inside panels if ( !el.contains(showEvent.explicitOriginalTarget) || - (showEvent.explicitOriginalTarget instanceof Element && showEvent.explicitOriginalTarget?.closest('panel')) + (showEvent.explicitOriginalTarget instanceof Element && + showEvent.explicitOriginalTarget?.closest('panel')) ) { continue; } @@ -202,7 +222,9 @@ var gZenUIManager = { const timeSinceLastSwitch = now - this._tabSwitchState.lastSwitchTime; if (timeSinceLastSwitch < this._tabSwitchState.debounceTime) { - await new Promise((resolve) => setTimeout(resolve, this._tabSwitchState.debounceTime - timeSinceLastSwitch)); + await new Promise((resolve) => + setTimeout(resolve, this._tabSwitchState.debounceTime - timeSinceLastSwitch) + ); } // Execute operation @@ -247,7 +269,11 @@ var gZenUIManager = { return false; } - const shouldOpenURLBar = gZenVerticalTabsManager._canReplaceNewTab && !werePassedURL && !searchClipboard && where === 'tab'; + const shouldOpenURLBar = + gZenVerticalTabsManager._canReplaceNewTab && + !werePassedURL && + !searchClipboard && + where === 'tab'; if (!shouldOpenURLBar) { return false; @@ -323,7 +349,12 @@ var gZenUIManager = { gURLBar.removeAttribute('zen-newtab'); // Safely restore tab visual state with proper validation - if (this._lastTab && !this._lastTab.closing && this._lastTab.ownerGlobal && !this._lastTab.ownerGlobal.closed) { + if ( + this._lastTab && + !this._lastTab.closing && + this._lastTab.ownerGlobal && + !this._lastTab.ownerGlobal.closed + ) { this._lastTab._visuallySelected = true; this._lastTab = null; } @@ -421,12 +452,14 @@ var gZenUIManager = { clearTimeout(this._toastTimeouts[messageId]); } this._toastTimeouts[messageId] = setTimeout(() => { - this.motion.animate(toast, { opacity: [1, 0], scale: [1, 0.5] }, { duration: 0.2, bounce: 0 }).then(() => { - toast.remove(); - if (this._toastContainer.children.length === 0) { - this._toastContainer.setAttribute('hidden', true); - } - }); + this.motion + .animate(toast, { opacity: [1, 0], scale: [1, 0.5] }, { duration: 0.2, bounce: 0 }) + .then(() => { + toast.remove(); + if (this._toastContainer.children.length === 0) { + this._toastContainer.setAttribute('hidden', true); + } + }); }, options.timeout || 3000); }, @@ -457,7 +490,12 @@ var gZenVerticalTabsManager = { ); }); - XPCOMUtils.defineLazyPreferenceGetter(this, '_canReplaceNewTab', 'zen.urlbar.replace-newtab', true); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_canReplaceNewTab', + 'zen.urlbar.replace-newtab', + true + ); var updateEvent = this._updateEvent.bind(this); var onPrefChange = this._onPrefChange.bind(this); @@ -506,7 +544,9 @@ var gZenVerticalTabsManager = { if (this.__topButtonsSeparatorElement) { return this.__topButtonsSeparatorElement; } - this.__topButtonsSeparatorElement = document.getElementById('zen-sidebar-top-buttons-separator'); + this.__topButtonsSeparatorElement = document.getElementById( + 'zen-sidebar-top-buttons-separator' + ); return this.__topButtonsSeparatorElement; }, @@ -573,7 +613,10 @@ var gZenVerticalTabsManager = { async _preCustomize() { await this._multiWindowFeature.foreachWindowAsActive(async (browser) => { - browser.gZenVerticalTabsManager._updateEvent({ forCustomizableMode: true, dontRebuildAreas: true }); + browser.gZenVerticalTabsManager._updateEvent({ + forCustomizableMode: true, + dontRebuildAreas: true, + }); }); this.rebuildAreas(); this.navigatorToolbox.setAttribute('zen-sidebar-expanded', 'true'); @@ -588,10 +631,34 @@ var gZenVerticalTabsManager = { }, initializePreferences(updateEvent) { - XPCOMUtils.defineLazyPreferenceGetter(this, '_prefsVerticalTabs', 'zen.tabs.vertical', true, updateEvent); - XPCOMUtils.defineLazyPreferenceGetter(this, '_prefsRightSide', 'zen.tabs.vertical.right-side', false, updateEvent); - XPCOMUtils.defineLazyPreferenceGetter(this, '_prefsUseSingleToolbar', 'zen.view.use-single-toolbar', false, updateEvent); - XPCOMUtils.defineLazyPreferenceGetter(this, '_prefsSidebarExpanded', 'zen.view.sidebar-expanded', false, updateEvent); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_prefsVerticalTabs', + 'zen.tabs.vertical', + true, + updateEvent + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_prefsRightSide', + 'zen.tabs.vertical.right-side', + false, + updateEvent + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_prefsUseSingleToolbar', + 'zen.view.use-single-toolbar', + false, + updateEvent + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_prefsSidebarExpanded', + 'zen.view.sidebar-expanded', + false, + updateEvent + ); XPCOMUtils.defineLazyPreferenceGetter( this, '_prefsSidebarExpandedMaxWidth', @@ -648,7 +715,10 @@ var gZenVerticalTabsManager = { this._updateMaxWidth(); if (window.docShell) { - window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow).rollupAllPopups(); + window.docShell.treeOwner + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIAppWindow) + .rollupAllPopups(); } const topButtons = document.getElementById('zen-sidebar-top-buttons'); @@ -663,7 +733,10 @@ var gZenVerticalTabsManager = { const titlebar = document.getElementById('titlebar'); gBrowser.tabContainer.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal'); - gBrowser.tabContainer.arrowScrollbox.setAttribute('orient', isVerticalTabs ? 'vertical' : 'horizontal'); + gBrowser.tabContainer.arrowScrollbox.setAttribute( + 'orient', + isVerticalTabs ? 'vertical' : 'horizontal' + ); // on purpose, we set the orient to horizontal, because the arrowScrollbox is vertical gBrowser.tabContainer.arrowScrollbox.scrollbox.setAttribute( 'orient', @@ -775,7 +848,13 @@ var gZenVerticalTabsManager = { } // Case: single toolbar, not compact mode, not right side and macos styled buttons - if (!doNotChangeWindowButtons && isSingleToolbar && !isCompactMode && !isRightSide && !this.isWindowsStyledButtons) { + if ( + !doNotChangeWindowButtons && + isSingleToolbar && + !isCompactMode && + !isRightSide && + !this.isWindowsStyledButtons + ) { topButtons.prepend(windowButtons); } // Case: single toolbar, compact mode, right side and windows styled buttons @@ -890,7 +969,11 @@ var gZenVerticalTabsManager = { } if (this._tabEdited.getAttribute('zen-pin-id')) { // Update pin title in storage - await gZenPinnedTabManager.updatePinTitle(this._tabEdited, this._tabEdited.label, !!newName); + await gZenPinnedTabManager.updatePinTitle( + this._tabEdited, + this._tabEdited.label, + !!newName + ); } document.documentElement.removeAttribute('zen-renaming-tab'); @@ -923,7 +1006,11 @@ var gZenVerticalTabsManager = { ) return; this._tabEdited = event.target.closest('.tabbrowser-tab'); - if (!this._tabEdited || !this._tabEdited.pinned || this._tabEdited.hasAttribute('zen-essential')) { + if ( + !this._tabEdited || + !this._tabEdited.pinned || + this._tabEdited.hasAttribute('zen-essential') + ) { this._tabEdited = null; return; } diff --git a/src/zen/common/styles/zen-browser-ui.css b/src/zen/common/styles/zen-browser-ui.css index 6b159db7..b913dbd5 100644 --- a/src/zen/common/styles/zen-browser-ui.css +++ b/src/zen/common/styles/zen-browser-ui.css @@ -177,7 +177,11 @@ .titlebar-buttonbox-container { /* Draw 3 dots as background to represent the window controls, all with the same cololr as the titlebar */ - background-image: radial-gradient(circle, var(--zen-toolbar-element-bg) 6px, transparent 0.5px); + background-image: radial-gradient( + circle, + var(--zen-toolbar-element-bg) 6px, + transparent 0.5px + ); background-size: 20px 22px; background-position: 53% 50%; diff --git a/src/zen/common/styles/zen-popup.css b/src/zen/common/styles/zen-popup.css index 2a028539..2dd706be 100644 --- a/src/zen/common/styles/zen-popup.css +++ b/src/zen/common/styles/zen-popup.css @@ -11,7 +11,8 @@ :root { --panel-subview-body-padding: 2px 0; --arrowpanel-menuitem-border-radius: 5px; - --arrowpanel-menuitem-margin: var(--uc-arrowpanel-menuitem-margin-block) var(--uc-arrowpanel-menuitem-margin-inline); + --arrowpanel-menuitem-margin: var(--uc-arrowpanel-menuitem-margin-block) + var(--uc-arrowpanel-menuitem-margin-inline); --arrowpanel-menuitem-padding-block: 8px; --arrowpanel-menuitem-padding-inline: 14px; --uc-arrowpanel-menuicon-margin-inline: 14px; @@ -22,7 +23,9 @@ --uc-panel-zoom-button-padding: 8px; --uc-panel-zoom-button-inline-padding: 9px; - --uc-panel-zoom-padding-block: calc(var(--panel-separator-margin-vertical) + var(--uc-arrowpanel-menuitem-margin-block)); + --uc-panel-zoom-padding-block: calc( + var(--panel-separator-margin-vertical) + var(--uc-arrowpanel-menuitem-margin-block) + ); --uc-autocomplete-panel-menuitem-margin: 4px; --uc-autocomplete-panel-menuicon-padding-inline: 14px; @@ -62,7 +65,9 @@ panel { } .widget-overflow-list .toolbarbutton-1:not(.toolbarbutton-combined) > .toolbarbutton-text, -.subviewbutton:not(#appMenu-zoom-controls > .subviewbutton) > .toolbarbutton-icon + .toolbarbutton-text, +.subviewbutton:not(#appMenu-zoom-controls > .subviewbutton) + > .toolbarbutton-icon + + .toolbarbutton-text, #appMenu-fxa-label2 > vbox { padding-inline-start: var(--uc-arrowpanel-menuicon-margin-inline); } @@ -101,7 +106,9 @@ panel { /* zoom controls */ #appMenu-zoom-controls { border-top: 1px solid var(--panel-separator-color); - padding-inline: calc(var(--arrowpanel-menuitem-padding-inline) + var(--uc-arrowpanel-menuitem-margin-inline)) + padding-inline: calc( + var(--arrowpanel-menuitem-padding-inline) + var(--uc-arrowpanel-menuitem-margin-inline) + ) var(--uc-arrowpanel-menuitem-margin-inline); padding-block: var(--uc-panel-zoom-padding-block); margin: var(--panel-separator-margin-vertical) 0 calc(var(--panel-separator-margin-vertical) * -1); @@ -118,7 +125,9 @@ panel { /* #appMenu-zoomReduce-button2, */ #appMenu-zoom-controls > #appMenu-fullscreen-button2 { - margin-left: calc((var(--panel-separator-margin-vertical) + var(--uc-arrowpanel-menuitem-margin-block)) * 2 + 1px); + margin-left: calc( + (var(--panel-separator-margin-vertical) + var(--uc-arrowpanel-menuitem-margin-block)) * 2 + 1px + ); } #appMenu-zoom-controls > #appMenu-fullscreen-button2::before { diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index 961e651a..afadc784 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -35,9 +35,17 @@ --zen-colors-hover-bg: color-mix(in srgb, var(--zen-primary-color) 90%, white 10%); --zen-colors-primary-foreground: var(--zen-branding-bg-reverse); --zen-colors-border: color-mix(in srgb, var(--zen-colors-secondary) 97%, black 3%); - --zen-colors-border-contrast: color-mix(in srgb, var(--zen-colors-secondary) 10%, rgba(181, 181, 181, 0.11) 90%); + --zen-colors-border-contrast: color-mix( + in srgb, + var(--zen-colors-secondary) 10%, + rgba(181, 181, 181, 0.11) 90% + ); - --zen-colors-input-bg: color-mix(in srgb, var(--zen-primary-color) 1%, var(--zen-colors-tertiary) 99%); + --zen-colors-input-bg: color-mix( + in srgb, + var(--zen-primary-color) 1%, + var(--zen-colors-tertiary) 99% + ); --zen-dialog-background: var(--zen-colors-tertiary); --zen-urlbar-background: color-mix(in srgb, var(--zen-primary-color) 3%, #f4f4f4 97%); @@ -71,7 +79,11 @@ /* This is like the secondary button */ --in-content-button-background: transparent !important; --in-content-button-text-color: var(--zen-secondary-btn-color) !important; - --in-content-button-background-hover: color-mix(in srgb, currentColor 3%, transparent 97%) !important; + --in-content-button-background-hover: color-mix( + in srgb, + currentColor 3%, + transparent 97% + ) !important; --button-bgcolor: var(--in-content-button-background) !important; --button-hover-bgcolor: var(--in-content-button-background-hover) !important; --button-hover-color: var(--in-content-button-text-color-hover) !important; @@ -95,7 +107,11 @@ --link-color: var(--zen-branding-bg-reverse) !important; --link-color-hover: var(--zen-colors-primary-foreground) !important; - --link-color-active: color-mix(in srgb, var(--zen-colors-primary-foreground) 80%, transparent 20%) !important; + --link-color-active: color-mix( + in srgb, + var(--zen-colors-primary-foreground) 80%, + transparent 20% + ) !important; --in-content-page-background: var(--zen-colors-tertiary) !important; --zen-in-content-dialog-background: var(--zen-colors-tertiary); @@ -110,7 +126,11 @@ --zen-toolbar-button-inner-padding: 6px; --toolbarbutton-outer-padding: 4px; - --toolbarbutton-hover-background: color-mix(in srgb, var(--zen-branding-bg-reverse) 10%, transparent 90%); + --toolbarbutton-hover-background: color-mix( + in srgb, + var(--zen-branding-bg-reverse) 10%, + transparent 90% + ); /* Other colors */ --urlbar-box-bgcolor: var(--zen-urlbar-background) !important; @@ -143,7 +163,8 @@ --fp-contextmenu-menuicon-margin-inline: 12px; --fp-contextmenu-menuitem-margin-inline: calc(4px - var(--fp-contextmenu-menuitem-border-width)); --fp-contextmenu-menuitem-margin-block: 0px; - --fp-contextmenu-menuitem-margin: var(--fp-contextmenu-menuitem-margin-block) var(--fp-contextmenu-menuitem-margin-inline); + --fp-contextmenu-menuitem-margin: var(--fp-contextmenu-menuitem-margin-block) + var(--fp-contextmenu-menuitem-margin-inline); --fp-contextmenu-separator-vertical: calc(4px - var(--fp-contextmenu-menuitem-border-width)); --fp-contextmenu-separator-horizontal: 0; --fp-contextmenu-bgcolor: light-dark(Menu, rgb(43 42 51 / 0.95)); @@ -163,7 +184,11 @@ background: transparent; --zen-themed-toolbar-bg-transparent: transparent; @media -moz-pref('widget.windows.mica.toplevel-backdrop', 2) { - --zen-themed-toolbar-bg-transparent: color-mix(in srgb, var(--zen-themed-toolbar-bg) 35%, transparent 65%); + --zen-themed-toolbar-bg-transparent: color-mix( + in srgb, + var(--zen-themed-toolbar-bg) 35%, + transparent 65% + ); } } @@ -179,7 +204,11 @@ --zen-active-tab-scale: 0.98; /* Define tab hover background color */ - --tab-hover-background-color: color-mix(in srgb, var(--toolbarbutton-hover-background) 50%, transparent 50%); + --tab-hover-background-color: color-mix( + in srgb, + var(--toolbarbutton-hover-background) 50%, + transparent 50% + ); /* Nativity */ --zen-native-content-radius: var(--zen-border-radius); @@ -218,20 +247,48 @@ :root { --zen-in-content-dialog-background: var(--zen-branding-bg); --zen-dark-color-mix-base: var(--zen-branding-bg); - --zen-colors-primary: color-mix(in srgb, var(--zen-primary-color) 20%, var(--zen-dark-color-mix-base) 80%); - --zen-colors-secondary: color-mix(in srgb, var(--zen-primary-color) 30%, var(--zen-dark-color-mix-base) 70%); - --zen-colors-tertiary: color-mix(in srgb, var(--zen-primary-color) 1%, var(--zen-dark-color-mix-base) 99%); + --zen-colors-primary: color-mix( + in srgb, + var(--zen-primary-color) 20%, + var(--zen-dark-color-mix-base) 80% + ); + --zen-colors-secondary: color-mix( + in srgb, + var(--zen-primary-color) 30%, + var(--zen-dark-color-mix-base) 70% + ); + --zen-colors-tertiary: color-mix( + in srgb, + var(--zen-primary-color) 1%, + var(--zen-dark-color-mix-base) 99% + ); - --zen-colors-hover-bg: color-mix(in srgb, var(--zen-primary-color) 90%, var(--zen-dark-color-mix-base) 10%); + --zen-colors-hover-bg: color-mix( + in srgb, + var(--zen-primary-color) 90%, + var(--zen-dark-color-mix-base) 10% + ); --zen-colors-primary-foreground: color-mix(in srgb, var(--zen-primary-color) 80%, white 20%); - --zen-colors-input-bg: color-mix(in srgb, var(--zen-primary-color) 1%, var(--zen-dark-color-mix-base) 99%); + --zen-colors-input-bg: color-mix( + in srgb, + var(--zen-primary-color) 1%, + var(--zen-dark-color-mix-base) 99% + ); --zen-colors-border: color-mix(in srgb, var(--zen-colors-secondary) 20%, rgb(79, 79, 79) 80%); - --zen-colors-border-contrast: color-mix(in srgb, var(--zen-colors-secondary) 10%, rgba(255, 255, 255, 0.11) 90%); + --zen-colors-border-contrast: color-mix( + in srgb, + var(--zen-colors-secondary) 10%, + rgba(255, 255, 255, 0.11) 90% + ); --zen-dialog-background: var(--zen-dark-color-mix-base); --zen-urlbar-background: color-mix(in srgb, var(--zen-primary-color) 4%, rgb(24, 24, 24) 96%); - --zen-browser-gradient-base: color-mix(in srgb, var(--zen-primary-color) 30%, var(--zen-dark-color-mix-base) 70%); + --zen-browser-gradient-base: color-mix( + in srgb, + var(--zen-primary-color) 30%, + var(--zen-dark-color-mix-base) 70% + ); } } diff --git a/src/zen/common/styles/zen-urlbar.css b/src/zen/common/styles/zen-urlbar.css index 5ea18338..d73dcaa8 100644 --- a/src/zen/common/styles/zen-urlbar.css +++ b/src/zen/common/styles/zen-urlbar.css @@ -137,7 +137,9 @@ margin-right: 0px !important; } -#identity-box:has(#identity-permission-box:is([hasPermissions], [hasSharingIcon])):not([pageproxystate='invalid']) +#identity-box:has(#identity-permission-box:is([hasPermissions], [hasSharingIcon])):not( + [pageproxystate='invalid'] + ) #identity-icon-box { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; @@ -208,9 +210,9 @@ } #urlbar[open] - :is(#tracking-protection-icon-container, .urlbar-page-action, .identity-box-button):not([hidden='true']):not( - #identity-permission-box - ), + :is(#tracking-protection-icon-container, .urlbar-page-action, .identity-box-button):not( + [hidden='true'] + ):not(#identity-permission-box), #urlbar:hover #identity-icon-box { opacity: 1 !important; margin-inline-start: 0 !important; @@ -263,7 +265,9 @@ border-radius: 999px; margin: 0 4px 0 0 !important; padding: 0 4px; - min-width: calc(var(--urlbar-min-height) - 4px - 4 * var(--urlbar-container-padding)) !important; + min-width: calc( + var(--urlbar-min-height) - 4px - 4 * var(--urlbar-container-padding) + ) !important; height: calc(var(--urlbar-min-height) - 4px - 4 * var(--urlbar-container-padding)) !important; justify-content: center; gap: 8px; @@ -286,7 +290,8 @@ button.popup-notification-dropmarker { border-bottom-left-radius: 0 !important; } -.panel-footer:has(button.popup-notification-dropmarker:not([hidden='true'])) button.popup-notification-secondary-button { +.panel-footer:has(button.popup-notification-dropmarker:not([hidden='true'])) + button.popup-notification-secondary-button { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; } @@ -361,7 +366,9 @@ button.popup-notification-dropmarker { /* Border radius on hover */ #urlbar .urlbar-page-action, #urlbar #tracking-protection-icon-container, -#urlbar:not([breakout-extend='true']) #identity-box:is(:not(.chromeUI), [pageproxystate='invalid']) #identity-icon-box { +#urlbar:not([breakout-extend='true']) + #identity-box:is(:not(.chromeUI), [pageproxystate='invalid']) + #identity-icon-box { border-radius: var(--urlbar-icon-border-radius) !important; } @@ -598,7 +605,11 @@ button.popup-notification-dropmarker { &:hover { .urlbarView-favicon, & { - background-color: color-mix(in srgb, var(--zen-branding-bg-reverse) 5%, transparent 95%) !important; + background-color: color-mix( + in srgb, + var(--zen-branding-bg-reverse) 5%, + transparent 95% + ) !important; } } diff --git a/src/zen/common/zen-sets.js b/src/zen/common/zen-sets.js index f5534d18..1a8a697d 100644 --- a/src/zen/common/zen-sets.js +++ b/src/zen/common/zen-sets.js @@ -69,7 +69,9 @@ document.addEventListener( gZenThemePicker.openThemePicker(event); break; case 'cmd_zenChangeWorkspaceTab': - ZenWorkspaces.changeTabWorkspace(event.sourceEvent.target.getAttribute('zen-workspace-id')); + ZenWorkspaces.changeTabWorkspace( + event.sourceEvent.target.getAttribute('zen-workspace-id') + ); break; case 'cmd_zenToggleTabsOnRight': gZenVerticalTabsManager.toggleTabsOnRight(); diff --git a/src/zen/common/zenThemeModifier.js b/src/zen/common/zenThemeModifier.js index 67f32c78..76f8ca4c 100644 --- a/src/zen/common/zenThemeModifier.js +++ b/src/zen/common/zenThemeModifier.js @@ -10,7 +10,11 @@ * FOR ANY WEBSITE THAT WOULD NEED TO USE THE ACCENT COLOR, ETC */ -const kZenThemePrefsList = ['zen.theme.accent-color', 'zen.theme.border-radius', 'zen.theme.content-element-separation']; +const kZenThemePrefsList = [ + 'zen.theme.accent-color', + 'zen.theme.border-radius', + 'zen.theme.content-element-separation', +]; const kZenMaxElementSeparation = 12; /** @@ -79,7 +83,10 @@ var ZenThemeModifier = { }, get elementSeparation() { - return Math.min(Services.prefs.getIntPref('zen.theme.content-element-separation'), kZenMaxElementSeparation); + return Math.min( + Services.prefs.getIntPref('zen.theme.content-element-separation'), + kZenMaxElementSeparation + ); }, /** diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 06383b16..74c58539 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -21,7 +21,9 @@ XPCOMUtils.defineLazyPreferenceGetter( true ); -ChromeUtils.defineLazyGetter(lazyCompactMode, 'mainAppWrapper', () => document.getElementById('zen-main-app-wrapper')); +ChromeUtils.defineLazyGetter(lazyCompactMode, 'mainAppWrapper', () => + document.getElementById('zen-main-app-wrapper') +); var gZenCompactModeManager = { _flashTimeouts: {}, @@ -31,7 +33,8 @@ var gZenCompactModeManager = { preInit() { // Remove it before initializing so we can properly calculate the width // of the sidebar at startup and avoid overflowing items not being hidden - const isCompactMode = lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true'; + const isCompactMode = + lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true'; lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode'); this._wasInCompactMode = isCompactMode; @@ -41,15 +44,23 @@ var gZenCompactModeManager = { init() { this.addMouseActions(); - Services.prefs.addObserver('zen.tabs.vertical.right-side', this._updateSidebarIsOnRight.bind(this)); + Services.prefs.addObserver( + 'zen.tabs.vertical.right-side', + this._updateSidebarIsOnRight.bind(this) + ); gZenUIManager.addPopupTrackingAttribute(this.sidebar); - gZenUIManager.addPopupTrackingAttribute(document.getElementById('zen-appcontent-navbar-container')); + gZenUIManager.addPopupTrackingAttribute( + document.getElementById('zen-appcontent-navbar-container') + ); // Clear hover states when window state changes (minimize, maximize, etc.) window.addEventListener('sizemodechange', () => this._clearAllHoverStates()); - this._canShowBackgroundTabToast = Services.prefs.getBoolPref('zen.view.compact.show-background-tab-toast', true); + this._canShowBackgroundTabToast = Services.prefs.getBoolPref( + 'zen.view.compact.show-background-tab-toast', + true + ); if (AppConstants.platform == 'macosx') { window.addEventListener('mouseover', (event) => { @@ -66,7 +77,10 @@ var gZenCompactModeManager = { }, set preference(value) { - if (this.preference === value || document.documentElement.hasAttribute('zen-compact-animating')) { + if ( + this.preference === value || + document.documentElement.hasAttribute('zen-compact-animating') + ) { if (typeof this._wasInCompactMode !== 'undefined') { // We wont do anything with it anyway, so we remove it delete this._wasInCompactMode; @@ -101,7 +115,12 @@ var gZenCompactModeManager = { if (aInstant) { gZenVerticalTabsManager.recalculateURLBarHeight(); } - if (!aInstant && this.preference && lazyCompactMode.COMPACT_MODE_FLASH_ENABLED && !gZenGlanceManager._animating) { + if ( + !aInstant && + this.preference && + lazyCompactMode.COMPACT_MODE_FLASH_ENABLED && + !gZenGlanceManager._animating + ) { this.flashSidebar(); } }, @@ -192,11 +211,15 @@ var gZenCompactModeManager = { // Get the splitter width before hiding it (we need to hide it before animating on right) document.documentElement.setAttribute('zen-compact-animating', 'true'); // We need to set the splitter width before hiding it - let splitterWidth = document.getElementById('zen-sidebar-splitter').getBoundingClientRect().width; + let splitterWidth = document + .getElementById('zen-sidebar-splitter') + .getBoundingClientRect().width; const isCompactMode = this.preference; const canHideSidebar = - Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || gZenVerticalTabsManager._hasSetSingleToolbar; - let canAnimate = lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && !this.isSidebarPotentiallyOpen(); + Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || + gZenVerticalTabsManager._hasSetSingleToolbar; + let canAnimate = + lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && !this.isSidebarPotentiallyOpen(); if (typeof this._wasInCompactMode !== 'undefined') { canAnimate = false; delete this._wasInCompactMode; @@ -316,7 +339,9 @@ var gZenCompactModeManager = { }, updateContextMenu() { - document.getElementById('zen-context-menu-compact-mode-toggle').setAttribute('checked', this.preference); + document + .getElementById('zen-context-menu-compact-mode-toggle') + .setAttribute('checked', this.preference); const hideTabBar = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar', false); const hideToolbar = Services.prefs.getBoolPref('zen.view.compact.hide-toolbar', false); @@ -330,7 +355,9 @@ var gZenCompactModeManager = { _removeOpenStateOnUnifiedExtensions() { // Fix for bug https://github.com/zen-browser/desktop/issues/1925 - const buttons = document.querySelectorAll('toolbarbutton:is(#unified-extensions-button, .webextension-browser-action)'); + const buttons = document.querySelectorAll( + 'toolbarbutton:is(#unified-extensions-button, .webextension-browser-action)' + ); for (let button of buttons) { button.removeAttribute('open'); } @@ -434,7 +461,10 @@ var gZenCompactModeManager = { if (event.type === 'mouseenter' && !event.target.matches(':hover')) return; // Dont register the hover if the urlbar is floating and we are hovering over it this.clearFlashTimeout('has-hover' + target.id); - if (document.documentElement.getAttribute('supress-primary-adjustment') === 'true' || this._hasHoveredUrlbar) { + if ( + document.documentElement.getAttribute('supress-primary-adjustment') === 'true' || + this._hasHoveredUrlbar + ) { return; } window.requestAnimationFrame(() => target.setAttribute('zen-has-hover', 'true')); @@ -457,7 +487,10 @@ var gZenCompactModeManager = { } // If it's a child element but not the target, ignore the event - if (target.contains(event.explicitOriginalTarget) && event.explicitOriginalTarget !== target) { + if ( + target.contains(event.explicitOriginalTarget) && + event.explicitOriginalTarget !== target + ) { return; } @@ -474,9 +507,16 @@ var gZenCompactModeManager = { } if (this.hoverableElements[i].keepHoverDuration) { - this.flashElement(target, this.hoverableElements[i].keepHoverDuration, 'has-hover' + target.id, 'zen-has-hover'); + this.flashElement( + target, + this.hoverableElements[i].keepHoverDuration, + 'has-hover' + target.id, + 'zen-has-hover' + ); } else { - this._removeHoverFrames[target.id] = window.requestAnimationFrame(() => target.removeAttribute('zen-has-hover')); + this._removeHoverFrames[target.id] = window.requestAnimationFrame(() => + target.removeAttribute('zen-has-hover') + ); } }; @@ -499,7 +539,12 @@ var gZenCompactModeManager = { } window.cancelAnimationFrame(this._removeHoverFrames[target.id]); - this.flashElement(target, this.hideAfterHoverDuration, 'has-hover' + target.id, 'zen-has-hover'); + this.flashElement( + target, + this.hideAfterHoverDuration, + 'has-hover' + target.id, + 'zen-has-hover' + ); document.addEventListener( 'mousemove', () => { diff --git a/src/zen/downloads/ZenDownloadAnimation.mjs b/src/zen/downloads/ZenDownloadAnimation.mjs index 2672719a..10f7c205 100644 --- a/src/zen/downloads/ZenDownloadAnimation.mjs +++ b/src/zen/downloads/ZenDownloadAnimation.mjs @@ -36,7 +36,9 @@ onDownloadAdded: this.#handleNewDownload.bind(this), }); } catch (error) { - console.error(`[${ZenDownloadAnimation.name}] Failed to set up download animation listeners: ${error}`); + console.error( + `[${ZenDownloadAnimation.name}] Failed to set up download animation listeners: ${error}` + ); } } @@ -46,7 +48,9 @@ } if (!this.#lastClickPosition) { - console.warn(`[${ZenDownloadAnimation.name}] No recent click position available for animation`); + console.warn( + `[${ZenDownloadAnimation.name}] No recent click position available for animation` + ); return; } @@ -80,7 +84,10 @@ try { const link = document.createElement('link'); link.setAttribute('rel', 'stylesheet'); - link.setAttribute('href', 'chrome://browser/content/zen-styles/zen-download-arc-animation.css'); + link.setAttribute( + 'href', + 'chrome://browser/content/zen-styles/zen-download-arc-animation.css' + ); this.shadowRoot.appendChild(link); } catch (error) { console.error(`[${ZenDownloadAnimationElement.name}] Error loading arc styles: ${error}`); @@ -89,7 +96,9 @@ async initializeAnimation(startPosition) { if (!startPosition) { - console.warn(`[${ZenDownloadAnimationElement.name}] No start position provided, skipping animation`); + console.warn( + `[${ZenDownloadAnimationElement.name}] No start position provided, skipping animation` + ); return; } @@ -102,13 +111,27 @@ // Calculate optimal arc parameters based on available space const distance = this.#calculateDistance(startPosition, endPosition); - const { arcHeight, shouldArcDownward } = this.#calculateOptimalArc(startPosition, endPosition, distance); + const { arcHeight, shouldArcDownward } = this.#calculateOptimalArc( + startPosition, + endPosition, + distance + ); const distanceX = endPosition.clientX - startPosition.clientX; const distanceY = endPosition.clientY - startPosition.clientY; - const arcSequence = this.#createArcAnimationSequence(distanceX, distanceY, arcHeight, shouldArcDownward); + const arcSequence = this.#createArcAnimationSequence( + distanceX, + distanceY, + arcHeight, + shouldArcDownward + ); // Start the download animation - await this.#startDownloadAnimation(areTabsPositionedRight, isDownloadButtonVisible, arcAnimationElement, arcSequence); + await this.#startDownloadAnimation( + areTabsPositionedRight, + isDownloadButtonVisible, + arcAnimationElement, + arcSequence + ); } #areTabsOnRightSide() { @@ -170,7 +193,8 @@ // Calculate available space for the arc const availableTopSpace = Math.min(startPosition.clientY, endPosition.clientY); const viewportHeight = window.innerHeight; - const availableBottomSpace = viewportHeight - Math.max(startPosition.clientY, endPosition.clientY); + const availableBottomSpace = + viewportHeight - Math.max(startPosition.clientY, endPosition.clientY); // Determine if we should arc downward or upward based on available space const shouldArcDownward = availableBottomSpace > availableTopSpace; @@ -194,7 +218,12 @@ return Math.sqrt(distanceX * distanceX + distanceY * distanceY); } - async #startDownloadAnimation(areTabsPositionedRight, isDownloadButtonVisible, arcAnimationElement, sequence) { + async #startDownloadAnimation( + areTabsPositionedRight, + isDownloadButtonVisible, + arcAnimationElement, + sequence + ) { try { if (!isDownloadButtonVisible) { this.#startBoxAnimation(areTabsPositionedRight); @@ -272,7 +301,9 @@ sequence.offset.push(progress); sequence.opacity.push(opacity); - sequence.transform.push(`translate(calc(${x}px - 50%), calc(${y}px - 50%)) rotate(${rotation}deg) scale(${scale})`); + sequence.transform.push( + `translate(calc(${x}px - 50%), calc(${y}px - 50%)) rotate(${rotation}deg) scale(${scale})` + ); } return sequence; @@ -285,7 +316,9 @@ async #startBoxAnimation(areTabsPositionedRight) { // If animation is already in progress, don't start a new one if (this.#isBoxAnimationRunning) { - console.warn(`[${ZenDownloadAnimationElement.name}] Box animation already running, skipping new request.`); + console.warn( + `[${ZenDownloadAnimationElement.name}] Box animation already running, skipping new request.` + ); return; } @@ -300,7 +333,9 @@ const wrapper = document.getElementById('zen-main-app-wrapper'); if (!wrapper) { - console.warn(`[${ZenDownloadAnimationElement.name}] Cannot start box animation, Wrapper element not found`); + console.warn( + `[${ZenDownloadAnimationElement.name}] Cannot start box animation, Wrapper element not found` + ); return; } @@ -357,7 +392,9 @@ this.#getBoxAnimationDurationMs() ); } catch (error) { - console.error(`[${ZenDownloadAnimationElement.name}] Error during box entry animation: ${error}`); + console.error( + `[${ZenDownloadAnimationElement.name}] Error during box entry animation: ${error}` + ); this.#cleanBoxAnimation(); } finally { this.#isBoxAnimationRunning = false; @@ -406,7 +443,9 @@ } ).finished; } catch (error) { - console.warn(`[${ZenDownloadAnimationElement.name}] Error during box exit animation: ${error}`); + console.warn( + `[${ZenDownloadAnimationElement.name}] Error during box exit animation: ${error}` + ); } finally { this.#cleanBoxAnimation(); } @@ -426,7 +465,10 @@ try { this.#boxAnimationElement.remove(); } catch (error) { - console.error(`[${ZenDownloadAnimationElement.name}] Error removing box animation element: ${error}`, error); + console.error( + `[${ZenDownloadAnimationElement.name}] Error removing box animation element: ${error}`, + error + ); } } this.#cleanBoxAnimationState(); @@ -441,7 +483,12 @@ // Is 1 and no 0 because if you pin the download button in the overflow menu // the download button is in the viewport but in the position 0,0 so this // avoid this case - if (rect.bottom < 1 || rect.right < 1 || rect.top > window.innerHeight || rect.left > window.innerWidth) { + if ( + rect.bottom < 1 || + rect.right < 1 || + rect.top > window.innerHeight || + rect.left > window.innerWidth + ) { return false; } diff --git a/src/zen/folders/ZenFolders.mjs b/src/zen/folders/ZenFolders.mjs index a4c49985..65828ad9 100644 --- a/src/zen/folders/ZenFolders.mjs +++ b/src/zen/folders/ZenFolders.mjs @@ -87,7 +87,10 @@ gBrowser.pinTab(otherTab); } this._piningFolder = false; - gBrowser.verticalPinnedTabsContainer.insertBefore(group, gBrowser.verticalPinnedTabsContainer.lastChild); + gBrowser.verticalPinnedTabsContainer.insertBefore( + group, + gBrowser.verticalPinnedTabsContainer.lastChild + ); gBrowser.tabContainer._invalidateCachedTabs(); return true; } diff --git a/src/zen/folders/zen-folders.css b/src/zen/folders/zen-folders.css index d9d8aca8..eae4fd58 100644 --- a/src/zen/folders/zen-folders.css +++ b/src/zen/folders/zen-folders.css @@ -23,7 +23,11 @@ tab-group[split-view-group] { outline-color: var(--tab-selected-outline-color); transition: scale 0.1s ease; align-items: center; - --zen-split-view-active-tab-bg: color-mix(in srgb, var(--zen-toolbar-element-bg), transparent 40%); + --zen-split-view-active-tab-bg: color-mix( + in srgb, + var(--zen-toolbar-element-bg), + transparent 40% + ); :root:not([zen-sidebar-expanded='true']) & { padding: 0 2px; diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index 66e54615..2960ef29 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -19,8 +19,12 @@ false ); - ChromeUtils.defineLazyGetter(this, 'sidebarButtons', () => document.getElementById('zen-glance-sidebar-container')); - document.getElementById('tabbrowser-tabpanels').addEventListener('click', this.onOverlayClick.bind(this)); + ChromeUtils.defineLazyGetter(this, 'sidebarButtons', () => + document.getElementById('zen-glance-sidebar-container') + ); + document + .getElementById('tabbrowser-tabpanels') + .addEventListener('click', this.onOverlayClick.bind(this)); Services.obs.addObserver(this, 'quit-application-requested'); this.#addSidebarButtonListeners(); @@ -93,7 +97,8 @@ }; currentTab._selected = true; const newUUID = gZenUIManager.generateUuidv4(); - const newTab = existingTab ?? gBrowser.addTrustedTab(Services.io.newURI(url).spec, newTabOptions); + const newTab = + existingTab ?? gBrowser.addTrustedTab(Services.io.newURI(url).spec, newTabOptions); if (currentTab.hasAttribute('zenDefaultUserContextId')) { newTab.setAttribute('zenDefaultUserContextId', true); } @@ -266,7 +271,9 @@ this.browserWrapper.removeAttribute('has-finished-animation'); if (noAnimation) { - this._clearContainerStyles(this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer')); + this._clearContainerStyles( + this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer') + ); this.quickCloseGlance({ closeCurrentTab: false }); return; } @@ -308,7 +315,9 @@ } ) .then(() => { - this._clearContainerStyles(this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer')); + this._clearContainerStyles( + this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer') + ); }); this.browserWrapper.style.opacity = 1; gZenUIManager.motion @@ -336,7 +345,9 @@ this.lastCurrentTab = this.#currentTab; this.overlay.classList.remove('zen-glance-overlay'); - gBrowser._getSwitcher().setTabStateNoAction(this.lastCurrentTab, gBrowser.AsyncTabSwitcher.STATE_UNLOADED); + gBrowser + ._getSwitcher() + .setTabStateNoAction(this.lastCurrentTab, gBrowser.AsyncTabSwitcher.STATE_UNLOADED); if (!onTabClose) { this.#currentParentTab._visuallySelected = false; @@ -383,7 +394,9 @@ this.showSidebarButtons(); } - const parentBrowserContainer = this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer'); + const parentBrowserContainer = this.#currentParentTab.linkedBrowser.closest( + '.browserSidebarContainer' + ); parentBrowserContainer.classList.add('zen-glance-background'); parentBrowserContainer.classList.remove('zen-glance-overlay'); parentBrowserContainer.classList.add('deck-selected'); @@ -401,16 +414,25 @@ this._duringOpening = false; } - quickCloseGlance({ closeCurrentTab = true, closeParentTab = true, justAnimateParent = false, clearID = true } = {}) { + quickCloseGlance({ + closeCurrentTab = true, + closeParentTab = true, + justAnimateParent = false, + clearID = true, + } = {}) { const parentHasBrowser = !!this.#currentParentTab.linkedBrowser; this.hideSidebarButtons(); if (parentHasBrowser) { - this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('zen-glance-background'); + this.#currentParentTab.linkedBrowser + .closest('.browserSidebarContainer') + .classList.remove('zen-glance-background'); } if (!justAnimateParent && this.overlay) { if (parentHasBrowser) { if (closeParentTab) { - this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('deck-selected'); + this.#currentParentTab.linkedBrowser + .closest('.browserSidebarContainer') + .classList.remove('deck-selected'); } this.#currentParentTab.linkedBrowser.zenModeActive = false; } @@ -471,7 +493,9 @@ setTimeout(() => { gBrowser.selectedTab = curTab; if (prevTab?.linkedBrowser) { - prevTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('deck-selected'); + prevTab.linkedBrowser + .closest('.browserSidebarContainer') + .classList.remove('deck-selected'); } }, 0); } else if (gBrowser.selectedTab === this.#currentTab) { @@ -495,7 +519,11 @@ this._ignoreClose = false; return false; } - this.closeGlance({ onTabClose: true, setNewID: isDifferent ? oldGlanceID : null, isDifferent }); + this.closeGlance({ + onTabClose: true, + setNewID: isDifferent ? oldGlanceID : null, + isDifferent, + }); // only keep continueing tab close if we are not on the currently selected tab return !isDifferent; } @@ -513,7 +541,11 @@ } // https://github.com/zen-browser/desktop/issues/7173: Only glance up links that are http(s) or file const url2Spec = url2.spec; - if (!url2Spec.startsWith('http') && !url2Spec.startsWith('https') && !url2Spec.startsWith('file')) { + if ( + !url2Spec.startsWith('http') && + !url2Spec.startsWith('https') && + !url2Spec.startsWith('file') + ) { return false; } return Services.io.newURI(url1).host !== url2.host; @@ -543,7 +575,13 @@ if (this.shouldOpenTabInGlance(tab, uri)) { const browserRect = gBrowser.tabbox.getBoundingClientRect(); this.openGlance( - { url: undefined, x: browserRect.width / 2, y: browserRect.height / 2, width: 0, height: 0 }, + { + url: undefined, + x: browserRect.width / 2, + y: browserRect.height / 2, + width: 0, + height: 0, + }, tab, tab.owner ); @@ -578,7 +616,9 @@ this.#currentTab.removeAttribute('glance-id'); this.#currentParentTab.removeAttribute('glance-id'); gBrowser.selectedTab = this.#currentTab; - this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer').classList.remove('zen-glance-background'); + this.#currentParentTab.linkedBrowser + .closest('.browserSidebarContainer') + .classList.remove('zen-glance-background'); this.#currentParentTab._visuallySelected = false; this.hideSidebarButtons(); if (gReduceMotion || forSplit) { diff --git a/src/zen/glance/actors/ZenGlanceChild.sys.mjs b/src/zen/glance/actors/ZenGlanceChild.sys.mjs index b562de94..598190f0 100644 --- a/src/zen/glance/actors/ZenGlanceChild.sys.mjs +++ b/src/zen/glance/actors/ZenGlanceChild.sys.mjs @@ -46,7 +46,11 @@ export class ZenGlanceChild extends JSWindowActorChild { this.contentWindow.addEventListener('mouseup', this.mouseUpListener); this.contentWindow.document.removeEventListener('click', this.clickListener); - } else if (activationMethod === 'ctrl' || activationMethod === 'alt' || activationMethod === 'shift') { + } else if ( + activationMethod === 'ctrl' || + activationMethod === 'alt' || + activationMethod === 'shift' + ) { this.contentWindow.document.addEventListener('click', this.clickListener, { capture: true }); this.contentWindow.removeEventListener('mousedown', this.mouseDownListener); diff --git a/src/zen/kbs/ZenKeyboardShortcuts.mjs b/src/zen/kbs/ZenKeyboardShortcuts.mjs index e861e4a1..9feec1f7 100644 --- a/src/zen/kbs/ZenKeyboardShortcuts.mjs +++ b/src/zen/kbs/ZenKeyboardShortcuts.mjs @@ -222,9 +222,11 @@ class KeyShortcutModifiers { this.#shift == other.#shift && this.#control == other.#control && (AppConstants.platform == 'macosx' - ? (this.#meta || this.#accel) == (other.#meta || other.#accel) && this.#control == other.#control + ? (this.#meta || this.#accel) == (other.#meta || other.#accel) && + this.#control == other.#control : // In other platforms, we can have control and accel counting as the same thing - this.#meta == other.#meta && (this.#control || this.#accel) == (other.#control || other.#accel)) + this.#meta == other.#meta && + (this.#control || this.#accel) == (other.#control || other.#accel)) ); } @@ -295,7 +297,18 @@ class KeyShortcut { #reserved = false; #internal = false; - constructor(id, key, keycode, group, modifiers, action, l10nId, disabled = false, reserved = false, internal = false) { + constructor( + id, + key, + keycode, + group, + modifiers, + action, + l10nId, + disabled = false, + reserved = false, + internal = false + ) { this.#id = id; this.#key = key?.toLowerCase(); this.#keycode = keycode; @@ -359,7 +372,10 @@ class KeyShortcut { key.getAttribute('key'), key.getAttribute('keycode'), group ?? - KeyShortcut.getGroupFromL10nId(KeyShortcut.sanitizeL10nId(key.getAttribute('data-l10n-id')), key.getAttribute('id')), + KeyShortcut.getGroupFromL10nId( + KeyShortcut.sanitizeL10nId(key.getAttribute('data-l10n-id')), + key.getAttribute('id') + ), KeyShortcutModifiers.parseFromXHTMLAttribute(key.getAttribute('modifiers')), key.getAttribute('command'), key.getAttribute('data-l10n-id'), @@ -986,7 +1002,10 @@ var gZenKeyboardShortcutsManager = { // handled wont wait for the async function to finish. void this.getZenKeyset(); - this._hasCleared = Services.prefs.getBoolPref('zen.keyboard.shortcuts.disable-mainkeyset-clear', false); + this._hasCleared = Services.prefs.getBoolPref( + 'zen.keyboard.shortcuts.disable-mainkeyset-clear', + false + ); window.addEventListener('zen-devtools-keyset-added', this._hasAddedDevtoolShortcuts.bind(this)); this.init(); @@ -1225,7 +1244,10 @@ var gZenKeyboardShortcutsManager = { continue; } - if (targetShortcut.getModifiers().equals(modifiers) && targetShortcut.getKeyNameOrCode()?.toLowerCase() == realShortcut) { + if ( + targetShortcut.getModifiers().equals(modifiers) && + targetShortcut.getKeyNameOrCode()?.toLowerCase() == realShortcut + ) { return true; } } diff --git a/src/zen/media/ZenMediaController.mjs b/src/zen/media/ZenMediaController.mjs index 77f40f30..c70fbb74 100644 --- a/src/zen/media/ZenMediaController.mjs +++ b/src/zen/media/ZenMediaController.mjs @@ -152,11 +152,21 @@ } if (linkedBrowser?.browsingContext?.mediaController) { - this.deinitMediaController(linkedBrowser.browsingContext.mediaController, true, isCurrentBrowser, true); + this.deinitMediaController( + linkedBrowser.browsingContext.mediaController, + true, + isCurrentBrowser, + true + ); } } - async deinitMediaController(mediaController, shouldForget = true, shouldOverride = true, shouldHide = true) { + async deinitMediaController( + mediaController, + shouldForget = true, + shouldOverride = true, + shouldHide = true + ) { if (shouldForget && mediaController) { mediaController.removeEventListener('pictureinpicturemodechange', this.onPipModeChange); mediaController.removeEventListener('positionstatechange', this.onPositionstateChange); @@ -230,7 +240,8 @@ if (!this.isSharing) { if (!this._currentMediaController) return; - if (this._currentMediaController.isBeingUsedInPIPModeOrFullscreen) return this.hideMediaControls(); + if (this._currentMediaController.isBeingUsedInPIPModeOrFullscreen) + return this.hideMediaControls(); this.updatePipButton(); } @@ -280,11 +291,15 @@ setupMediaControlUI(metadata, positionState) { this.updatePipButton(); - if (!this.mediaControlBar.classList.contains('playing') && this._currentMediaController.isPlaying) { + if ( + !this.mediaControlBar.classList.contains('playing') && + this._currentMediaController.isPlaying + ) { this.mediaControlBar.classList.add('playing'); } - const iconURL = this._currentBrowser.mIconURL || `page-icon:${this._currentBrowser.currentURI.spec}`; + const iconURL = + this._currentBrowser.mIconURL || `page-icon:${this._currentBrowser.currentURI.spec}`; this.mediaFocusButton.style.listStyleImage = `url(${iconURL})`; this.mediaTitle.textContent = metadata.title || ''; @@ -309,7 +324,8 @@ this.updateMuteState(); this.switchController(); - if (!mediaController.isActive || this._currentBrowser?.browserId === browser.browserId) return; + if (!mediaController.isActive || this._currentBrowser?.browserId === browser.browserId) + return; const metadata = mediaController.getMetadata(); const positionState = mediaController.getPositionState(); @@ -385,7 +401,12 @@ } _onDeactivated(event) { - this.deinitMediaController(event.target, true, event.target.id === this._currentMediaController.id, true); + this.deinitMediaController( + event.target, + true, + event.target.id === this._currentMediaController.id, + true + ); this.switchController(); } @@ -455,7 +476,8 @@ const elapsedTime = Math.floor((Date.now() - nextController.lastUpdated) / 1000); this.setupMediaControlUI(nextController.controller.getMetadata(), { - position: nextController.position + (nextController.controller.isPlaying ? elapsedTime : 0), + position: + nextController.position + (nextController.controller.isPlaying ? elapsedTime : 0), duration: nextController.duration, playbackRate: nextController.playbackRate, }); @@ -475,7 +497,8 @@ this._mediaUpdateInterval = null; } - if (this._currentDuration >= 900_000) return this.mediaControlBar.setAttribute('media-position-hidden', 'true'); + if (this._currentDuration >= 900_000) + return this.mediaControlBar.setAttribute('media-position-hidden', 'true'); else this.mediaControlBar.removeAttribute('media-position-hidden'); if (!this._currentDuration) return; @@ -619,18 +642,26 @@ onMicrophoneMuteToggle() { if (this._currentBrowser) { - const shouldMute = this.mediaControlBar.hasAttribute('mic-muted') ? 'webrtc:UnmuteMicrophone' : 'webrtc:MuteMicrophone'; + const shouldMute = this.mediaControlBar.hasAttribute('mic-muted') + ? 'webrtc:UnmuteMicrophone' + : 'webrtc:MuteMicrophone'; - this._currentBrowser.browsingContext.currentWindowGlobal.getActor('WebRTC').sendAsyncMessage(shouldMute); + this._currentBrowser.browsingContext.currentWindowGlobal + .getActor('WebRTC') + .sendAsyncMessage(shouldMute); this.mediaControlBar.toggleAttribute('mic-muted'); } } onCameraMuteToggle() { if (this._currentBrowser) { - const shouldMute = this.mediaControlBar.hasAttribute('camera-muted') ? 'webrtc:UnmuteCamera' : 'webrtc:MuteCamera'; + const shouldMute = this.mediaControlBar.hasAttribute('camera-muted') + ? 'webrtc:UnmuteCamera' + : 'webrtc:MuteCamera'; - this._currentBrowser.browsingContext.currentWindowGlobal.getActor('WebRTC').sendAsyncMessage(shouldMute); + this._currentBrowser.browsingContext.currentWindowGlobal + .getActor('WebRTC') + .sendAsyncMessage(shouldMute); this.mediaControlBar.toggleAttribute('camera-muted'); } } @@ -644,7 +675,9 @@ if (!this._currentBrowser) return; if (this.isSharing) return; - const { totalPipCount, totalPipDisabled } = PictureInPicture.getEligiblePipVideoCount(this._currentBrowser); + const { totalPipCount, totalPipDisabled } = PictureInPicture.getEligiblePipVideoCount( + this._currentBrowser + ); const canPip = totalPipCount === 1 || (totalPipDisabled > 0 && lazy.RESPECT_PIP_DISABLED); this.mediaControlBar.toggleAttribute('can-pip', canPip); diff --git a/src/zen/mods/ZenThemesCommon.mjs b/src/zen/mods/ZenThemesCommon.mjs index b2ed58f1..f8bda8cf 100644 --- a/src/zen/mods/ZenThemesCommon.mjs +++ b/src/zen/mods/ZenThemesCommon.mjs @@ -3,7 +3,18 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. var ZenThemesCommon = { - kZenColors: ['#aac7ff', '#74d7cb', '#a0d490', '#dec663', '#ffb787', '#dec1b1', '#ffb1c0', '#ddbfc3', '#f6b0ea', '#d4bbff'], + kZenColors: [ + '#aac7ff', + '#74d7cb', + '#a0d490', + '#dec663', + '#ffb787', + '#dec1b1', + '#ffb1c0', + '#ddbfc3', + '#f6b0ea', + '#d4bbff', + ], get browsers() { return Services.wm.getEnumerator('navigator:browser'); @@ -72,7 +83,8 @@ var ZenThemesCommon = { const newThemePreferences = []; for (let [entry, label] of Object.entries(preferences)) { - const [_, negation = '', os = '', property] = /(!?)(?:(macos|windows|linux):)?([A-z0-9-_.]+)/g.exec(entry); + const [_, negation = '', os = '', property] = + /(!?)(?:(macos|windows|linux):)?([A-z0-9-_.]+)/g.exec(entry); const isNegation = negation === '!'; if ( @@ -94,7 +106,8 @@ var ZenThemesCommon = { } return preferences.filter( - ({ disabledOn = [] }) => !disabledOn.includes(gZenOperatingSystemCommonUtils.currentOperatingSystem) + ({ disabledOn = [] }) => + !disabledOn.includes(gZenOperatingSystemCommonUtils.currentOperatingSystem) ); }, diff --git a/src/zen/mods/ZenThemesImporter.mjs b/src/zen/mods/ZenThemesImporter.mjs index 81462116..1303db5f 100644 --- a/src/zen/mods/ZenThemesImporter.mjs +++ b/src/zen/mods/ZenThemesImporter.mjs @@ -55,7 +55,10 @@ var gZenThemesImporter = new (class { constructor() { try { window.SessionStore.promiseInitialized.then(async () => { - if (Services.prefs.getBoolPref('zen.themes.disable-all', false) || Services.appinfo.inSafeMode) { + if ( + Services.prefs.getBoolPref('zen.themes.disable-all', false) || + Services.appinfo.inSafeMode + ) { console.log('[ZenThemesImporter]: Disabling all themes.'); return; } @@ -83,13 +86,23 @@ var gZenThemesImporter = new (class { console.error('[ZenThemesImporter]: Error importing Zen Themes: ', e); } - Services.prefs.addObserver('zen.themes.updated-value-observer', this.rebuildThemeStylesheet.bind(this), false); - Services.prefs.addObserver('zen.themes.disable-all', this.handleDisableThemes.bind(this), false); + Services.prefs.addObserver( + 'zen.themes.updated-value-observer', + this.rebuildThemeStylesheet.bind(this), + false + ); + Services.prefs.addObserver( + 'zen.themes.disable-all', + this.handleDisableThemes.bind(this), + false + ); } get sss() { if (!this._sss) { - this._sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService); + this._sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService( + Ci.nsIStyleSheetService + ); } return this._sss; } @@ -118,7 +131,9 @@ var gZenThemesImporter = new (class { } getStylesheetURIForTheme(theme) { - return Services.io.newFileURI(new FileUtils.File(PathUtils.join(ZenThemesCommon.getThemeFolder(theme.id), 'chrome.css'))); + return Services.io.newFileURI( + new FileUtils.File(PathUtils.join(ZenThemesCommon.getThemeFolder(theme.id), 'chrome.css')) + ); } async insertStylesheet() { @@ -135,7 +150,10 @@ var gZenThemesImporter = new (class { await this.sss.unregisterSheet(this.styleSheetURI, this.sss.AGENT_SHEET); await IOUtils.remove(this.styleSheetPath, { ignoreAbsent: true }); - if (!this.sss.sheetRegistered(this.styleSheetURI, this.sss.AGENT_SHEET) && !(await IOUtils.exists(this.styleSheetPath))) { + if ( + !this.sss.sheetRegistered(this.styleSheetURI, this.sss.AGENT_SHEET) && + !(await IOUtils.exists(this.styleSheetPath)) + ) { console.debug('[ZenThemesImporter]: Sheet successfully unregistered'); } } @@ -169,7 +187,9 @@ var gZenThemesImporter = new (class { async getEnabledThemes() { const themeObject = await ZenThemesCommon.getThemes(); - const themes = Object.values(themeObject).filter((theme) => theme.enabled === undefined || theme.enabled); + const themes = Object.values(themeObject).filter( + (theme) => theme.enabled === undefined || theme.enabled + ); const themeList = themes.map(({ name }) => name).join(', '); @@ -198,7 +218,9 @@ var gZenThemesImporter = new (class { case 'checkbox': { const value = Services.prefs.getBoolPref(property, false); if (typeof defaultValue !== 'boolean') { - console.log(`[ZenThemesImporter]: Warning, invalid data type received for expected type boolean, skipping.`); + console.log( + `[ZenThemesImporter]: Warning, invalid data type received for expected type boolean, skipping.` + ); continue; } @@ -212,7 +234,9 @@ var gZenThemesImporter = new (class { const value = Services.prefs.getStringPref(property, 'zen-property-no-saved'); if (typeof defaultValue !== 'string' && typeof defaultValue !== 'number') { - console.log(`[ZenThemesImporter]: Warning, invalid data type received (${typeof defaultValue}), skipping.`); + console.log( + `[ZenThemesImporter]: Warning, invalid data type received (${typeof defaultValue}), skipping.` + ); continue; } @@ -271,9 +295,13 @@ var gZenThemesImporter = new (class { case 'string': { if (value === '') { - browser.document.querySelector(':root').style.removeProperty(`--${sanitizedProperty}`); + browser.document + .querySelector(':root') + .style.removeProperty(`--${sanitizedProperty}`); } else { - browser.document.querySelector(':root').style.setProperty(`--${sanitizedProperty}`, value); + browser.document + .querySelector(':root') + .style.setProperty(`--${sanitizedProperty}`, value); } break; } @@ -309,5 +337,8 @@ gZenActorsManager.addJSWindowActor('ZenThemeMarketplace', { DOMContentLoaded: {}, }, }, - matches: [...Services.prefs.getStringPref('zen.injections.match-urls').split(','), 'about:preferences'], + matches: [ + ...Services.prefs.getStringPref('zen.injections.match-urls').split(','), + 'about:preferences', + ], }); diff --git a/src/zen/mods/actors/ZenThemeMarketplaceChild.sys.mjs b/src/zen/mods/actors/ZenThemeMarketplaceChild.sys.mjs index f132cf6c..a63bbc2c 100644 --- a/src/zen/mods/actors/ZenThemeMarketplaceChild.sys.mjs +++ b/src/zen/mods/actors/ZenThemeMarketplaceChild.sys.mjs @@ -31,7 +31,10 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild { } this.initiateThemeMarketplace(); - this.contentWindow.document.addEventListener('ZenCheckForThemeUpdates', this.checkForThemeUpdates.bind(this)); + this.contentWindow.document.addEventListener( + 'ZenCheckForThemeUpdates', + this.checkForThemeUpdates.bind(this) + ); } collectRiceMetadata() { diff --git a/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs b/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs index d1f4e8a7..3745d655 100644 --- a/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs +++ b/src/zen/mods/actors/ZenThemeMarketplaceParent.sys.mjs @@ -79,14 +79,24 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent { for (const theme of Object.values(await this.getThemes())) { try { - const themeInfo = await this.sendQuery('ZenThemeMarketplace:GetThemeInfo', { themeId: theme.id }); + const themeInfo = await this.sendQuery('ZenThemeMarketplace:GetThemeInfo', { + themeId: theme.id, + }); if (!themeInfo) { continue; } - if (!this.compareVersions(themeInfo.version, theme.version || '0.0.0') && themeInfo.version != theme.version) { - console.info('ZenThemeMarketplaceParent: Theme update found', theme.id, theme.version, themeInfo.version); + if ( + !this.compareVersions(themeInfo.version, theme.version || '0.0.0') && + themeInfo.version != theme.version + ) { + console.info( + 'ZenThemeMarketplaceParent: Theme update found', + theme.id, + theme.version, + themeInfo.version + ); themeInfo.enabled = theme.enabled; updates.push(themeInfo); @@ -156,7 +166,10 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent { await this.downloadUrlToFile(theme.style, PathUtils.join(themePath, 'chrome.css'), true); await this.downloadUrlToFile(theme.readme, PathUtils.join(themePath, 'readme.md')); if (theme.preferences) { - await this.downloadUrlToFile(theme.preferences, PathUtils.join(themePath, 'preferences.json')); + await this.downloadUrlToFile( + theme.preferences, + PathUtils.join(themePath, 'preferences.json') + ); } } diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index cba0d4ad..16fb6996 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -82,21 +82,39 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { init() { this.handleTabEvent = this._handleTabEvent.bind(this); - XPCOMUtils.defineLazyPreferenceGetter(this, 'minResizeWidth', 'zen.splitView.min-resize-width', 7); - XPCOMUtils.defineLazyPreferenceGetter(this, '_edgeHoverSize', 'zen.splitView.rearrange-edge-hover-size', 24); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'minResizeWidth', + 'zen.splitView.min-resize-width', + 7 + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + '_edgeHoverSize', + 'zen.splitView.rearrange-edge-hover-size', + 24 + ); - ChromeUtils.defineLazyGetter(this, 'overlay', () => document.getElementById('zen-splitview-overlay')); + ChromeUtils.defineLazyGetter(this, 'overlay', () => + document.getElementById('zen-splitview-overlay') + ); - ChromeUtils.defineLazyGetter(this, 'dropZone', () => document.getElementById('zen-splitview-dropzone')); + ChromeUtils.defineLazyGetter(this, 'dropZone', () => + document.getElementById('zen-splitview-dropzone') + ); window.addEventListener('TabClose', this.handleTabClose.bind(this)); window.addEventListener('TabSelect', this.onTabSelect.bind(this)); this.initializeContextMenu(); this.insertIntoContextMenu(); - window.addEventListener('AfterWorkspacesSessionRestore', this.onAfterWorkspaceSessionRestore.bind(this), { - once: true, - }); + window.addEventListener( + 'AfterWorkspacesSessionRestore', + this.onAfterWorkspaceSessionRestore.bind(this), + { + once: true, + } + ); // Add drag over listener to the browser view if (Services.prefs.getBoolPref('zen.splitView.enable-tab-drop')) { @@ -200,7 +218,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { this.fakeBrowser || !this._lastOpenedTab || (this._lastOpenedTab && - this._lastOpenedTab.getAttribute('zen-workspace-id') !== draggedTab.getAttribute('zen-workspace-id') && + this._lastOpenedTab.getAttribute('zen-workspace-id') !== + draggedTab.getAttribute('zen-workspace-id') && !this._lastOpenedTab.hasAttribute('zen-essential')) || draggedTab === this._lastOpenedTab ) { @@ -224,7 +243,12 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { return; } // first quarter or last quarter of the screen, but not the middle - if (!(event.clientX < panelsRect.left + panelsWidth / 4 || event.clientX > panelsRect.left + (panelsWidth / 4) * 3)) { + if ( + !( + event.clientX < panelsRect.left + panelsWidth / 4 || + event.clientX > panelsRect.left + (panelsWidth / 4) * 3 + ) + ) { return; } dt.mozCursor = 'default'; @@ -244,7 +268,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { // Add a min width to all the browser elements to prevent them from resizing const panelsWidth = gBrowser.tabbox.getBoundingClientRect().width; const halfWidth = panelsWidth / 2; - let threshold = gNavToolbox.getBoundingClientRect().width * (gZenVerticalTabsManager._prefsRightSide ? 0 : 1); + let threshold = + gNavToolbox.getBoundingClientRect().width * + (gZenVerticalTabsManager._prefsRightSide ? 0 : 1); if (gZenCompactModeManager.preference) { threshold = 0; } @@ -267,7 +293,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { this.fakeBrowser.setAttribute('has-split-view', 'true'); } gBrowser.tabbox.appendChild(this.fakeBrowser); - this.fakeBrowser.style.setProperty('--zen-split-view-fake-icon', `url(${draggedTab.getAttribute('image')})`); + this.fakeBrowser.style.setProperty( + '--zen-split-view-fake-icon', + `url(${draggedTab.getAttribute('image')})` + ); draggedTab._visuallySelected = true; this.fakeBrowser.setAttribute('side', side); this._finishAllAnimatingPromise = Promise.all([ @@ -497,12 +526,18 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { if (!this.rearrangeViewEnabled) return; if (event) { // Click or "ESC" key - if ((event.type === 'click' && event.button !== 0) || (event.type === 'keydown' && event.key !== 'Escape')) { + if ( + (event.type === 'click' && event.button !== 0) || + (event.type === 'keydown' && event.key !== 'Escape') + ) { return; } } - if (!this.rearrangeViewEnabled || (event && event.target.classList.contains('zen-split-view-splitter'))) { + if ( + !this.rearrangeViewEnabled || + (event && event.target.classList.contains('zen-split-view-splitter')) + ) { return; } @@ -650,7 +685,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { if (hoverSide !== 'center') { const isVertical = hoverSide === 'top' || hoverSide === 'bottom'; - const browserSize = 100 - (isVertical ? posToRoot.top + posToRoot.bottom : posToRoot.right + posToRoot.left); + const browserSize = + 100 - (isVertical ? posToRoot.top + posToRoot.bottom : posToRoot.right + posToRoot.left); const reduce = browserSize * 0.5; posToRoot[this._oppositeSide(hoverSide)] += reduce; @@ -712,7 +748,11 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { const droppedOnTab = gBrowser.getTabForBrowser(event.target.querySelector('browser')); if (droppedTab === droppedOnTab) return; - const hoverSide = this.calculateHoverSide(event.clientX, event.clientY, browserDroppedOn.getBoundingClientRect()); + const hoverSide = this.calculateHoverSide( + event.clientX, + event.clientY, + browserDroppedOn.getBoundingClientRect() + ); const droppedSplitNode = this.getSplitNodeFromTab(droppedTab); const droppedOnSplitNode = this.getSplitNodeFromTab(droppedOnTab); if (hoverSide === 'center') { @@ -902,7 +942,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { * @returns {boolean} True if the tabs can be split, false otherwise. */ contextCanSplitTabs() { - if (window.gBrowser.selectedTabs.length < 2 || window.gBrowser.selectedTabs.length > this.MAX_TABS) { + if ( + window.gBrowser.selectedTabs.length < 2 || + window.gBrowser.selectedTabs.length > this.MAX_TABS + ) { return false; } for (const tab of window.gBrowser.selectedTabs) { @@ -979,7 +1022,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { if (gridTypeChange || !newTabsAdded) { // reset layout group.gridType = gridType; - group.layoutTree = this.calculateLayoutTree([...new Set(group.tabs.concat(tabs))], gridType); + group.layoutTree = this.calculateLayoutTree( + [...new Set(group.tabs.concat(tabs))], + gridType + ); } else { // Add any tabs that are not already in the group for (let i = 0; i < tabs.length; i++) { @@ -1266,7 +1312,13 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { let currentSplitters = this._splitNodeToSplitters.get(parentNode) || []; if (!splittersNeeded || currentSplitters.length === splittersNeeded) return currentSplitters; for (let i = currentSplitters?.length || 0; i < splittersNeeded; i++) { - currentSplitters.push(this.createSplitter(parentNode.direction === 'column' ? 'horizontal' : 'vertical', parentNode, i)); + currentSplitters.push( + this.createSplitter( + parentNode.direction === 'column' ? 'horizontal' : 'vertical', + parentNode, + i + ) + ); currentSplitters[i].parentSplitNode = parentNode; } if (currentSplitters.length > splittersNeeded) { @@ -1278,7 +1330,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { } removeSplitters() { - [...this.overlay.children].filter((c) => c.classList.contains('zen-split-view-splitter')).forEach((s) => s.remove()); + [...this.overlay.children] + .filter((c) => c.classList.contains('zen-split-view-splitter')) + .forEach((s) => s.remove()); this._splitNodeToSplitters.clear(); } @@ -1309,7 +1363,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { return; } const container = event.currentTarget.closest('.browserSidebarContainer'); - const tab = window.gBrowser.tabs.find((t) => t.linkedBrowser.closest('.browserSidebarContainer') === container); + const tab = window.gBrowser.tabs.find( + (t) => t.linkedBrowser.closest('.browserSidebarContainer') === container + ); if (tab) { window.gBrowser.selectedTab = tab; } @@ -1325,8 +1381,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { const startPosition = event[clientAxis]; const splitNode = event.target.parentSplitNode; let rootToNodeSize; - if (isVertical) rootToNodeSize = 100 / (100 - splitNode.positionToRoot.right - splitNode.positionToRoot.left); - else rootToNodeSize = 100 / (100 - splitNode.positionToRoot.bottom - splitNode.positionToRoot.top); + if (isVertical) + rootToNodeSize = 100 / (100 - splitNode.positionToRoot.right - splitNode.positionToRoot.left); + else + rootToNodeSize = 100 / (100 - splitNode.positionToRoot.bottom - splitNode.positionToRoot.top); const originalSizes = splitNode.children.map((c) => c.sizeInParent); const dragFunc = (dEvent) => { @@ -1334,7 +1392,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { originalSizes.forEach((s, i) => (splitNode.children[i].sizeInParent = s)); // reset changes const movement = dEvent[clientAxis] - startPosition; - let movementPercent = (movement / this.tabBrowserPanel.getBoundingClientRect()[dimension]) * rootToNodeSize * 100; + let movementPercent = + (movement / this.tabBrowserPanel.getBoundingClientRect()[dimension]) * + rootToNodeSize * + 100; let reducingMovement = Math.max(movementPercent, -movementPercent); for ( @@ -1351,7 +1412,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { } const increasingMovement = Math.max(movementPercent, -movementPercent) - reducingMovement; const increaseIndex = gridIdx + (movementPercent < 0 ? 1 : 0); - splitNode.children[increaseIndex].sizeInParent = originalSizes[increaseIndex] + increasingMovement; + splitNode.children[increaseIndex].sizeInParent = + originalSizes[increaseIndex] + increasingMovement; this.applyGridLayout(splitNode); }); }; @@ -1562,7 +1624,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { const containerRect = this.fakeBrowser.getBoundingClientRect(); const padding = ZenThemeModifier.elementSeparation; const dropTarget = document.elementFromPoint( - dropSide === 'left' ? containerRect.left + containerRect.width + padding + 5 : containerRect.left - padding - 5, + dropSide === 'left' + ? containerRect.left + containerRect.width + padding + 5 + : containerRect.left - padding - 5, event.clientY ); const browser = dropTarget?.closest('browser'); @@ -1609,9 +1673,18 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { if (hoverSide !== 'center') { const splitDirection = hoverSide === 'left' || hoverSide === 'right' ? 'row' : 'column'; if (parentNode.direction !== splitDirection) { - this.splitIntoNode(droppedOnSplitNode, new SplitLeafNode(draggedTab, 50), hoverSide, 0.5); + this.splitIntoNode( + droppedOnSplitNode, + new SplitLeafNode(draggedTab, 50), + hoverSide, + 0.5 + ); } else { - this.addTabToSplit(draggedTab, parentNode, /* prepend = */ hoverSide === 'left' || hoverSide === 'top'); + this.addTabToSplit( + draggedTab, + parentNode, + /* prepend = */ hoverSide === 'left' || hoverSide === 'top' + ); } } else { this.addTabToSplit(draggedTab, group.layoutTree); @@ -1636,7 +1709,11 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { //} // Put tabs always as if it was dropped from the left - this.splitTabs(dropSide == 'left' ? [draggedTab, droppedOnTab] : [droppedOnTab, draggedTab], gridType, 1); + this.splitTabs( + dropSide == 'left' ? [draggedTab, droppedOnTab] : [droppedOnTab, draggedTab], + gridType, + 1 + ); } } if (this._finishAllAnimatingPromise) { @@ -1711,7 +1788,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { // Try to find an existing split view group let splitGroup = gBrowser.tabGroups.find( - (group) => group.getAttribute('split-view-group') && group.tabs.some((tab) => tabs.includes(tab) && tab.splitView) + (group) => + group.getAttribute('split-view-group') && + group.tabs.some((tab) => tabs.includes(tab) && tab.splitView) ); if (splitGroup) { @@ -1762,7 +1841,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { } onAfterWorkspaceSessionRestore() { - if (gBrowser.selectedTab.group?.hasAttribute('split-view-group') && !gBrowser.selectedTab.pinned) { + if ( + gBrowser.selectedTab.group?.hasAttribute('split-view-group') && + !gBrowser.selectedTab.pinned + ) { // Activate all browsers in the split view this.currentView = -1; this.onLocationChange(gBrowser.selectedTab.linkedBrowser); diff --git a/src/zen/split-view/zen-decks.css b/src/zen/split-view/zen-decks.css index 997ba5d0..046eb0b1 100644 --- a/src/zen/split-view/zen-decks.css +++ b/src/zen/split-view/zen-decks.css @@ -141,7 +141,9 @@ border-top-right-radius: 0; } -:root:not([inDOMFullscreen='true']) .browserSidebarContainer:hover .zen-view-splitter-header-container, +:root:not([inDOMFullscreen='true']) + .browserSidebarContainer:hover + .zen-view-splitter-header-container, .zen-view-splitter-header-container:hover { pointer-events: all; opacity: 1; diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 731f1cf5..a9032d3a 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -19,7 +19,9 @@ 'zen.pinned-tab-manager.close-shortcut-behavior', 'switch' ); - ChromeUtils.defineESModuleGetters(lazy, { E10SUtils: 'resource://gre/modules/E10SUtils.sys.mjs' }); + ChromeUtils.defineESModuleGetters(lazy, { + E10SUtils: 'resource://gre/modules/E10SUtils.sys.mjs', + }); this.#listenPinnedTabEvents(); } @@ -100,7 +102,9 @@ } catch {} } else { if (tab.hasAttribute('zen-essential')) { - tab.querySelector('.tab-background').style.setProperty('--zen-tab-icon', `url(${iconUrl})`); + tab + .querySelector('.tab-background') + .style.setProperty('--zen-tab-icon', `url(${iconUrl})`); } } // TODO: work on this @@ -354,8 +358,13 @@ tab.position = tab._tPos; for (let otherTab of gBrowser.tabs) { - if (otherTab.pinned && otherTab.getAttribute('zen-pin-id') !== tab.getAttribute('zen-pin-id')) { - const actualPin = this._pinsCache.find((pin) => pin.uuid === otherTab.getAttribute('zen-pin-id')); + if ( + otherTab.pinned && + otherTab.getAttribute('zen-pin-id') !== tab.getAttribute('zen-pin-id') + ) { + const actualPin = this._pinsCache.find( + (pin) => pin.uuid === otherTab.getAttribute('zen-pin-id') + ); if (!actualPin) { continue; } @@ -507,7 +516,11 @@ } } - _onCloseTabShortcut(event, selectedTab = gBrowser.selectedTab, behavior = lazy.zenPinnedTabCloseShortcutBehavior) { + _onCloseTabShortcut( + event, + selectedTab = gBrowser.selectedTab, + behavior = lazy.zenPinnedTabCloseShortcutBehavior + ) { if (!selectedTab?.pinned) { return; } @@ -687,7 +700,11 @@ } removeEssentials(tab, unpin = true) { - const tabs = tab ? [tab] : TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; + const tabs = tab + ? [tab] + : TabContextMenu.contextTab.multiselected + ? gBrowser.selectedTabs + : [TabContextMenu.contextTab]; for (let i = 0; i < tabs.length; i++) { const tab = tabs[i]; tab.removeAttribute('zen-essential'); @@ -742,7 +759,11 @@ // TODO: remove this as it's not possible to know the base pinned url any more as it's now stored in tab state resetPinnedTabData(tabData) { - if (lazy.zenPinnedTabRestorePinnedTabsToPinnedUrl && tabData.pinned && tabData.zenPinnedEntry) { + if ( + lazy.zenPinnedTabRestorePinnedTabsToPinnedUrl && + tabData.pinned && + tabData.zenPinnedEntry + ) { tabData.entries = [JSON.parse(tabData.zenPinnedEntry)]; tabData.image = tabData.zenPinnedIcon; tabData.index = 0; @@ -754,22 +775,27 @@ return; } const isVisible = contextTab.pinned && !contextTab.multiselected; - document.getElementById('context_zen-reset-pinned-tab').hidden = !isVisible || !contextTab.getAttribute('zen-pin-id'); + document.getElementById('context_zen-reset-pinned-tab').hidden = + !isVisible || !contextTab.getAttribute('zen-pin-id'); document.getElementById('context_zen-replace-pinned-url-with-current').hidden = !isVisible; document.getElementById('context_zen-add-essential').hidden = contextTab.getAttribute('zen-essential') || !!contextTab.group; - document.getElementById('context_zen-remove-essential').hidden = !contextTab.getAttribute('zen-essential'); + document.getElementById('context_zen-remove-essential').hidden = + !contextTab.getAttribute('zen-essential'); document.getElementById('context_unpinTab').hidden = - document.getElementById('context_unpinTab').hidden || contextTab.getAttribute('zen-essential'); + document.getElementById('context_unpinTab').hidden || + contextTab.getAttribute('zen-essential'); document.getElementById('context_unpinSelectedTabs').hidden = - document.getElementById('context_unpinSelectedTabs').hidden || contextTab.getAttribute('zen-essential'); + document.getElementById('context_unpinSelectedTabs').hidden || + contextTab.getAttribute('zen-essential'); document.getElementById('context_zen-pinned-tab-separator').hidden = !isVisible; } moveToAnotherTabContainerIfNecessary(event, movingTabs) { try { const pinnedTabsTarget = - event.target.closest('#vertical-pinned-tabs-container') || event.target.closest('.zen-current-workspace-indicator'); + event.target.closest('#vertical-pinned-tabs-container') || + event.target.closest('.zen-current-workspace-indicator'); const essentialTabsTarget = event.target.closest('.zen-essentials-container'); const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox'); // Remove group labels from the moving tabs and replace it @@ -801,7 +827,10 @@ } // Check for essentials container else if (essentialTabsTarget) { - if (!draggedTab.hasAttribute('zen-essential') && !draggedTab?.group?.hasAttribute('split-view-group')) { + if ( + !draggedTab.hasAttribute('zen-essential') && + !draggedTab?.group?.hasAttribute('split-view-group') + ) { this.addToEssentials(draggedTab); moved = true; isVertical = false; @@ -958,7 +987,9 @@ const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox'); let targetTab = event.target.closest('.tabbrowser-tab'); targetTab = targetTab?.group || targetTab; - draggedTab = draggedTab?.group?.hasAttribute('split-view-group') ? draggedTab.group : draggedTab; + draggedTab = draggedTab?.group?.hasAttribute('split-view-group') + ? draggedTab.group + : draggedTab; if (event.target.closest('.zen-current-workspace-indicator')) { this.removeTabContainersDragoverClass(); ZenWorkspaces.activeWorkspaceIndicator?.setAttribute('open', true); diff --git a/src/zen/tabs/ZenPinnedTabsStorage.mjs b/src/zen/tabs/ZenPinnedTabsStorage.mjs index e7732556..1045a072 100644 --- a/src/zen/tabs/ZenPinnedTabsStorage.mjs +++ b/src/zen/tabs/ZenPinnedTabsStorage.mjs @@ -202,7 +202,9 @@ var ZenPinnedTabsStorage = { await PlacesUtils.withConnectionWrapper('ZenPinnedTabsStorage.removePin', async (db) => { await db.executeTransaction(async () => { // Get all child UUIDs first for change tracking - const children = await db.execute(`SELECT uuid FROM zen_pins WHERE parent_uuid = :uuid`, { uuid }); + const children = await db.execute(`SELECT uuid FROM zen_pins WHERE parent_uuid = :uuid`, { + uuid, + }); // Add child UUIDs to changedUUIDs array for (const child of children) { @@ -283,7 +285,9 @@ var ZenPinnedTabsStorage = { shouldReorderPins(before, current, after) { const minGap = 1; // Minimum allowed gap between positions - return (before !== null && current - before < minGap) || (after !== null && after - current < minGap); + return ( + (before !== null && current - before < minGap) || (after !== null && after - current < minGap) + ); }, async reorderAllPins(db, changedUUIDs) { @@ -329,41 +333,44 @@ var ZenPinnedTabsStorage = { async updatePinPositions(pins) { const changedUUIDs = new Set(); - await PlacesUtils.withConnectionWrapper('ZenPinnedTabsStorage.updatePinPositions', async (db) => { - await db.executeTransaction(async () => { - const now = Date.now(); + await PlacesUtils.withConnectionWrapper( + 'ZenPinnedTabsStorage.updatePinPositions', + async (db) => { + await db.executeTransaction(async () => { + const now = Date.now(); - for (let i = 0; i < pins.length; i++) { - const pin = pins[i]; - const newPosition = (i + 1) * 1000; + for (let i = 0; i < pins.length; i++) { + const pin = pins[i]; + const newPosition = (i + 1) * 1000; - await db.execute( - ` + await db.execute( + ` UPDATE zen_pins SET position = :newPosition WHERE uuid = :uuid `, - { newPosition, uuid: pin.uuid } - ); + { newPosition, uuid: pin.uuid } + ); - changedUUIDs.add(pin.uuid); + changedUUIDs.add(pin.uuid); - // Record the change - await db.execute( - ` + // Record the change + await db.execute( + ` INSERT OR REPLACE INTO zen_pins_changes (uuid, timestamp) VALUES (:uuid, :timestamp) `, - { - uuid: pin.uuid, - timestamp: Math.floor(now / 1000), - } - ); - } + { + uuid: pin.uuid, + timestamp: Math.floor(now / 1000), + } + ); + } - await this.updateLastChangeTimestamp(db); - }); - }); + await this.updateLastChangeTimestamp(db); + }); + } + ); this._notifyPinsChanged('zen-pin-updated', Array.from(changedUUIDs)); }, diff --git a/src/zen/tabs/ZenTabUnloader.mjs b/src/zen/tabs/ZenTabUnloader.mjs index 78ca84cd..bf7766b7 100644 --- a/src/zen/tabs/ZenTabUnloader.mjs +++ b/src/zen/tabs/ZenTabUnloader.mjs @@ -1,11 +1,26 @@ { const lazy = {}; - XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderEnabled', 'zen.tab-unloader.enabled', false); + XPCOMUtils.defineLazyPreferenceGetter( + lazy, + 'zenTabUnloaderEnabled', + 'zen.tab-unloader.enabled', + false + ); - XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderTimeout', 'zen.tab-unloader.timeout-minutes', 20); + XPCOMUtils.defineLazyPreferenceGetter( + lazy, + 'zenTabUnloaderTimeout', + 'zen.tab-unloader.timeout-minutes', + 20 + ); - XPCOMUtils.defineLazyPreferenceGetter(lazy, 'zenTabUnloaderExcludedUrls', 'zen.tab-unloader.excluded-urls', ''); + XPCOMUtils.defineLazyPreferenceGetter( + lazy, + 'zenTabUnloaderExcludedUrls', + 'zen.tab-unloader.excluded-urls', + '' + ); const ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS = [ '^about:', @@ -68,7 +83,10 @@ constructor(unloader) { this.unloader = unloader; - this.interval = setInterval(this.intervalListener.bind(this), ZenTabsIntervalUnloader.INTERVAL); + this.interval = setInterval( + this.intervalListener.bind(this), + ZenTabsIntervalUnloader.INTERVAL + ); } intervalListener() { @@ -218,7 +236,10 @@ get excludedUrls() { // Check if excludedrls is the same as the pref value const excludedUrls = this.lazyExcludeUrls; - if (!this.arraysEqual(this.#excludedUrls, excludedUrls) || !this.#compiledExcludedUrls.length) { + if ( + !this.arraysEqual(this.#excludedUrls, excludedUrls) || + !this.#compiledExcludedUrls.length + ) { this.#excludedUrls = excludedUrls; this.#compiledExcludedUrls = excludedUrls.map((url) => new RegExp(url)); } @@ -231,7 +252,9 @@ } unloadTab() { - const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; + const tabs = TabContextMenu.contextTab.multiselected + ? gBrowser.selectedTabs + : [TabContextMenu.contextTab]; this.explicitUnloadTabs(tabs); } @@ -244,7 +267,9 @@ } preventUnloadTab() { - const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; + const tabs = TabContextMenu.contextTab.multiselected + ? gBrowser.selectedTabs + : [TabContextMenu.contextTab]; for (let i = 0; i < tabs.length; i++) { const tab = tabs[i]; tab.zenIgnoreUnload = true; @@ -252,7 +277,9 @@ } ignoreUnloadTab() { - const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; + const tabs = TabContextMenu.contextTab.multiselected + ? gBrowser.selectedTabs + : [TabContextMenu.contextTab]; for (let i = 0; i < tabs.length; i++) { const tab = tabs[i]; tab.zenIgnoreUnload = false; @@ -288,7 +315,9 @@ } const diff = currentTimestamp - lastActivity; // Check if the tab has been inactive for more than the timeout - return diff > lazy.zenTabUnloaderTimeout * 60 * 1000 && this._tabPermitsUnload(tab, extraArgs); + return ( + diff > lazy.zenTabUnloaderTimeout * 60 * 1000 && this._tabPermitsUnload(tab, extraArgs) + ); } _tabPermitsUnload(tab, extraArgs) { diff --git a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css index 4d20fdf5..59443183 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css @@ -14,7 +14,9 @@ z-index: 1; } } - &:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within):not(:has(*:is([panelopen='true'], [open='true']))) { + &:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within):not( + :has(*:is([panelopen='true'], [open='true'])) + ) { transition-delay: 0.2s; /* In order to still use it on fullscreen, even if it's 0px, add .1px (almost invisible) */ height: calc(var(--zen-element-separation) + 0.1px); diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index ca046c3f..225ba6ce 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -103,7 +103,10 @@ --zen-min-toolbox-padding: 0.35rem; } /* Actual padding used, ensuring it's at least min padding or based on element separation */ - --zen-toolbox-padding: max(var(--zen-min-toolbox-padding), calc(var(--zen-element-separation) / 1.5)); + --zen-toolbox-padding: max( + var(--zen-min-toolbox-padding), + calc(var(--zen-element-separation) / 1.5) + ); } /* ========================================================================== @@ -290,7 +293,9 @@ /* Scale down tab slightly on active press (but not when dragging or clicking images) */ #tabbrowser-tabs:not([movingtab]) &:active:not(:has(.tab-content > image:active)) { - scale: var(--zen-active-tab-scale); /* Requires --zen-active-tab-scale to be defined elsewhere */ + scale: var( + --zen-active-tab-scale + ); /* Requires --zen-active-tab-scale to be defined elsewhere */ } /* Scale down icon/image specifically on active press */ @@ -535,7 +540,9 @@ /* Specific padding for URL bar input in single toolbar mode */ :root[zen-single-toolbar='true'] & { - & #urlbar:not([breakout-extend='true']):not([pageproxystate='invalid']) .urlbar-input-container { + & + #urlbar:not([breakout-extend='true']):not([pageproxystate='invalid']) + .urlbar-input-container { padding-left: 8px; padding-right: 4px; } @@ -660,7 +667,10 @@ /* --- Pinned Tab Icon Repositioning & Reset Button --- */ /* Reposition icon stack absolutely when tab is pinned (and not essential) */ - &[zen-pinned-changed='true']:not([zen-essential]) > .tab-stack > .tab-content > .tab-icon-stack { + &[zen-pinned-changed='true']:not([zen-essential]) + > .tab-stack + > .tab-content + > .tab-icon-stack { position: absolute; top: 50%; transform: translateY(-50%); @@ -889,7 +899,9 @@ :is( :root[uidensity='compact'], #tabbrowser-tabs[secondarytext-unsupported], - :root:not([uidensity='compact']) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover + :root:not([uidensity='compact']) + #tabbrowser-tabs:not([secondarytext-unsupported]) + .tabbrowser-tab:hover ) .tab-icon-stack[indicator-replaces-favicon] > :not(&), @@ -1024,7 +1036,9 @@ display: flex; /* Use flex for alignment */ position: relative; /* For pseudo-element positioning */ height: calc(100% - var(--tab-block-margin) * 2); /* Adjust height based on margins */ - margin-left: calc(-1 * var(--tab-inline-padding) + var(--tab-block-margin)); /* Overlap slightly */ + margin-left: calc( + -1 * var(--tab-inline-padding) + var(--tab-block-margin) + ); /* Overlap slightly */ margin-right: 8px; padding: 0 calc(var(--toolbarbutton-inner-padding) - 2px) 0 calc(var(--toolbarbutton-inner-padding) / 4 + var(--tab-inline-padding) - 2px); /* Custom padding */ @@ -1118,7 +1132,9 @@ /* Adjust inner padding based on sidebar state */ :root[zen-sidebar-expanded='true'] & { - --toolbarbutton-inner-padding: var(--zen-toolbar-button-inner-padding) !important; /* Use theme variable */ + --toolbarbutton-inner-padding: var( + --zen-toolbar-button-inner-padding + ) !important; /* Use theme variable */ } :root[zen-single-toolbar='true'] & { --toolbarbutton-inner-padding: calc( @@ -1153,7 +1169,9 @@ /* Standardize height and padding for toolbar buttons (excluding titlebar buttons) */ & toolbarbutton:not(.titlebar-button) { - height: calc(2 * var(--toolbarbutton-inner-padding) + 16px); /* Calculate height based on padding + icon */ + height: calc( + 2 * var(--toolbarbutton-inner-padding) + 16px + ); /* Calculate height based on padding + icon */ padding: 0 var(--toolbarbutton-outer-padding) !important; /* Apply outer padding */ } @@ -1231,7 +1249,10 @@ content: ''; display: block; height: 1px; - background: light-dark(rgba(1, 1, 1, 0.075), rgba(255, 255, 255, 0.1)); /* Separator color */ + background: light-dark( + rgba(1, 1, 1, 0.075), + rgba(255, 255, 255, 0.1) + ); /* Separator color */ width: 98%; /* Near full width */ position: absolute; top: -8px; /* Position above the button */ @@ -1269,7 +1290,10 @@ grid-template-columns: repeat(auto-fit, minmax(max(30%, 48px), auto)); } &[data-hack-type='2'] { - grid-template-columns: repeat(auto-fit, minmax(max(23%, 48px), 1fr) minmax(max(23%, 48px), 1fr)); + grid-template-columns: repeat( + auto-fit, + minmax(max(23%, 48px), 1fr) minmax(max(23%, 48px), 1fr) + ); } &[data-hack-type='3'] { grid-template-columns: repeat(auto-fit, minmax(max(25%, 48px), 1fr)); @@ -1282,7 +1306,9 @@ &[hidden='true'] { --hidden-essentials-width: var(--zen-sidebar-width); - max-width: var(--hidden-essentials-width) !important; /* To still allow essentials to grid the tabs */ + max-width: var( + --hidden-essentials-width + ) !important; /* To still allow essentials to grid the tabs */ min-width: var(--hidden-essentials-width) !important; } } @@ -1351,7 +1377,9 @@ &::before { background: light-dark(rgba(255, 255, 255, 0.85), rgba(68, 64, 64, 0.85)); margin: var(--zen-essential-bg-margin); /* Apply margin */ - border-radius: calc(var(--border-radius-medium) - var(--zen-essential-bg-margin)); /* Adjust radius */ + border-radius: calc( + var(--border-radius-medium) - var(--zen-essential-bg-margin) + ); /* Adjust radius */ position: absolute; inset: 0; z-index: 0; /* Position above ::after, below content */ diff --git a/src/zen/tests/container_essentials/browser_container_specific_essentials.js b/src/zen/tests/container_essentials/browser_container_specific_essentials.js index f4a39dc6..69c112fa 100644 --- a/src/zen/tests/container_essentials/browser_container_specific_essentials.js +++ b/src/zen/tests/container_essentials/browser_container_specific_essentials.js @@ -19,7 +19,9 @@ add_task(async function test_Check_Creation() { 'New tab should be marked as essential.' ); ok( - gBrowser.tabs.find((t) => t.hasAttribute('zen-essential') && t.getAttribute('usercontextid') == 1), + gBrowser.tabs.find( + (t) => t.hasAttribute('zen-essential') && t.getAttribute('usercontextid') == 1 + ), 'New tab should be marked as essential.' ); const newWorkspaceUUID = ZenWorkspaces.activeWorkspace; @@ -27,7 +29,9 @@ add_task(async function test_Check_Creation() { // Change to the original workspace, there should be no essential tabs await ZenWorkspaces.changeWorkspace(workspaces.workspaces[0]); ok( - !gBrowser.tabs.find((t) => t.hasAttribute('zen-essential') && t.getAttribute('usercontextid') == 1), + !gBrowser.tabs.find( + (t) => t.hasAttribute('zen-essential') && t.getAttribute('usercontextid') == 1 + ), 'No essential tabs should be found in the original workspace.' ); diff --git a/src/zen/tests/urlbar/browser_floating_urlbar.js b/src/zen/tests/urlbar/browser_floating_urlbar.js index 433e4746..fa7e4f82 100644 --- a/src/zen/tests/urlbar/browser_floating_urlbar.js +++ b/src/zen/tests/urlbar/browser_floating_urlbar.js @@ -32,7 +32,10 @@ add_task(async function test_Click_Shoudnt_FLoat_Urlbar() { value: 'http://example.com/', }); - ok(!gURLBar.textbox.hasAttribute('zen-floating-urlbar'), 'URL bar should not be in floating mode'); + ok( + !gURLBar.textbox.hasAttribute('zen-floating-urlbar'), + 'URL bar should not be in floating mode' + ); }); add_task(async function test_Floating_Highlight_Everything() { @@ -44,5 +47,8 @@ add_task(async function test_Floating_Highlight_Everything() { // Selection range ok(gURLBar.selectionStart == 0, 'Selection start should be 0'); - ok(gURLBar.selectionEnd == gURLBar.value.length, 'Selection end should be the length of the value'); + ok( + gURLBar.selectionEnd == gURLBar.value.length, + 'Selection end should be the length of the value' + ); }); diff --git a/src/zen/tests/urlbar/head.js b/src/zen/tests/urlbar/head.js index 2f65e22f..b999721a 100644 --- a/src/zen/tests/urlbar/head.js +++ b/src/zen/tests/urlbar/head.js @@ -14,9 +14,27 @@ function selectWithMouseDrag(fromX, toX, win = window) { let target = win.gURLBar.inputField; let rect = target.getBoundingClientRect(); let promise = BrowserTestUtils.waitForEvent(target, 'mouseup'); - EventUtils.synthesizeMouse(target, fromX, rect.height / 2, { type: 'mousemove' }, target.ownerGlobal); - EventUtils.synthesizeMouse(target, fromX, rect.height / 2, { type: 'mousedown' }, target.ownerGlobal); - EventUtils.synthesizeMouse(target, toX, rect.height / 2, { type: 'mousemove' }, target.ownerGlobal); + EventUtils.synthesizeMouse( + target, + fromX, + rect.height / 2, + { type: 'mousemove' }, + target.ownerGlobal + ); + EventUtils.synthesizeMouse( + target, + fromX, + rect.height / 2, + { type: 'mousedown' }, + target.ownerGlobal + ); + EventUtils.synthesizeMouse( + target, + toX, + rect.height / 2, + { type: 'mousemove' }, + target.ownerGlobal + ); EventUtils.synthesizeMouse(target, toX, rect.height / 2, { type: 'mouseup' }, target.ownerGlobal); return promise; } diff --git a/src/zen/tests/workspaces/browser_basic_workspaces.js b/src/zen/tests/workspaces/browser_basic_workspaces.js index 87f882fb..b4c254f3 100644 --- a/src/zen/tests/workspaces/browser_basic_workspaces.js +++ b/src/zen/tests/workspaces/browser_basic_workspaces.js @@ -10,7 +10,10 @@ add_task(async function test_Check_Creation() { await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2'); const workspaces = await ZenWorkspaces._workspaces(); ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.'); - ok(currentWorkspaceUUID !== workspaces.workspaces[1].uuid, 'The new workspace should be different from the current one.'); + ok( + currentWorkspaceUUID !== workspaces.workspaces[1].uuid, + 'The new workspace should be different from the current one.' + ); let newTab = BrowserTestUtils.addTab(gBrowser, 'about:blank', { skipAnimation: true, @@ -22,6 +25,9 @@ add_task(async function test_Check_Creation() { await ZenWorkspaces.removeWorkspace(ZenWorkspaces.activeWorkspace); const workspacesAfterRemove = await ZenWorkspaces._workspaces(); ok(workspacesAfterRemove.workspaces.length === 1, 'One workspace should exist.'); - ok(workspacesAfterRemove.workspaces[0].uuid === currentWorkspaceUUID, 'The workspace should be the one we started with.'); + ok( + workspacesAfterRemove.workspaces[0].uuid === currentWorkspaceUUID, + 'The workspace should be the one we started with.' + ); ok(gBrowser.tabs.length === 2, 'There should be one tab.'); }); diff --git a/src/zen/tests/workspaces/head.js b/src/zen/tests/workspaces/head.js index 727f140d..f1a07422 100644 --- a/src/zen/tests/workspaces/head.js +++ b/src/zen/tests/workspaces/head.js @@ -11,13 +11,25 @@ const ROOT = getRootDirectory(gTestPath); const HTTPROOT = ROOT.replace('chrome://mochitests/content/', 'http://example.com/'); const HTTPSROOT = ROOT.replace('chrome://mochitests/content/', 'https://example.com/'); -const { SessionSaver } = ChromeUtils.importESModule('resource:///modules/sessionstore/SessionSaver.sys.mjs'); -const { SessionFile } = ChromeUtils.importESModule('resource:///modules/sessionstore/SessionFile.sys.mjs'); -const { TabState } = ChromeUtils.importESModule('resource:///modules/sessionstore/TabState.sys.mjs'); -const { TabStateFlusher } = ChromeUtils.importESModule('resource:///modules/sessionstore/TabStateFlusher.sys.mjs'); -const { SessionStoreTestUtils } = ChromeUtils.importESModule('resource://testing-common/SessionStoreTestUtils.sys.mjs'); +const { SessionSaver } = ChromeUtils.importESModule( + 'resource:///modules/sessionstore/SessionSaver.sys.mjs' +); +const { SessionFile } = ChromeUtils.importESModule( + 'resource:///modules/sessionstore/SessionFile.sys.mjs' +); +const { TabState } = ChromeUtils.importESModule( + 'resource:///modules/sessionstore/TabState.sys.mjs' +); +const { TabStateFlusher } = ChromeUtils.importESModule( + 'resource:///modules/sessionstore/TabStateFlusher.sys.mjs' +); +const { SessionStoreTestUtils } = ChromeUtils.importESModule( + 'resource://testing-common/SessionStoreTestUtils.sys.mjs' +); -const { PageWireframes } = ChromeUtils.importESModule('resource:///modules/sessionstore/PageWireframes.sys.mjs'); +const { PageWireframes } = ChromeUtils.importESModule( + 'resource:///modules/sessionstore/PageWireframes.sys.mjs' +); const ss = SessionStore; SessionStoreTestUtils.init(this, window); @@ -47,7 +59,12 @@ function provideWindow(aCallback, aURL, aFeatures) { }); } - let win = openDialog(AppConstants.BROWSER_CHROME_URL, '', aFeatures || 'chrome,all,dialog=no', aURL || 'about:blank'); + let win = openDialog( + AppConstants.BROWSER_CHROME_URL, + '', + aFeatures || 'chrome,all,dialog=no', + aURL || 'about:blank' + ); whenWindowLoaded(win, function onWindowLoaded(aWin) { if (!aURL) { info('Loaded a blank window.'); @@ -85,11 +102,15 @@ function promiseTabState(tab, state) { } function promiseWindowRestoring(win) { - return new Promise((resolve) => win.addEventListener('SSWindowRestoring', resolve, { once: true })); + return new Promise((resolve) => + win.addEventListener('SSWindowRestoring', resolve, { once: true }) + ); } function promiseWindowRestored(win) { - return new Promise((resolve) => win.addEventListener('SSWindowRestored', resolve, { once: true })); + return new Promise((resolve) => + win.addEventListener('SSWindowRestored', resolve, { once: true }) + ); } async function setBrowserState(state, win = window) { @@ -426,37 +447,45 @@ function modifySessionStorage(browser, storageData, storageOptions = {}) { browsingContext = browsingContext.children[storageOptions.frameIndex]; } - return SpecialPowers.spawn(browsingContext, [[storageData, storageOptions]], async function ([data]) { - let frame = content; - let keys = new Set(Object.keys(data)); - let isClearing = !keys.size; - let storage = frame.sessionStorage; + return SpecialPowers.spawn( + browsingContext, + [[storageData, storageOptions]], + async function ([data]) { + let frame = content; + let keys = new Set(Object.keys(data)); + let isClearing = !keys.size; + let storage = frame.sessionStorage; - return new Promise((resolve) => { - docShell.chromeEventHandler.addEventListener( - 'MozSessionStorageChanged', - function onStorageChanged(event) { - if (event.storageArea == storage) { - keys.delete(event.key); + return new Promise((resolve) => { + docShell.chromeEventHandler.addEventListener( + 'MozSessionStorageChanged', + function onStorageChanged(event) { + if (event.storageArea == storage) { + keys.delete(event.key); + } + + if (keys.size == 0) { + docShell.chromeEventHandler.removeEventListener( + 'MozSessionStorageChanged', + onStorageChanged, + true + ); + resolve(); + } + }, + true + ); + + if (isClearing) { + storage.clear(); + } else { + for (let key of keys) { + frame.sessionStorage[key] = data[key]; } - - if (keys.size == 0) { - docShell.chromeEventHandler.removeEventListener('MozSessionStorageChanged', onStorageChanged, true); - resolve(); - } - }, - true - ); - - if (isClearing) { - storage.clear(); - } else { - for (let key of keys) { - frame.sessionStorage[key] = data[key]; } - } - }); - }); + }); + } + ); } function pushPrefs(...aPrefs) { @@ -503,20 +532,28 @@ function whenDomWindowClosedHandled(aCallback) { } function getPropertyOfFormField(browserContext, selector, propName) { - return SpecialPowers.spawn(browserContext, [selector, propName], (selectorChild, propNameChild) => { - return content.document.querySelector(selectorChild)[propNameChild]; - }); + return SpecialPowers.spawn( + browserContext, + [selector, propName], + (selectorChild, propNameChild) => { + return content.document.querySelector(selectorChild)[propNameChild]; + } + ); } function setPropertyOfFormField(browserContext, selector, propName, newValue) { - return SpecialPowers.spawn(browserContext, [selector, propName, newValue], (selectorChild, propNameChild, newValueChild) => { - let node = content.document.querySelector(selectorChild); - node[propNameChild] = newValueChild; + return SpecialPowers.spawn( + browserContext, + [selector, propName, newValue], + (selectorChild, propNameChild, newValueChild) => { + let node = content.document.querySelector(selectorChild); + node[propNameChild] = newValueChild; - let event = node.ownerDocument.createEvent('UIEvents'); - event.initUIEvent('input', true, true, node.ownerGlobal, 0); - node.dispatchEvent(event); - }); + let event = node.ownerDocument.createEvent('UIEvents'); + event.initUIEvent('input', true, true, node.ownerGlobal, 0); + node.dispatchEvent(event); + } + ); } function promiseOnHistoryReplaceEntry(browser) { diff --git a/src/zen/welcome/ZenWelcome.mjs b/src/zen/welcome/ZenWelcome.mjs index 9541a18f..071286ad 100644 --- a/src/zen/welcome/ZenWelcome.mjs +++ b/src/zen/welcome/ZenWelcome.mjs @@ -84,8 +84,16 @@ async function openInitialPinTab() { const tabs = [ - ['https://reddit.com/r/zen_browser', 'Zen on Reddit', 'chrome://browser/content/zen-images/favicons/reddit.ico'], - ['https://x.com/zen_browser', 'Zen on Twitter', 'chrome://browser/content/zen-images/favicons/x.ico'], + [ + 'https://reddit.com/r/zen_browser', + 'Zen on Reddit', + 'chrome://browser/content/zen-images/favicons/reddit.ico', + ], + [ + 'https://x.com/zen_browser', + 'Zen on Twitter', + 'chrome://browser/content/zen-images/favicons/x.ico', + ], ]; await PlacesUtils.history.insertMany( @@ -307,7 +315,11 @@ getEngines() { return this._engines.filter( - (engine) => !(engine.name.toLowerCase().includes('wikipedia') || engine.name.toLowerCase().includes('ebay')) + (engine) => + !( + engine.name.toLowerCase().includes('wikipedia') || + engine.name.toLowerCase().includes('ebay') + ) ); } @@ -344,7 +356,10 @@ } async setDefaultEngine(engine) { - await Services.search.setDefault(engine.originalEngine, Ci.nsISearchService.CHANGE_REASON_USER); + await Services.search.setDefault( + engine.originalEngine, + Ci.nsISearchService.CHANGE_REASON_USER + ); } } @@ -398,7 +413,9 @@ document.getElementById('zen-welcome-page-content').appendChild(fragment); }, async fadeOut() { - const shouldSetDefault = document.getElementById('zen-welcome-set-default-browser').checked; + const shouldSetDefault = document.getElementById( + 'zen-welcome-set-default-browser' + ).checked; if (AppConstants.HAVE_SHELL_SERVICE && shouldSetDefault) { let shellSvc = getShellService(); if (!shellSvc) { @@ -728,7 +745,9 @@ function () { window.resizeTo(875, 560); window.focus(); - const appWin = window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow); + const appWin = window.docShell.treeOwner + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIAppWindow); appWin.rollupAllPopups(); window.moveTo( screen.availLeft + (screen.availWidth - outerWidth) / 2, diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index 7af478d6..0b054f3a 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -13,12 +13,17 @@ useAlgo = ''; constructor() { super(); - if (!Services.prefs.getBoolPref('zen.theme.gradient', true) || !ZenWorkspaces.shouldHaveWorkspaces) { + if ( + !Services.prefs.getBoolPref('zen.theme.gradient', true) || + !ZenWorkspaces.shouldHaveWorkspaces + ) { return; } this.dragStartPosition = null; - ChromeUtils.defineLazyGetter(this, 'panel', () => document.getElementById('PanelUI-zen-gradient-generator')); + ChromeUtils.defineLazyGetter(this, 'panel', () => + document.getElementById('PanelUI-zen-gradient-generator') + ); ChromeUtils.defineLazyGetter(this, 'toolbox', () => document.getElementById('TabsToolbar')); ChromeUtils.defineLazyGetter(this, 'customColorInput', () => document.getElementById('PanelUI-zen-gradient-generator-custom-input') @@ -48,7 +53,9 @@ this.initTextureInput(); this.initRotationInput(); - window.matchMedia('(prefers-color-scheme: dark)').addListener(this.onDarkModeChange.bind(this)); + window + .matchMedia('(prefers-color-scheme: dark)') + .addListener(this.onDarkModeChange.bind(this)); } get isDarkMode() { @@ -110,50 +117,52 @@ } initPredefinedColors() { - document.getElementById('PanelUI-zen-gradient-generator-predefined').addEventListener('click', async (event) => { - const target = event.target; - const rawPosition = target.getAttribute('data-position'); - if (!rawPosition) { - return; - } - const algo = target.getAttribute('data-algo'); - const numDots = parseInt(target.getAttribute('data-num-dots')); - if (algo == 'float') { - for (const dot of this.dots) { - dot.element.remove(); + document + .getElementById('PanelUI-zen-gradient-generator-predefined') + .addEventListener('click', async (event) => { + const target = event.target; + const rawPosition = target.getAttribute('data-position'); + if (!rawPosition) { + return; } - this.dots = []; - } else if (numDots < this.dots.length) { - for (let i = numDots; i < this.dots.length; i++) { - this.dots[i].element.remove(); + const algo = target.getAttribute('data-algo'); + const numDots = parseInt(target.getAttribute('data-num-dots')); + if (algo == 'float') { + for (const dot of this.dots) { + dot.element.remove(); + } + this.dots = []; + } else if (numDots < this.dots.length) { + for (let i = numDots; i < this.dots.length; i++) { + this.dots[i].element.remove(); + } + this.dots = this.dots.slice(0, numDots); } - this.dots = this.dots.slice(0, numDots); - } - // Generate new gradient from the single color given - const [x, y] = rawPosition.split(',').map((pos) => parseInt(pos)); - let dots = [ - { - ID: 0, - position: { x, y }, - }, - ]; - for (let i = 1; i < numDots; i++) { - dots.push({ - ID: i, - position: { x: 0, y: 0 }, - }); - } - this.useAlgo = algo; - dots = this.calculateCompliments(dots, 'update', this.useAlgo); - if (algo == 'float') { - for (const dot of dots) { - this.spawnDot(dot.position); + // Generate new gradient from the single color given + const [x, y] = rawPosition.split(',').map((pos) => parseInt(pos)); + let dots = [ + { + ID: 0, + position: { x, y }, + }, + ]; + for (let i = 1; i < numDots; i++) { + dots.push({ + ID: i, + position: { x: 0, y: 0 }, + }); } - this.dots[0].element.classList.add('primary'); - } - this.handleColorPositions(dots); - this.updateCurrentWorkspace(); - }); + this.useAlgo = algo; + dots = this.calculateCompliments(dots, 'update', this.useAlgo); + if (algo == 'float') { + for (const dot of dots) { + this.spawnDot(dot.position); + } + this.dots[0].element.classList.add('primary'); + } + this.handleColorPositions(dots); + this.updateCurrentWorkspace(); + }); } initCustomColorInput() { @@ -383,8 +392,12 @@ `); - listItems.querySelector('.zen-theme-picker-custom-list-item').setAttribute('data-color', color); - listItems.querySelector('.zen-theme-picker-dot').style.setProperty('--zen-theme-picker-dot-color', color); + listItems + .querySelector('.zen-theme-picker-custom-list-item') + .setAttribute('data-color', color); + listItems + .querySelector('.zen-theme-picker-dot') + .style.setProperty('--zen-theme-picker-dot-color', color); listItems.querySelector('.zen-theme-picker-custom-list-item-label').textContent = color; listItems .querySelector('.zen-theme-picker-custom-list-item-remove') @@ -452,7 +465,10 @@ } const colorFromPos = this.getColorFromPosition(relativePosition.x, relativePosition.y); - dot.style.setProperty('--zen-theme-picker-dot-color', `rgb(${colorFromPos[0]}, ${colorFromPos[1]}, ${colorFromPos[2]})`); + dot.style.setProperty( + '--zen-theme-picker-dot-color', + `rgb(${colorFromPos[0]}, ${colorFromPos[1]}, ${colorFromPos[2]})` + ); this.dots.push({ ID: id, @@ -481,13 +497,17 @@ if (selectedHarmony) { if (action === 'remove') { if (dots.length !== 0) { - return colorHarmonies.find((harmony) => harmony.angles.length === selectedHarmony.angles.length - 1); + return colorHarmonies.find( + (harmony) => harmony.angles.length === selectedHarmony.angles.length - 1 + ); } else { return { type: 'floating', angles: [] }; } } if (action === 'add') { - return colorHarmonies.find((harmony) => harmony.angles.length === selectedHarmony.angles.length + 1); + return colorHarmonies.find( + (harmony) => harmony.angles.length === selectedHarmony.angles.length + 1 + ); } if (action === 'update') { return selectedHarmony; @@ -526,7 +546,10 @@ let updatedDots = [...dots]; const centerPosition = { x: rect.width / 2, y: rect.height / 2 }; - const harmonyAngles = getColorHarmonyType(dots.length + (action === 'add' ? 1 : action === 'remove' ? -1 : 0), this.dots); + const harmonyAngles = getColorHarmonyType( + dots.length + (action === 'add' ? 1 : action === 'remove' ? -1 : 0), + this.dots + ); this.useAlgo = harmonyAngles.type; if (!harmonyAngles || harmonyAngles.angles.length === 0) return dots; @@ -594,7 +617,10 @@ if (existingPrimaryDot) { existingPrimaryDot.element.style.zIndex = 999; - const colorFromPos = this.getColorFromPosition(existingPrimaryDot.position.x, existingPrimaryDot.position.y); + const colorFromPos = this.getColorFromPosition( + existingPrimaryDot.position.x, + existingPrimaryDot.position.y + ); existingPrimaryDot.element.style.setProperty( '--zen-theme-picker-dot-color', `rgb(${colorFromPos[0]}, ${colorFromPos[1]}, ${colorFromPos[2]})` @@ -606,7 +632,10 @@ if (existingDot) { existingDot.position = dotPosition.position; - const colorFromPos = this.getColorFromPosition(dotPosition.position.x, dotPosition.position.y); + const colorFromPos = this.getColorFromPosition( + dotPosition.position.x, + dotPosition.position.y + ); existingDot.element.style.setProperty( '--zen-theme-picker-dot-color', `rgb(${colorFromPos[0]}, ${colorFromPos[1]}, ${colorFromPos[2]})` @@ -681,7 +710,9 @@ (harmony) => harmony.angles.length + 1 === this.dots.length || harmony.type === 'floating' ); - let currentIndex = applicableHarmonies.findIndex((harmony) => harmony.type === this.useAlgo); + let currentIndex = applicableHarmonies.findIndex( + (harmony) => harmony.type === this.useAlgo + ); let nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % applicableHarmonies.length; this.useAlgo = applicableHarmonies[nextIndex].type; @@ -875,7 +906,11 @@ return colors.map((color) => ({ c: color.isCustom ? color.c - : [Math.min(255, color.c[0] * factor), Math.min(255, color.c[1] * factor), Math.min(255, color.c[2] * factor)], + : [ + Math.min(255, color.c[0] * factor), + Math.min(255, color.c[1] * factor), + Math.min(255, color.c[2] * factor), + ], isCustom: color.isCustom, algorithm: color.algorithm, })); @@ -908,7 +943,9 @@ this.useAlgo = themedColors[0]?.algorithm ?? ''; if (themedColors.length === 0) { - return forToolbar ? 'var(--zen-themed-toolbar-bg)' : 'var(--zen-themed-toolbar-bg-transparent)'; + return forToolbar + ? 'var(--zen-themed-toolbar-bg)' + : 'var(--zen-themed-toolbar-bg-transparent)'; } else if (themedColors.length === 1) { return this.getSingleRGBColor(themedColors[0], forToolbar); } else if (themedColors.length !== 3) { @@ -945,7 +982,11 @@ .map((char) => char + char) .join(''); } - return [parseInt(hex.substring(0, 2), 16), parseInt(hex.substring(2, 4), 16), parseInt(hex.substring(4, 6), 16)]; + return [ + parseInt(hex.substring(0, 2), 16), + parseInt(hex.substring(2, 4), 16), + parseInt(hex.substring(4, 6), 16), + ]; } pSBC = (p, c0, c1, l) => { @@ -959,7 +1000,14 @@ i = parseInt, m = Math.round, a = typeof c1 == 'string'; - if (typeof p != 'number' || p < -1 || p > 1 || typeof c0 != 'string' || (c0[0] != 'r' && c0[0] != '#') || (c1 && !a)) + if ( + typeof p != 'number' || + p < -1 || + p > 1 || + typeof c0 != 'string' || + (c0[0] != 'r' && c0[0] != '#') || + (c1 && !a) + ) return null; if (!this.pSBCr) this.pSBCr = (d) => { @@ -968,13 +1016,20 @@ if (n > 9) { ([r, g, b, a] = d = d.split(',')), (n = d.length); if (n < 3 || n > 4) return null; - (x.r = i(r[3] == 'a' ? r.slice(5) : r.slice(4))), (x.g = i(g)), (x.b = i(b)), (x.a = a ? parseFloat(a) : -1); + (x.r = i(r[3] == 'a' ? r.slice(5) : r.slice(4))), + (x.g = i(g)), + (x.b = i(b)), + (x.a = a ? parseFloat(a) : -1); } else { if (n == 8 || n == 6 || n < 4) return null; - if (n < 6) d = '#' + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : ''); + if (n < 6) + d = '#' + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (n > 4 ? d[4] + d[4] : ''); d = i(d.slice(1), 16); if (n == 9 || n == 5) - (x.r = (d >> 24) & 255), (x.g = (d >> 16) & 255), (x.b = (d >> 8) & 255), (x.a = m((d & 255) / 0.255) / 1000); + (x.r = (d >> 24) & 255), + (x.g = (d >> 16) & 255), + (x.b = (d >> 8) & 255), + (x.a = m((d & 255) / 0.255) / 1000); else (x.r = d >> 16), (x.g = (d >> 8) & 255), (x.b = d & 255), (x.a = -1); } return x; @@ -983,7 +1038,12 @@ (h = a ? (c1.length > 9 ? true : c1 == 'c' ? !h : false) : h), (f = this.pSBCr(c0)), (P = p < 0), - (t = c1 && c1 != 'c' ? this.pSBCr(c1) : P ? { r: 0, g: 0, b: 0, a: -1 } : { r: 255, g: 255, b: 255, a: -1 }), + (t = + c1 && c1 != 'c' + ? this.pSBCr(c1) + : P + ? { r: 0, g: 0, b: 0, a: -1 } + : { r: 255, g: 255, b: 255, a: -1 }), (p = P ? p * -1 : p), (P = 1 - p); if (!f || !t) return null; @@ -992,12 +1052,28 @@ (r = m((P * f.r ** 2 + p * t.r ** 2) ** 0.5)), (g = m((P * f.g ** 2 + p * t.g ** 2) ** 0.5)), (b = m((P * f.b ** 2 + p * t.b ** 2) ** 0.5)); - (a = f.a), (t = t.a), (f = a >= 0 || t >= 0), (a = f ? (a < 0 ? t : t < 0 ? a : a * P + t * p) : 0); - if (h) return 'rgb' + (f ? 'a(' : '(') + r + ',' + g + ',' + b + (f ? ',' + m(a * 1000) / 1000 : '') + ')'; + (a = f.a), + (t = t.a), + (f = a >= 0 || t >= 0), + (a = f ? (a < 0 ? t : t < 0 ? a : a * P + t * p) : 0); + if (h) + return ( + 'rgb' + + (f ? 'a(' : '(') + + r + + ',' + + g + + ',' + + b + + (f ? ',' + m(a * 1000) / 1000 : '') + + ')' + ); else return ( '#' + - (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)).toString(16).slice(1, f ? undefined : -2) + (4294967296 + r * 16777216 + g * 65536 + b * 256 + (f ? m(a * 255) : 0)) + .toString(16) + .slice(1, f ? undefined : -2) ); }; @@ -1033,7 +1109,9 @@ workspaceTheme = this.fixTheme(theme || windowWorkspace.theme); if (!skipUpdate) { - for (const dot of browser.gZenThemePicker.panel.querySelectorAll('.zen-theme-picker-dot')) { + for (const dot of browser.gZenThemePicker.panel.querySelectorAll( + '.zen-theme-picker-dot' + )) { dot.remove(); } } @@ -1052,7 +1130,9 @@ this._animatingBackground = false; appWrapper.removeAttribute('animating'); appWrapper.setAttribute('post-animating', 'true'); - browser.document.documentElement.style.removeProperty('--zen-main-browser-background-old'); + browser.document.documentElement.style.removeProperty( + '--zen-main-browser-background-old' + ); setTimeout(() => { // Reactivate the transition after the animation appWrapper.removeAttribute('post-animating'); @@ -1061,9 +1141,14 @@ }); } - const button = browser.document.getElementById('PanelUI-zen-gradient-generator-color-toggle-algo'); + const button = browser.document.getElementById( + 'PanelUI-zen-gradient-generator-color-toggle-algo' + ); if (browser.gZenThemePicker.useAlgo) { - document.l10n.setAttributes(button, `zen-panel-ui-gradient-generator-algo-${browser.gZenThemePicker.useAlgo}`); + document.l10n.setAttributes( + button, + `zen-panel-ui-gradient-generator-algo-${browser.gZenThemePicker.useAlgo}` + ); } else { button.removeAttribute('data-l10n-id'); } @@ -1072,10 +1157,19 @@ if (!workspaceTheme || workspaceTheme.type !== 'gradient') { const gradient = browser.gZenThemePicker.getGradient([]); const gradientToolbar = browser.gZenThemePicker.getGradient([], true); - browser.document.documentElement.style.setProperty('--zen-main-browser-background', gradient); - browser.document.documentElement.style.setProperty('--zen-main-browser-background-toolbar', gradientToolbar); + browser.document.documentElement.style.setProperty( + '--zen-main-browser-background', + gradient + ); + browser.document.documentElement.style.setProperty( + '--zen-main-browser-background-toolbar', + gradientToolbar + ); browser.gZenThemePicker.updateNoise(0); - browser.document.documentElement.style.setProperty('--zen-primary-color', this.getNativeAccentColor()); + browser.document.documentElement.style.setProperty( + '--zen-primary-color', + this.getNativeAccentColor() + ); return; } @@ -1083,7 +1177,9 @@ browser.gZenThemePicker.currentRotation = workspaceTheme.rotation ?? -45; browser.gZenThemePicker.currentTexture = workspaceTheme.texture ?? 0; - for (const button of browser.document.querySelectorAll('#PanelUI-zen-gradient-generator-color-actions button')) { + for (const button of browser.document.querySelectorAll( + '#PanelUI-zen-gradient-generator-color-actions button' + )) { // disable if there are no buttons button.disabled = workspaceTheme.gradientColors.length === 0 || @@ -1097,7 +1193,9 @@ browser.document.getElementById('PanelUI-zen-gradient-generator-opacity').value = browser.gZenThemePicker.currentOpacity; - const textureSelectWrapper = browser.document.getElementById('PanelUI-zen-gradient-generator-texture-wrapper'); + const textureSelectWrapper = browser.document.getElementById( + 'PanelUI-zen-gradient-generator-texture-wrapper' + ); const textureWrapperWidth = textureSelectWrapper.getBoundingClientRect().width; // Dont show when hidden if (textureWrapperWidth) { @@ -1125,8 +1223,12 @@ } const numberOfColors = workspaceTheme.gradientColors?.length; - const rotationDot = browser.document.getElementById('PanelUI-zen-gradient-generator-rotation-dot'); - const rotationLine = browser.document.getElementById('PanelUI-zen-gradient-generator-rotation-line'); + const rotationDot = browser.document.getElementById( + 'PanelUI-zen-gradient-generator-rotation-dot' + ); + const rotationLine = browser.document.getElementById( + 'PanelUI-zen-gradient-generator-rotation-line' + ); if (numberOfColors > 1) { rotationDot.style.opacity = 1; rotationLine.style.opacity = 1; @@ -1136,9 +1238,11 @@ const rotationDotPosition = this.currentRotation; const rotationDotWidth = 30; const rotationDotX = - Math.cos((rotationDotPosition * Math.PI) / 180) * (rotationParentWidth / 2 - rotationDotWidth / 2); + Math.cos((rotationDotPosition * Math.PI) / 180) * + (rotationParentWidth / 2 - rotationDotWidth / 2); const rotationDotY = - Math.sin((rotationDotPosition * Math.PI) / 180) * (rotationParentWidth / 2 - rotationDotWidth / 2); + Math.sin((rotationDotPosition * Math.PI) / 180) * + (rotationParentWidth / 2 - rotationDotWidth / 2); rotationDot.style.left = `${rotationParentWidth / 2 + rotationDotX - rotationPadding + rotationDotWidth / 4}px`; rotationDot.style.top = `${rotationParentWidth / 2 + rotationDotY - rotationPadding + rotationDotWidth / 4}px`; } else { @@ -1149,7 +1253,10 @@ } const gradient = browser.gZenThemePicker.getGradient(workspaceTheme.gradientColors); - const gradientToolbar = browser.gZenThemePicker.getGradient(workspaceTheme.gradientColors, true); + const gradientToolbar = browser.gZenThemePicker.getGradient( + workspaceTheme.gradientColors, + true + ); browser.gZenThemePicker.updateNoise(workspaceTheme.texture); for (const dot of workspaceTheme.gradientColors) { @@ -1158,8 +1265,14 @@ } } - browser.document.documentElement.style.setProperty('--zen-main-browser-background-toolbar', gradientToolbar); - browser.document.documentElement.style.setProperty('--zen-main-browser-background', gradient); + browser.document.documentElement.style.setProperty( + '--zen-main-browser-background-toolbar', + gradientToolbar + ); + browser.document.documentElement.style.setProperty( + '--zen-main-browser-background', + gradient + ); const dominantColor = this.getMostDominantColor(workspaceTheme.gradientColors); if (dominantColor) { @@ -1180,7 +1293,10 @@ fixTheme(theme) { // add a primary color if there isn't one - if (!theme.gradientColors.find((color) => color.isPrimary) && theme.gradientColors.length > 0) { + if ( + !theme.gradientColors.find((color) => color.isPrimary) && + theme.gradientColors.length > 0 + ) { theme.gradientColors[(theme.gradientColors.length / 2) | 0].isPrimary = true; } return theme; @@ -1252,9 +1368,19 @@ } const isCustom = dot.classList.contains('custom'); const algorithm = this.useAlgo; - return { c: isCustom ? color : color.match(/\d+/g).map(Number), isCustom, algorithm, isPrimary }; + return { + c: isCustom ? color : color.match(/\d+/g).map(Number), + isCustom, + algorithm, + isPrimary, + }; }); - const gradient = ZenThemePicker.getTheme(colors, this.currentOpacity, this.currentRotation, this.currentTexture); + const gradient = ZenThemePicker.getTheme( + colors, + this.currentOpacity, + this.currentRotation, + this.currentTexture + ); let currentWorkspace = await ZenWorkspaces.getActiveWorkspace(); if (!skipSave) { diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index c2f513c1..83a46ce4 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -48,7 +48,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { `; async waitForPromises() { - await Promise.all([this.promiseDBInitialized, this.promisePinnedInitialized, SessionStore.promiseAllWindowsRestored]); + await Promise.all([ + this.promiseDBInitialized, + this.promisePinnedInitialized, + SessionStore.promiseAllWindowsRestored, + ]); } async init() { @@ -64,15 +68,32 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (!this.shouldHaveWorkspaces) { this._resolveInitialized(); - document.getElementById('zen-current-workspace-indicator-container').setAttribute('hidden', 'true'); + document + .getElementById('zen-current-workspace-indicator-container') + .setAttribute('hidden', 'true'); console.warn('ZenWorkspaces: !!! ZenWorkspaces is disabled in hidden windows !!!'); return; // We are in a hidden window, don't initialize ZenWorkspaces } this.ownerWindow = window; - XPCOMUtils.defineLazyPreferenceGetter(this, 'activationMethod', 'zen.workspaces.scroll-modifier-key', 'ctrl'); - XPCOMUtils.defineLazyPreferenceGetter(this, 'naturalScroll', 'zen.workspaces.natural-scroll', true); - XPCOMUtils.defineLazyPreferenceGetter(this, 'shouldWrapAroundNavigation', 'zen.workspaces.wrap-around-navigation', true); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'activationMethod', + 'zen.workspaces.scroll-modifier-key', + 'ctrl' + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'naturalScroll', + 'zen.workspaces.natural-scroll', + true + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'shouldWrapAroundNavigation', + 'zen.workspaces.wrap-around-navigation', + true + ); XPCOMUtils.defineLazyPreferenceGetter( this, 'shouldForceContainerTabsToWorkspace', @@ -89,7 +110,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { 'zen.workspaces.container-specific-essentials-enabled', false ); - ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs')); + ChromeUtils.defineLazyGetter(this, 'tabContainer', () => + document.getElementById('tabbrowser-tabs') + ); this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', ''); window.addEventListener('resize', this.onWindowResize.bind(this)); @@ -111,7 +134,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this.log('ZenWorkspaces initialized'); await this.initializeWorkspaces(); - if (Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) && this.workspaceEnabled) { + if ( + Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) && + this.workspaceEnabled + ) { this.initializeGestureHandlers(); this.initializeWorkspaceNavigation(); } @@ -158,7 +184,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const timeSinceLastSelection = now - this._tabSelectionState.lastSelectionTime; if (timeSinceLastSelection < this._tabSelectionState.debounceTime) { - await new Promise((resolve) => setTimeout(resolve, this._tabSelectionState.debounceTime - timeSinceLastSelection)); + await new Promise((resolve) => + setTimeout(resolve, this._tabSelectionState.debounceTime - timeSinceLastSelection) + ); } // Mark selection as in progress @@ -278,7 +306,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } _initializeEmptyTab() { - this._emptyTab = gBrowser.addTrustedTab('about:blank', { inBackground: true, userContextId: 0, _forZenEmptyTab: true }); + this._emptyTab = gBrowser.addTrustedTab('about:blank', { + inBackground: true, + userContextId: 0, + _forZenEmptyTab: true, + }); } registerPinnedResizeObserver() { @@ -377,7 +409,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (!this.containerSpecificEssentials) { container = 0; } - let essentialsContainer = document.querySelector(`.zen-essentials-container[container="${container}"]:not([cloned])`); + let essentialsContainer = document.querySelector( + `.zen-essentials-container[container="${container}"]:not([cloned])` + ); if (!essentialsContainer) { essentialsContainer = document.createXULElement('hbox'); essentialsContainer.className = 'zen-essentials-container zen-workspace-tabs-section'; @@ -421,13 +455,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const workspaceIndicator = this.#createWorkspaceSection(workspace); workspaceIndicator.classList.add('zen-current-workspace-indicator'); - workspaceIndicator.appendChild(window.MozXULElement.parseXULToFragment(this.workspaceIndicatorXUL)); - document.getElementById('zen-current-workspace-indicator-container').appendChild(workspaceIndicator); + workspaceIndicator.appendChild( + window.MozXULElement.parseXULToFragment(this.workspaceIndicatorXUL) + ); + document + .getElementById('zen-current-workspace-indicator-container') + .appendChild(workspaceIndicator); this.initIndicatorContextMenu(workspaceIndicator); } _organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) { - const workspaceTabs = Array.from(tabs).filter((tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid); + const workspaceTabs = Array.from(tabs).filter( + (tab) => tab.getAttribute('zen-workspace-id') === workspace.uuid + ); let firstNormalTab = null; for (let tab of workspaceTabs) { if (tab.hasAttribute('zen-essential')) { @@ -521,7 +561,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { meta: event.metaKey, }; - if (this.activationMethod in activationKeyMap && !activationKeyMap[this.activationMethod]) { + if ( + this.activationMethod in activationKeyMap && + !activationKeyMap[this.activationMethod] + ) { return; } } @@ -699,7 +742,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get workspaceEnabled() { if (typeof this._workspaceEnabled === 'undefined') { - this._workspaceEnabled = this.shouldHaveWorkspaces && !Services.prefs.getBoolPref('zen.testing.profiling.enabled', false); + this._workspaceEnabled = + this.shouldHaveWorkspaces && + !Services.prefs.getBoolPref('zen.testing.profiling.enabled', false); } return this._workspaceEnabled && !window.closed; } @@ -741,7 +786,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this.activeWorkspace = this._workspaceCache.workspaces[0]?.uuid; } // sort by position - this._workspaceCache.workspaces.sort((a, b) => (a.position ?? Infinity) - (b.position ?? Infinity)); + this._workspaceCache.workspaces.sort( + (a, b) => (a.position ?? Infinity) - (b.position ?? Infinity) + ); return this._workspaceCache; } @@ -811,7 +858,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { }; let removedEmptyTab = false; - if (this._initialTab && !(this._initialTab._shouldRemove && this._initialTab._veryPossiblyEmpty)) { + if ( + this._initialTab && + !(this._initialTab._shouldRemove && this._initialTab._veryPossiblyEmpty) + ) { gBrowser.selectedTab = this._initialTab; this.moveTabToWorkspace(this._initialTab, this.activeWorkspace); gBrowser.moveTabTo(this._initialTab, { forceUngrouped: true, tabIndex: 0 }); @@ -820,7 +870,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } if (this._tabToRemoveForEmpty && !removedEmptyTab) { - const tabs = gBrowser.tabs.filter((tab) => !tab.collapsed && !tab.hasAttribute('zen-empty-tab')); + const tabs = gBrowser.tabs.filter( + (tab) => !tab.collapsed && !tab.hasAttribute('zen-empty-tab') + ); if ( typeof this._tabToSelect === 'number' && this._tabToSelect >= 0 && @@ -866,6 +918,26 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (gZenVerticalTabsManager._canReplaceNewTab && showed) { BrowserCommands.openTab(); } + + if ( + !gZenVerticalTabsManager._canReplaceNewTab && + !Services.prefs.getBoolPref('zen.workspaces.continue-where-left-off') + ) { + // Go through each tab and see if there's another tab with the same startup URL. + // If we do find one, remove it. + const newTabUrl = Services.prefs.getStringPref('browser.startup.homepage'); + const tabs = gBrowser.tabs.filter( + (tab) => !tab.collapsed && !tab.hasAttribute('zen-empty-tab') && !tab.pinned + ); + for (const tab of tabs) { + if (tab._originalUrl === newTabUrl && tab !== gBrowser.selectedTab) { + gBrowser.removeTab(tab, { + skipSessionStore: true, + }); + } + } + } + window.dispatchEvent(new CustomEvent('AfterWorkspacesSessionRestore', { bubbles: true })); } @@ -893,7 +965,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } shouldCloseWindow() { - return !window.toolbar.visible || Services.prefs.getBoolPref('browser.tabs.closeWindowWithLastTab'); + return ( + !window.toolbar.visible || Services.prefs.getBoolPref('browser.tabs.closeWindowWithLastTab') + ); } async _clearAnyZombieTabs() { @@ -927,7 +1001,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } let tabs = gBrowser.visibleTabs; - let tabsPinned = tabs.filter((t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned); + let tabsPinned = tabs.filter( + (t) => !this.shouldOpenNewTabIfLastUnpinnedTabIsClosed || !t.pinned + ); const shouldCloseWindow = this.shouldCloseWindow() && closeWindowWithLastTab; if (tabs.length === 1 && tabs[0] === tab) { if (shouldCloseWindow) { @@ -1172,15 +1248,21 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async removeWorkspace(windowID) { let workspacesData = await this._workspaces(); this._deleteAllTabsInWorkspace(windowID); - await this.changeWorkspace(workspacesData.workspaces.find((workspace) => workspace.uuid !== windowID)); + await this.changeWorkspace( + workspacesData.workspaces.find((workspace) => workspace.uuid !== windowID) + ); delete this._lastSelectedWorkspaceTabs[windowID]; await ZenWorkspacesStorage.removeWorkspace(windowID); // Remove the workspace from the cache - this._workspaceCache.workspaces = this._workspaceCache.workspaces.filter((workspace) => workspace.uuid !== windowID); + this._workspaceCache.workspaces = this._workspaceCache.workspaces.filter( + (workspace) => workspace.uuid !== windowID + ); await this._propagateWorkspaceData(); await this._updateWorkspacesChangeContextMenu(); this.onWindowResize(); - for (let container of document.querySelectorAll(`.zen-workspace-tabs-section[zen-workspace-id="${windowID}"]`)) { + for (let container of document.querySelectorAll( + `.zen-workspace-tabs-section[zen-workspace-id="${windowID}"]` + )) { container.remove(); } this.registerPinnedResizeObserver(); @@ -1192,7 +1274,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async getActiveWorkspace() { const workspaces = await this._workspaces(); - return workspaces.workspaces.find((workspace) => workspace.uuid === this.activeWorkspace) ?? workspaces.workspaces[0]; + return ( + workspaces.workspaces.find((workspace) => workspace.uuid === this.activeWorkspace) ?? + workspaces.workspaces[0] + ); } // Workspaces dialog UI management @@ -1204,13 +1289,15 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this._workspaceCreateInput.textContent = ''; this._workspaceCreateInput.value = ''; this._workspaceCreateInput.setAttribute('data-initial-value', ''); - document.querySelectorAll('#PanelUI-zen-workspaces-icon-picker-wrapper toolbarbutton').forEach((button) => { - if (button.label === icon) { - button.setAttribute('selected', 'true'); - } else { - button.removeAttribute('selected'); - } - }); + document + .querySelectorAll('#PanelUI-zen-workspaces-icon-picker-wrapper toolbarbutton') + .forEach((button) => { + if (button.label === icon) { + button.setAttribute('selected', 'true'); + } else { + button.removeAttribute('selected'); + } + }); document.querySelector('.PanelUI-zen-workspaces-icons-container.create').textContent = icon; PanelUI.showSubView('PanelUI-zen-workspaces-create', parentPanel); @@ -1229,14 +1316,17 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this.onWorkspaceIconChangeInner('edit', ...args); this.onWorkspaceEditChange(...args); }; - document.querySelectorAll('#PanelUI-zen-workspaces-icon-picker-wrapper toolbarbutton').forEach((button) => { - if (button.label === workspaceData.icon) { - button.setAttribute('selected', 'true'); - } else { - button.removeAttribute('selected'); - } - }); - document.querySelector('.PanelUI-zen-workspaces-icons-container.edit').textContent = this.getWorkspaceIcon(workspaceData); + document + .querySelectorAll('#PanelUI-zen-workspaces-icon-picker-wrapper toolbarbutton') + .forEach((button) => { + if (button.label === workspaceData.icon) { + button.setAttribute('selected', 'true'); + } else { + button.removeAttribute('selected'); + } + }); + document.querySelector('.PanelUI-zen-workspaces-icons-container.edit').textContent = + this.getWorkspaceIcon(workspaceData); let parentPanel = document.getElementById('PanelUI-zen-workspaces-multiview'); PanelUI.showSubView('PanelUI-zen-workspaces-edit', parentPanel); } @@ -1283,7 +1373,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get shouldShowContainers() { return ( - Services.prefs.getBoolPref('privacy.userContext.ui.enabled') && ContextualIdentityService.getPublicIdentities().length > 0 + Services.prefs.getBoolPref('privacy.userContext.ui.enabled') && + ContextualIdentityService.getPublicIdentities().length > 0 ); } @@ -1420,19 +1511,21 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { `); // use text content instead of innerHTML to avoid XSS - childs.querySelector('.zen-workspace-icon').textContent = browser.ZenWorkspaces.getWorkspaceIcon(workspace); + childs.querySelector('.zen-workspace-icon').textContent = + browser.ZenWorkspaces.getWorkspaceIcon(workspace); childs.querySelector('.zen-workspace-name').textContent = workspace.name; if (containerGroup) { - childs.querySelector('.zen-workspace-container').textContent = ContextualIdentityService.getUserContextLabel( - containerGroup.userContextId - ); + childs.querySelector('.zen-workspace-container').textContent = + ContextualIdentityService.getUserContextLabel(containerGroup.userContextId); } childs.querySelector('.zen-workspace-actions').addEventListener( 'command', ((event) => { let button = event.target; - this._contextMenuId = button.closest('toolbarbutton[zen-workspace-id]').getAttribute('zen-workspace-id'); + this._contextMenuId = button + .closest('toolbarbutton[zen-workspace-id]') + .getAttribute('zen-workspace-id'); const popup = button.ownerDocument.getElementById('zenWorkspaceActionsMenu'); popup.openPopup(button, 'after_end'); }).bind(browser.ZenWorkspaces) @@ -1562,7 +1655,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } isReorderModeOn(browser) { - return browser.document.getElementById('PanelUI-zen-workspaces-list').getAttribute('reorder-mode') === 'true'; + return ( + browser.document + .getElementById('PanelUI-zen-workspaces-list') + .getAttribute('reorder-mode') === 'true' + ); } toggleReorderMode() { @@ -1605,7 +1702,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (!this.workspaceEnabled) { return; } - let target = event.target.closest('.zen-current-workspace-indicator') || document.getElementById('zen-workspaces-button'); + let target = + event.target.closest('.zen-current-workspace-indicator') || + document.getElementById('zen-workspaces-button'); let panel = document.getElementById('PanelUI-zen-workspaces'); await this._propagateWorkspaceData({ ignoreStrip: true, @@ -1692,7 +1791,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { event.stopPropagation(); this.openWorkspacesDialog(event); }; - button.addEventListener('contextmenu', this._workspaceButtonContextMenuListener.bind(browser.ZenWorkspaces)); + button.addEventListener( + 'contextmenu', + this._workspaceButtonContextMenuListener.bind(browser.ZenWorkspaces) + ); } closeWorkspacesSubView() { @@ -1721,7 +1823,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { _deleteAllTabsInWorkspace(workspaceID) { gBrowser.removeTabs( Array.from(this.allStoredTabs).filter( - (tab) => tab.getAttribute('zen-workspace-id') === workspaceID && !tab.hasAttribute('zen-empty-tab') + (tab) => + tab.getAttribute('zen-workspace-id') === workspaceID && !tab.hasAttribute('zen-empty-tab') ), { animate: false, @@ -1737,8 +1840,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { moveTabsToWorkspace(tabs, workspaceID, justChangeId = false) { for (let tab of tabs) { - const parent = tab.pinned ? '#vertical-pinned-tabs-container ' : '#tabbrowser-arrowscrollbox '; - const container = document.querySelector(parent + `.zen-workspace-tabs-section[zen-workspace-id="${workspaceID}"]`); + const parent = tab.pinned + ? '#vertical-pinned-tabs-container ' + : '#tabbrowser-arrowscrollbox '; + const container = document.querySelector( + parent + `.zen-workspace-tabs-section[zen-workspace-id="${workspaceID}"]` + ); if (container?.contains(tab)) { continue; @@ -1857,7 +1964,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { this._animateTabs(this.getActiveWorkspaceFromCache(), true); } - async _performWorkspaceChange(workspace, { onInit = false, alwaysChange = false, whileScrolling = false } = {}) { + async _performWorkspaceChange( + workspace, + { onInit = false, alwaysChange = false, whileScrolling = false } = {} + ) { const previousWorkspace = await this.getActiveWorkspace(); alwaysChange = alwaysChange || onInit; this.activeWorkspace = workspace.uuid; @@ -1869,7 +1979,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const workspaces = await this._workspaces(); // Refresh tab cache - gBrowser.verticalPinnedTabsContainer = this.pinnedTabsContainer || gBrowser.verticalPinnedTabsContainer; + gBrowser.verticalPinnedTabsContainer = + this.pinnedTabsContainer || gBrowser.verticalPinnedTabsContainer; gBrowser.tabContainer.verticalPinnedTabsContainer = this.pinnedTabsContainer || gBrowser.tabContainer.verticalPinnedTabsContainer; // Move empty tab to the new workspace @@ -1886,8 +1997,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { gBrowser.warmupTab(tabToSelect); // Update UI and state - const previousWorkspaceIndex = workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid); - await this._updateWorkspaceState(workspace, onInit, tabToSelect, { previousWorkspaceIndex, previousWorkspace }); + const previousWorkspaceIndex = workspaces.workspaces.findIndex( + (w) => w.uuid === previousWorkspace.uuid + ); + await this._updateWorkspaceState(workspace, onInit, tabToSelect, { + previousWorkspaceIndex, + previousWorkspace, + }); } _moveEmptyTabToWorkspace(workspaceUuid) { @@ -1921,7 +2037,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { forAnimation = false, animateContainer = false ) { - if (arrowscrollbox && !(this._inChangingWorkspace && !forAnimation && !this._alwaysAnimateMarginTop)) { + if ( + arrowscrollbox && + !(this._inChangingWorkspace && !forAnimation && !this._alwaysAnimateMarginTop) + ) { delete this._alwaysAnimateMarginTop; const essentialsHeight = essentialContainer.getBoundingClientRect().height; workspaceIndicator.style.marginTop = essentialsHeight + 'px'; @@ -1963,12 +2082,17 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (!justMove) { this._fixIndicatorsNames(workspaces); } - const otherContainersEssentials = document.querySelectorAll(`#zen-essentials-wrapper .zen-workspace-tabs-section`); + const otherContainersEssentials = document.querySelectorAll( + `#zen-essentials-wrapper .zen-workspace-tabs-section` + ); const workspaceContextId = workspace.containerTabId; - const nextWorkspaceContextId = workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)]?.containerTabId; + const nextWorkspaceContextId = + workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)]?.containerTabId; if (this.containerSpecificEssentials && justMove) { const waitForContainers = []; - for (const element of document.querySelectorAll('.zen-workspace-tabs-section.zen-workspace-pinned-tabs-section')) { + for (const element of document.querySelectorAll( + '.zen-workspace-tabs-section.zen-workspace-pinned-tabs-section' + )) { waitForContainers.push(this.updateTabsContainers(element, true)); } await Promise.all(waitForContainers); @@ -1989,7 +2113,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { for (const container of otherContainersEssentials) { // Get the next workspace contextId, if it's the same, dont apply offsetPixels // if it's not we do apply it - if (container.getAttribute('container') != workspace.containerTabId && this.containerSpecificEssentials) { + if ( + container.getAttribute('container') != workspace.containerTabId && + this.containerSpecificEssentials + ) { container.setAttribute('hidden', 'true'); } else { container.removeAttribute('hidden'); @@ -2077,7 +2204,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } if (shouldAnimate && this.containerSpecificEssentials) { const waitForContainers = []; - for (const element of document.querySelectorAll('.zen-workspace-tabs-section.zen-workspace-pinned-tabs-section')) { + for (const element of document.querySelectorAll( + '.zen-workspace-tabs-section.zen-workspace-pinned-tabs-section' + )) { waitForContainers.push(this.updateTabsContainers(element, true)); } await Promise.all(waitForContainers); @@ -2089,7 +2218,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } const existingTransform = element.style.transform; const elementWorkspaceId = element.getAttribute('zen-workspace-id'); - const elementWorkspaceIndex = workspaces.workspaces.findIndex((w) => w.uuid === elementWorkspaceId); + const elementWorkspaceIndex = workspaces.workspaces.findIndex( + (w) => w.uuid === elementWorkspaceId + ); const offset = -(newWorkspaceIndex - elementWorkspaceIndex) * 100; const newTransform = `translateX(${offset}%)`; if (shouldAnimate) { @@ -2143,7 +2274,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { // will slide in from the right // Get the index from first and last workspace - const firstWorkspaceIndex = workspaces.workspaces.findIndex((w) => w.uuid === essentialsWorkspaces[0].uuid); + const firstWorkspaceIndex = workspaces.workspaces.findIndex( + (w) => w.uuid === essentialsWorkspaces[0].uuid + ); const lastWorkspaceIndex = workspaces.workspaces.findIndex( (w) => w.uuid === essentialsWorkspaces[essentialsWorkspaces.length - 1].uuid ); @@ -2156,7 +2289,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { container.remove(); continue; } - let stepsInBetween = Math.abs(newWorkspaceIndex - (isGoingLeft ? firstWorkspaceIndex : lastWorkspaceIndex)) + 1; + let stepsInBetween = + Math.abs(newWorkspaceIndex - (isGoingLeft ? firstWorkspaceIndex : lastWorkspaceIndex)) + + 1; const usingSameContainer = newWorkspaceEssentialsContainer.workspaces.some((w) => w.uuid === newWorkspace.uuid) && newWorkspaceEssentialsContainer.workspaces.some((w) => w.uuid === previousWorkspace.uuid); @@ -2185,7 +2320,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { existingOffset = 0; } - const needsOffsetAdjustment = stepsInBetween > essentialsWorkspaces.length || usingSameContainer; + const needsOffsetAdjustment = + stepsInBetween > essentialsWorkspaces.length || usingSameContainer; if (repeats > 0 && needsOffsetAdjustment) { if (!isGoingLeft) { @@ -2211,7 +2347,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if ( !usingSameContainer && isGoingLeft && - (firstWorkspaceIndex === newWorkspaceIndex - 1 || firstWorkspaceIndex === newWorkspaceIndex) + (firstWorkspaceIndex === newWorkspaceIndex - 1 || + firstWorkspaceIndex === newWorkspaceIndex) ) { existingOffset = -100; newOffset = 0; @@ -2234,7 +2371,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { gZenUIManager.motion.animate( container, { - transform: [existingTransform, new Array(stepsInBetween).fill(newTransform).join(',')], + transform: [ + existingTransform, + new Array(stepsInBetween).fill(newTransform).join(','), + ], }, { type: 'spring', @@ -2267,12 +2407,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } _shouldChangeToTab(aTab) { - return !(aTab?.hasAttribute('zen-essential') || (aTab?.pinned && aTab?.hasAttribute('pending'))); + return !( + aTab?.hasAttribute('zen-essential') || + (aTab?.pinned && aTab?.hasAttribute('pending')) + ); } async #shouldShowTabInCurrentWorkspace(tab) { const currentWorkspace = this.getActiveWorkspaceFromCache(); - return this._shouldShowTab(tab, currentWorkspace.uuid, currentWorkspace.containerTabId, await this._workspaces()); + return this._shouldShowTab( + tab, + currentWorkspace.uuid, + currentWorkspace.containerTabId, + await this._workspaces() + ); } _shouldShowTab(tab, workspaceUuid, containerId, workspaces) { @@ -2299,7 +2447,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return ( !tabContextId || tabContextId === '0' || - !workspaces.workspaces.some((workspace) => workspace.containerTabId === parseInt(tabContextId, 10)) + !workspaces.workspaces.some( + (workspace) => workspace.containerTabId === parseInt(tabContextId, 10) + ) ); } } @@ -2325,12 +2475,16 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { // Save current tab as last selected for old workspace if it shouldn't be visible in new workspace if (oldWorkspaceId && oldWorkspaceId !== workspace.uuid) { - this._lastSelectedWorkspaceTabs[oldWorkspaceId] = gZenGlanceManager.getTabOrGlanceParent(currentSelectedTab); + this._lastSelectedWorkspaceTabs[oldWorkspaceId] = + gZenGlanceManager.getTabOrGlanceParent(currentSelectedTab); } let tabToSelect = null; // Try last selected tab if it is visible - if (lastSelectedTab && this._shouldShowTab(lastSelectedTab, workspace.uuid, containerId, workspaces)) { + if ( + lastSelectedTab && + this._shouldShowTab(lastSelectedTab, workspace.uuid, containerId, workspaces) + ) { tabToSelect = lastSelectedTab; } // Find first suitable tab @@ -2362,7 +2516,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return tabToSelect; } - async _updateWorkspaceState(workspace, onInit, tabToSelect, { previousWorkspaceIndex, previousWorkspace } = {}) { + async _updateWorkspaceState( + workspace, + onInit, + tabToSelect, + { previousWorkspaceIndex, previousWorkspace } = {} + ) { // Update document state document.documentElement.setAttribute('zen-workspace-id', workspace.uuid); @@ -2476,7 +2635,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return window; } - async createAndSaveWorkspace(name = 'Space', icon = undefined, dontChange = false, containerTabId = 0) { + async createAndSaveWorkspace( + name = 'Space', + icon = undefined, + dontChange = false, + containerTabId = 0 + ) { if (!this.workspaceEnabled) { return; } @@ -2488,7 +2652,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { !child.hasAttribute('zen-empty-tab') && !child.hasAttribute('zen-essential') ); - let workspaceData = this._createWorkspaceData(name, icon, extraTabs, !dontChange, containerTabId); + let workspaceData = this._createWorkspaceData( + name, + icon, + extraTabs, + !dontChange, + containerTabId + ); await this.saveWorkspace(workspaceData, dontChange); if (!dontChange) { this.registerPinnedResizeObserver(); @@ -2509,7 +2679,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } // Only animate if it's from an event const animateContainer = target && target instanceof EventTarget; - await this.onPinnedTabsResize([{ target: target ?? this.pinnedTabsContainer }], forAnimation, animateContainer); + await this.onPinnedTabsResize( + [{ target: target ?? this.pinnedTabsContainer }], + forAnimation, + animateContainer + ); } updateShouldHideSeparator(arrowScrollbox, pinnedContainer) { @@ -2614,7 +2788,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } async onLocationChange(browser) { - gZenCompactModeManager.sidebar.toggleAttribute('zen-has-empty-tab', gBrowser.selectedTab.hasAttribute('zen-empty-tab')); + gZenCompactModeManager.sidebar.toggleAttribute( + 'zen-has-empty-tab', + gBrowser.selectedTab.hasAttribute('zen-empty-tab') + ); if (!this.workspaceEnabled || this._inChangingWorkspace || this._isClosingWindow) { return; } @@ -2686,8 +2863,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { gBrowser.tabContainer._invalidateCachedTabs(); } // Return the number of essentials INSIDE the pinned tabs container so we can correctly change their parent - return Array.from(this.pinnedTabsContainer.children).filter((child) => child.getAttribute('zen-essential') === 'true') - .length; + return Array.from(this.pinnedTabsContainer.children).filter( + (child) => child.getAttribute('zen-essential') === 'true' + ).length; } // Context menu management @@ -2696,7 +2874,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async updateContextMenu(_) { console.assert(this._contextMenuId, 'No context menu ID set'); document - .querySelector(`#PanelUI-zen-workspaces [zen-workspace-id="${this._contextMenuId}"] .zen-workspace-actions`) + .querySelector( + `#PanelUI-zen-workspaces [zen-workspace-id="${this._contextMenuId}"] .zen-workspace-actions` + ) .setAttribute('active', 'true'); const workspaces = await this._workspaces(); let deleteMenuItem = document.getElementById('context_zenDeleteWorkspace'); @@ -2707,13 +2887,17 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } let openMenuItem = document.getElementById('context_zenOpenWorkspace'); if ( - workspaces.workspaces.find((workspace) => workspace.uuid === this._contextMenuId && this.isWorkspaceActive(workspace)) + workspaces.workspaces.find( + (workspace) => workspace.uuid === this._contextMenuId && this.isWorkspaceActive(workspace) + ) ) { openMenuItem.setAttribute('disabled', 'true'); } else { openMenuItem.removeAttribute('disabled'); } - const openInContainerMenuItem = document.getElementById('context_zenWorkspacesOpenInContainerTab'); + const openInContainerMenuItem = document.getElementById( + 'context_zenWorkspacesOpenInContainerTab' + ); if (this.shouldShowContainers) { openInContainerMenuItem.removeAttribute('hidden'); } else { @@ -2724,7 +2908,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async contextChangeContainerTab(event) { this._organizingWorkspaceStrip = true; let workspaces = await this._workspaces(); - let workspace = workspaces.workspaces.find((workspace) => workspace.uuid === this._contextMenuId); + let workspace = workspaces.workspaces.find( + (workspace) => workspace.uuid === this._contextMenuId + ); let userContextId = parseInt(event.target.getAttribute('data-usercontextid')); workspace.containerTabId = userContextId + 0; // +0 to convert to number await this.saveWorkspace(workspace); @@ -2756,7 +2942,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async openWorkspace() { let workspaces = await this._workspaces(); - let workspace = workspaces.workspaces.find((workspace) => workspace.uuid === this._contextMenuId); + let workspace = workspaces.workspaces.find( + (workspace) => workspace.uuid === this._contextMenuId + ); await this.changeWorkspace(workspace); } @@ -2777,7 +2965,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return this._emojis; } const lazy = {}; - Services.scriptloader.loadSubScript('chrome://browser/content/zen-components/ZenEmojies.mjs', lazy); + Services.scriptloader.loadSubScript( + 'chrome://browser/content/zen-components/ZenEmojies.mjs', + lazy + ); this._emojis = lazy.zenGlobalEmojis(); return this._emojis; } @@ -2821,7 +3012,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } async changeTabWorkspace(workspaceID) { - const tabs = TabContextMenu.contextTab.multiselected ? gBrowser.selectedTabs : [TabContextMenu.contextTab]; + const tabs = TabContextMenu.contextTab.multiselected + ? gBrowser.selectedTabs + : [TabContextMenu.contextTab]; document.getElementById('tabContextMenu').hidePopup(); const previousWorkspaceID = document.documentElement.getAttribute('zen-workspace-id'); for (let tab of tabs) { @@ -2833,9 +3026,13 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } } // Make sure we select the last tab in the new workspace - this._lastSelectedWorkspaceTabs[workspaceID] = gZenGlanceManager.getTabOrGlanceParent(tabs[tabs.length - 1]); + this._lastSelectedWorkspaceTabs[workspaceID] = gZenGlanceManager.getTabOrGlanceParent( + tabs[tabs.length - 1] + ); const workspaces = await this._workspaces(); - await this.changeWorkspace(workspaces.workspaces.find((workspace) => workspace.uuid === workspaceID)); + await this.changeWorkspace( + workspaces.workspaces.find((workspace) => workspace.uuid === workspaceID) + ); } // Tab browser utilities @@ -2878,7 +3075,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const activeWorkspace = this.getActiveWorkspaceFromCache(); const activeWorkspaceUserContextId = activeWorkspace?.containerTabId; - if (fromExternal !== true && typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId) { + if ( + fromExternal !== true && + typeof userContextId !== 'undefined' && + userContextId !== activeWorkspaceUserContextId + ) { return [userContextId, false, undefined]; } return [activeWorkspaceUserContextId, true, undefined]; @@ -2890,7 +3091,10 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return this.allStoredTabs.filter( (tab) => tab.getAttribute('zen-workspace-id') !== tabWorkspaceId && - !(this.containerSpecificEssentials && tab.getAttribute('container') !== aTab.getAttribute('container')) && + !( + this.containerSpecificEssentials && + tab.getAttribute('container') !== aTab.getAttribute('container') + ) && !tab.hasAttribute('zen-empty-tab') ); } @@ -2912,7 +3116,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { let isInActiveWorkspace = false; let isInOtherWorkspace = false; - for (const [workspaceUuid, bookmarkGuids] of Object.entries(this._workspaceBookmarksCache.bookmarks)) { + for (const [workspaceUuid, bookmarkGuids] of Object.entries( + this._workspaceBookmarksCache.bookmarks + )) { if (bookmarkGuids.includes(bookmarkGuid)) { if (workspaceUuid === activeWorkspaceUuid) { isInActiveWorkspace = true; @@ -2934,9 +3140,15 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const tabs = []; // we need to go through each tab in each container - const essentialsContainer = document.querySelectorAll('#zen-essentials-wrapper .zen-workspace-tabs-section'); - let pinnedContainers = document.querySelectorAll('#vertical-pinned-tabs-container .zen-workspace-tabs-section'); - let normalContainers = document.querySelectorAll('#tabbrowser-arrowscrollbox .zen-workspace-tabs-section'); + const essentialsContainer = document.querySelectorAll( + '#zen-essentials-wrapper .zen-workspace-tabs-section' + ); + let pinnedContainers = document.querySelectorAll( + '#vertical-pinned-tabs-container .zen-workspace-tabs-section' + ); + let normalContainers = document.querySelectorAll( + '#tabbrowser-arrowscrollbox .zen-workspace-tabs-section' + ); if (!this._hasInitializedTabsStrip) { pinnedContainers = [document.getElementById('vertical-pinned-tabs-container')]; normalContainers = [this.activeWorkspaceStrip]; @@ -2973,8 +3185,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { let children = this.tabboxChildren; return children.filter((node) => node.tagName == 'tab-group'); } - const pinnedContainers = document.querySelectorAll('#vertical-pinned-tabs-container .zen-workspace-tabs-section'); - const normalContainers = document.querySelectorAll('#tabbrowser-arrowscrollbox .zen-workspace-tabs-section'); + const pinnedContainers = document.querySelectorAll( + '#vertical-pinned-tabs-container .zen-workspace-tabs-section' + ); + const normalContainers = document.querySelectorAll( + '#tabbrowser-arrowscrollbox .zen-workspace-tabs-section' + ); const containers = [...pinnedContainers, ...normalContainers]; const tabGroups = []; for (const container of containers) { @@ -2999,7 +3215,9 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get allWorkspaceTabs() { const currentWorkspace = this.activeWorkspace; return this.allStoredTabs.filter( - (tab) => tab.hasAttribute('zen-essential') || tab.getAttribute('zen-workspace-id') === currentWorkspace + (tab) => + tab.hasAttribute('zen-essential') || + tab.getAttribute('zen-workspace-id') === currentWorkspace ); } @@ -3038,7 +3256,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { const currentWorkspace = this.getActiveWorkspaceFromCache(); // Check if we need to change workspace if ( - (tab.getAttribute('zen-workspace-id') !== this.activeWorkspace && !tab.hasAttribute('zen-essential')) || + (tab.getAttribute('zen-workspace-id') !== this.activeWorkspace && + !tab.hasAttribute('zen-essential')) || (currentWorkspace.containerTabId !== parseInt(tab.parentNode.getAttribute('container')) && this.containerSpecificEssentials) ) { diff --git a/src/zen/workspaces/ZenWorkspacesStorage.mjs b/src/zen/workspaces/ZenWorkspacesStorage.mjs index 8f21547a..0265aeba 100644 --- a/src/zen/workspaces/ZenWorkspacesStorage.mjs +++ b/src/zen/workspaces/ZenWorkspacesStorage.mjs @@ -17,9 +17,11 @@ var ZenWorkspacesStorage = { }, async _ensureTable() { - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage._ensureTable', async (db) => { - // Create the main workspaces table if it doesn't exist - await db.execute(` + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage._ensureTable', + async (db) => { + // Create the main workspaces table if it doesn't exist + await db.execute(` CREATE TABLE IF NOT EXISTS zen_workspaces ( id INTEGER PRIMARY KEY, uuid TEXT UNIQUE NOT NULL, @@ -32,55 +34,60 @@ var ZenWorkspacesStorage = { ) `); - // Add new columns if they don't exist - // SQLite doesn't have a direct "ADD COLUMN IF NOT EXISTS" syntax, - // so we need to check if the columns exist first - const columns = await db.execute(`PRAGMA table_info(zen_workspaces)`); - const columnNames = columns.map((row) => row.getResultByName('name')); + // Add new columns if they don't exist + // SQLite doesn't have a direct "ADD COLUMN IF NOT EXISTS" syntax, + // so we need to check if the columns exist first + const columns = await db.execute(`PRAGMA table_info(zen_workspaces)`); + const columnNames = columns.map((row) => row.getResultByName('name')); - // Helper function to add column if it doesn't exist - const addColumnIfNotExists = async (columnName, definition) => { - if (!columnNames.includes(columnName)) { - await db.execute(`ALTER TABLE zen_workspaces ADD COLUMN ${columnName} ${definition}`); - } - }; + // Helper function to add column if it doesn't exist + const addColumnIfNotExists = async (columnName, definition) => { + if (!columnNames.includes(columnName)) { + await db.execute(`ALTER TABLE zen_workspaces ADD COLUMN ${columnName} ${definition}`); + } + }; - // Add each new column if it doesn't exist - await addColumnIfNotExists('theme_type', 'TEXT'); - await addColumnIfNotExists('theme_colors', 'TEXT'); - await addColumnIfNotExists('theme_opacity', 'REAL'); - await addColumnIfNotExists('theme_rotation', 'INTEGER'); - await addColumnIfNotExists('theme_texture', 'REAL'); + // Add each new column if it doesn't exist + await addColumnIfNotExists('theme_type', 'TEXT'); + await addColumnIfNotExists('theme_colors', 'TEXT'); + await addColumnIfNotExists('theme_opacity', 'REAL'); + await addColumnIfNotExists('theme_rotation', 'INTEGER'); + await addColumnIfNotExists('theme_texture', 'REAL'); - // Create an index on the uuid column - await db.execute(` + // Create an index on the uuid column + await db.execute(` CREATE INDEX IF NOT EXISTS idx_zen_workspaces_uuid ON zen_workspaces(uuid) `); - // Create the changes tracking table if it doesn't exist - await db.execute(` + // Create the changes tracking table if it doesn't exist + await db.execute(` CREATE TABLE IF NOT EXISTS zen_workspaces_changes ( uuid TEXT PRIMARY KEY, timestamp INTEGER NOT NULL ) `); - // Create an index on the uuid column for changes tracking table - await db.execute(` + // Create an index on the uuid column for changes tracking table + await db.execute(` CREATE INDEX IF NOT EXISTS idx_zen_workspaces_changes_uuid ON zen_workspaces_changes(uuid) `); - if (!this.lazy.Weave.Service.engineManager.get('workspaces')) { - this.lazy.Weave.Service.engineManager.register(ZenWorkspacesEngine); - await ZenWorkspacesStorage.migrateWorkspacesFromJSON(); - } + if (!this.lazy.Weave.Service.engineManager.get('workspaces')) { + this.lazy.Weave.Service.engineManager.register(ZenWorkspacesEngine); + await ZenWorkspacesStorage.migrateWorkspacesFromJSON(); + } - ZenWorkspaces._resolveDBInitialized(); - }); + ZenWorkspaces._resolveDBInitialized(); + } + ); }, async migrateWorkspacesFromJSON() { - const oldWorkspacesPath = PathUtils.join(PathUtils.profileDir, 'zen-workspaces', 'Workspaces.json'); + const oldWorkspacesPath = PathUtils.join( + PathUtils.profileDir, + 'zen-workspaces', + 'Workspaces.json' + ); if (await IOUtils.exists(oldWorkspacesPath)) { console.info('ZenWorkspacesStorage: Migrating workspaces from JSON...'); const oldWorkspaces = await IOUtils.readJSON(oldWorkspacesPath); @@ -110,23 +117,27 @@ var ZenWorkspacesStorage = { async saveWorkspace(workspace, notifyObservers = true) { const changedUUIDs = new Set(); - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.saveWorkspace', async (db) => { - await db.executeTransaction(async () => { - const now = Date.now(); + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.saveWorkspace', + async (db) => { + await db.executeTransaction(async () => { + const now = Date.now(); - let newPosition; - if ('position' in workspace && Number.isFinite(workspace.position)) { - newPosition = workspace.position; - } else { - // Get the maximum position - const maxPositionResult = await db.execute(`SELECT MAX("position") as max_position FROM zen_workspaces`); - const maxPosition = maxPositionResult[0].getResultByName('max_position') || 0; - newPosition = maxPosition + 1000; // Add a large increment to avoid frequent reordering - } + let newPosition; + if ('position' in workspace && Number.isFinite(workspace.position)) { + newPosition = workspace.position; + } else { + // Get the maximum position + const maxPositionResult = await db.execute( + `SELECT MAX("position") as max_position FROM zen_workspaces` + ); + const maxPosition = maxPositionResult[0].getResultByName('max_position') || 0; + newPosition = maxPosition + 1000; // Add a large increment to avoid frequent reordering + } - // Insert or replace the workspace - await db.executeCached( - ` + // Insert or replace the workspace + await db.executeCached( + ` INSERT OR REPLACE INTO zen_workspaces ( uuid, name, icon, container_id, created_at, updated_at, "position", theme_type, theme_colors, theme_opacity, theme_rotation, theme_texture @@ -138,38 +149,39 @@ var ZenWorkspacesStorage = { :theme_type, :theme_colors, :theme_opacity, :theme_rotation, :theme_texture ) `, - { - uuid: workspace.uuid, - name: workspace.name, - icon: workspace.icon || null, - container_id: workspace.containerTabId || null, - now, - position: newPosition, - theme_type: workspace.theme?.type || null, - theme_colors: workspace.theme ? JSON.stringify(workspace.theme.gradientColors) : null, - theme_opacity: workspace.theme?.opacity || null, - theme_rotation: workspace.theme?.rotation || null, - theme_texture: workspace.theme?.texture || null, - } - ); + { + uuid: workspace.uuid, + name: workspace.name, + icon: workspace.icon || null, + container_id: workspace.containerTabId || null, + now, + position: newPosition, + theme_type: workspace.theme?.type || null, + theme_colors: workspace.theme ? JSON.stringify(workspace.theme.gradientColors) : null, + theme_opacity: workspace.theme?.opacity || null, + theme_rotation: workspace.theme?.rotation || null, + theme_texture: workspace.theme?.texture || null, + } + ); - // Record the change - await db.execute( - ` + // Record the change + await db.execute( + ` INSERT OR REPLACE INTO zen_workspaces_changes (uuid, timestamp) VALUES (:uuid, :timestamp) `, - { - uuid: workspace.uuid, - timestamp: Math.floor(now / 1000), - } - ); + { + uuid: workspace.uuid, + timestamp: Math.floor(now / 1000), + } + ); - changedUUIDs.add(workspace.uuid); + changedUUIDs.add(workspace.uuid); - await this.updateLastChangeTimestamp(db); - }); - }); + await this.updateLastChangeTimestamp(db); + }); + } + ); if (notifyObservers) { this._notifyWorkspacesChanged('zen-workspace-updated', Array.from(changedUUIDs)); @@ -202,29 +214,32 @@ var ZenWorkspacesStorage = { async removeWorkspace(uuid, notifyObservers = true) { const changedUUIDs = [uuid]; - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.removeWorkspace', async (db) => { - await db.execute( - ` + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.removeWorkspace', + async (db) => { + await db.execute( + ` DELETE FROM zen_workspaces WHERE uuid = :uuid `, - { uuid } - ); + { uuid } + ); - // Record the removal as a change - const now = Date.now(); - await db.execute( - ` + // Record the removal as a change + const now = Date.now(); + await db.execute( + ` INSERT OR REPLACE INTO zen_workspaces_changes (uuid, timestamp) VALUES (:uuid, :timestamp) `, - { - uuid, - timestamp: Math.floor(now / 1000), - } - ); + { + uuid, + timestamp: Math.floor(now / 1000), + } + ); - await this.updateLastChangeTimestamp(db); - }); + await this.updateLastChangeTimestamp(db); + } + ); if (notifyObservers) { this._notifyWorkspacesChanged('zen-workspace-removed', changedUUIDs); @@ -232,27 +247,33 @@ var ZenWorkspacesStorage = { }, async wipeAllWorkspaces() { - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.wipeAllWorkspaces', async (db) => { - await db.execute(`DELETE FROM zen_workspaces`); - await db.execute(`DELETE FROM zen_workspaces_changes`); - await this.updateLastChangeTimestamp(db); - }); + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.wipeAllWorkspaces', + async (db) => { + await db.execute(`DELETE FROM zen_workspaces`); + await db.execute(`DELETE FROM zen_workspaces_changes`); + await this.updateLastChangeTimestamp(db); + } + ); }, async markChanged(uuid) { - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.markChanged', async (db) => { - const now = Date.now(); - await db.execute( - ` + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.markChanged', + async (db) => { + const now = Date.now(); + await db.execute( + ` INSERT OR REPLACE INTO zen_workspaces_changes (uuid, timestamp) VALUES (:uuid, :timestamp) `, - { - uuid, - timestamp: Math.floor(now / 1000), - } - ); - }); + { + uuid, + timestamp: Math.floor(now / 1000), + } + ); + } + ); }, async saveWorkspaceTheme(uuid, theme, notifyObservers = true) { @@ -303,14 +324,19 @@ var ZenWorkspacesStorage = { }, async clearChangedIDs() { - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.clearChangedIDs', async (db) => { - await db.execute(`DELETE FROM zen_workspaces_changes`); - }); + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.clearChangedIDs', + async (db) => { + await db.execute(`DELETE FROM zen_workspaces_changes`); + } + ); }, shouldReorderWorkspaces(before, current, after) { const minGap = 1; // Minimum allowed gap between positions - return (before !== null && current - before < minGap) || (after !== null && after - current < minGap); + return ( + (before !== null && current - before < minGap) || (after !== null && after - current < minGap) + ); }, async reorderAllWorkspaces(db, changedUUIDs) { @@ -356,41 +382,44 @@ var ZenWorkspacesStorage = { async updateWorkspacePositions(workspaces) { const changedUUIDs = new Set(); - await this.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspacesStorage.updateWorkspacePositions', async (db) => { - await db.executeTransaction(async () => { - const now = Date.now(); + await this.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspacesStorage.updateWorkspacePositions', + async (db) => { + await db.executeTransaction(async () => { + const now = Date.now(); - for (let i = 0; i < workspaces.length; i++) { - const workspace = workspaces[i]; - const newPosition = (i + 1) * 1000; + for (let i = 0; i < workspaces.length; i++) { + const workspace = workspaces[i]; + const newPosition = (i + 1) * 1000; - await db.execute( - ` + await db.execute( + ` UPDATE zen_workspaces SET "position" = :newPosition WHERE uuid = :uuid `, - { newPosition, uuid: workspace.uuid } - ); + { newPosition, uuid: workspace.uuid } + ); - changedUUIDs.add(workspace.uuid); + changedUUIDs.add(workspace.uuid); - // Record the change - await db.execute( - ` + // Record the change + await db.execute( + ` INSERT OR REPLACE INTO zen_workspaces_changes (uuid, timestamp) VALUES (:uuid, :timestamp) `, - { - uuid: workspace.uuid, - timestamp: Math.floor(now / 1000), - } - ); - } + { + uuid: workspace.uuid, + timestamp: Math.floor(now / 1000), + } + ); + } - await this.updateLastChangeTimestamp(db); - }); - }); + await this.updateLastChangeTimestamp(db); + }); + } + ); this._notifyWorkspacesChanged('zen-workspace-updated', Array.from(changedUUIDs)); }, @@ -403,9 +432,11 @@ var ZenWorkspaceBookmarksStorage = { }, async _ensureTable() { - await ZenWorkspacesStorage.lazy.PlacesUtils.withConnectionWrapper('ZenWorkspaceBookmarksStorage.init', async (db) => { - // Create table using GUIDs instead of IDs - await db.execute(` + await ZenWorkspacesStorage.lazy.PlacesUtils.withConnectionWrapper( + 'ZenWorkspaceBookmarksStorage.init', + async (db) => { + // Create table using GUIDs instead of IDs + await db.execute(` CREATE TABLE IF NOT EXISTS zen_bookmarks_workspaces ( id INTEGER PRIMARY KEY, bookmark_guid TEXT NOT NULL, @@ -418,14 +449,14 @@ var ZenWorkspaceBookmarksStorage = { ) `); - // Create index for fast lookups - await db.execute(` + // Create index for fast lookups + await db.execute(` CREATE INDEX IF NOT EXISTS idx_bookmarks_workspaces_lookup ON zen_bookmarks_workspaces(workspace_uuid, bookmark_guid) `); - // Add changes tracking table - await db.execute(` + // Add changes tracking table + await db.execute(` CREATE TABLE IF NOT EXISTS zen_bookmarks_workspaces_changes ( id INTEGER PRIMARY KEY, bookmark_guid TEXT NOT NULL, @@ -438,12 +469,13 @@ var ZenWorkspaceBookmarksStorage = { ) `); - // Create index for changes tracking - await db.execute(` + // Create index for changes tracking + await db.execute(` CREATE INDEX IF NOT EXISTS idx_bookmarks_workspaces_changes ON zen_bookmarks_workspaces_changes(bookmark_guid, workspace_uuid) `); - }); + } + ); }, /** diff --git a/src/zen/workspaces/ZenWorkspacesSync.mjs b/src/zen/workspaces/ZenWorkspacesSync.mjs index a546c19f..1b3765bd 100644 --- a/src/zen/workspaces/ZenWorkspacesSync.mjs +++ b/src/zen/workspaces/ZenWorkspacesSync.mjs @@ -2,10 +2,14 @@ // 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/. -var { Tracker, Store, SyncEngine } = ChromeUtils.importESModule('resource://services-sync/engines.sys.mjs'); +var { Tracker, Store, SyncEngine } = ChromeUtils.importESModule( + 'resource://services-sync/engines.sys.mjs' +); var { CryptoWrapper } = ChromeUtils.importESModule('resource://services-sync/record.sys.mjs'); var { Utils } = ChromeUtils.importESModule('resource://services-sync/util.sys.mjs'); -var { SCORE_INCREMENT_XLARGE } = ChromeUtils.importESModule('resource://services-sync/constants.sys.mjs'); +var { SCORE_INCREMENT_XLARGE } = ChromeUtils.importESModule( + 'resource://services-sync/constants.sys.mjs' +); // Define ZenWorkspaceRecord function ZenWorkspaceRecord(collection, id) { diff --git a/src/zen/workspaces/zen-gradient-generator.css b/src/zen/workspaces/zen-gradient-generator.css index 51505832..da433058 100644 --- a/src/zen/workspaces/zen-gradient-generator.css +++ b/src/zen/workspaces/zen-gradient-generator.css @@ -202,7 +202,10 @@ margin-bottom: 20px; background: var(--zen-toolbar-element-bg); - background-image: radial-gradient(light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.4)) 1px, transparent 0); + background-image: radial-gradient( + light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.4)) 1px, + transparent 0 + ); background-position: -19px -19px; background-size: 5px 5px; @@ -321,7 +324,11 @@ border: 1px solid color-mix(in srgb, var(--zen-colors-border) 50%, transparent 50%); border-radius: 50%; /* 3d effect */ - background: linear-gradient(-45deg, transparent -10%, light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1)) 110%); + background: linear-gradient( + -45deg, + transparent -10%, + light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1)) 110% + ); z-index: 2; top: 50%; left: 50%; diff --git a/src/zen/workspaces/zen-workspaces.css b/src/zen/workspaces/zen-workspaces.css index 42f806e3..89c16d3a 100644 --- a/src/zen/workspaces/zen-workspaces.css +++ b/src/zen/workspaces/zen-workspaces.css @@ -460,7 +460,8 @@ } .zen-current-workspace-indicator { - padding: calc(15px + var(--zen-toolbox-padding)) calc(4px + var(--tab-inline-padding) + var(--zen-toolbox-padding)); + padding: calc(15px + var(--zen-toolbox-padding)) + calc(4px + var(--tab-inline-padding) + var(--zen-toolbox-padding)); font-weight: 600; position: absolute; max-height: var(--zen-workspace-indicator-height);