diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /browser/components/newtab/content-src/lib | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/newtab/content-src/lib')
-rw-r--r-- | browser/components/newtab/content-src/lib/constants.mjs (renamed from browser/components/newtab/content-src/lib/constants.js) | 2 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/detect-user-session-start.mjs (renamed from browser/components/newtab/content-src/lib/detect-user-session-start.js) | 6 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/init-store.mjs (renamed from browser/components/newtab/content-src/lib/init-store.js) | 11 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/link-menu-options.mjs (renamed from browser/components/newtab/content-src/lib/link-menu-options.js) | 2 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/perf-service.mjs (renamed from browser/components/newtab/content-src/lib/perf-service.js) | 12 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/screenshot-utils.mjs (renamed from browser/components/newtab/content-src/lib/screenshot-utils.js) | 4 | ||||
-rw-r--r-- | browser/components/newtab/content-src/lib/selectLayoutRender.mjs (renamed from browser/components/newtab/content-src/lib/selectLayoutRender.js) | 0 |
7 files changed, 19 insertions, 18 deletions
diff --git a/browser/components/newtab/content-src/lib/constants.js b/browser/components/newtab/content-src/lib/constants.mjs index 2c96160b4b..4f07a77e29 100644 --- a/browser/components/newtab/content-src/lib/constants.js +++ b/browser/components/newtab/content-src/lib/constants.mjs @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ export const IS_NEWTAB = - global.document && global.document.documentURI === "about:newtab"; + globalThis.document && globalThis.document.documentURI === "about:newtab"; export const NEWTAB_DARK_THEME = { ntp_background: { r: 42, diff --git a/browser/components/newtab/content-src/lib/detect-user-session-start.js b/browser/components/newtab/content-src/lib/detect-user-session-start.mjs index 43aa388967..d4c36efd4a 100644 --- a/browser/components/newtab/content-src/lib/detect-user-session-start.js +++ b/browser/components/newtab/content-src/lib/detect-user-session-start.mjs @@ -5,8 +5,8 @@ import { actionCreators as ac, actionTypes as at, -} from "common/Actions.sys.mjs"; -import { perfService as perfSvc } from "content-src/lib/perf-service"; +} from "../../common/Actions.mjs"; +import { perfService as perfSvc } from "./perf-service.mjs"; const VISIBLE = "visible"; const VISIBILITY_CHANGE_EVENT = "visibilitychange"; @@ -15,7 +15,7 @@ export class DetectUserSessionStart { constructor(store, options = {}) { this._store = store; // Overrides for testing - this.document = options.document || global.document; + this.document = options.document || globalThis.document; this._perfService = options.perfService || perfSvc; this._onVisibilityChange = this._onVisibilityChange.bind(this); } diff --git a/browser/components/newtab/content-src/lib/init-store.js b/browser/components/newtab/content-src/lib/init-store.mjs index f0ab2db86a..85b3b0b470 100644 --- a/browser/components/newtab/content-src/lib/init-store.js +++ b/browser/components/newtab/content-src/lib/init-store.mjs @@ -8,7 +8,10 @@ import { actionCreators as ac, actionTypes as at, actionUtils as au, -} from "common/Actions.sys.mjs"; +} from "../../common/Actions.mjs"; +// We disable import checking here as redux is installed via the npm packages +// at the newtab level, rather than in the top-level package.json. +// eslint-disable-next-line import/no-unresolved import { applyMiddleware, combineReducers, createStore } from "redux"; export const MERGE_STORE_ACTION = "NEW_TAB_INITIAL_STATE"; @@ -117,12 +120,12 @@ export function initStore(reducers, initialState) { const store = createStore( mergeStateReducer(combineReducers(reducers)), initialState, - global.RPMAddMessageListener && + globalThis.RPMAddMessageListener && applyMiddleware(rehydrationMiddleware, messageMiddleware) ); - if (global.RPMAddMessageListener) { - global.RPMAddMessageListener(INCOMING_MESSAGE_NAME, msg => { + if (globalThis.RPMAddMessageListener) { + globalThis.RPMAddMessageListener(INCOMING_MESSAGE_NAME, msg => { try { store.dispatch(msg.data); } catch (ex) { diff --git a/browser/components/newtab/content-src/lib/link-menu-options.js b/browser/components/newtab/content-src/lib/link-menu-options.mjs index 12e47259c1..f10a5e34c6 100644 --- a/browser/components/newtab/content-src/lib/link-menu-options.js +++ b/browser/components/newtab/content-src/lib/link-menu-options.mjs @@ -5,7 +5,7 @@ import { actionCreators as ac, actionTypes as at, -} from "common/Actions.sys.mjs"; +} from "../../common/Actions.mjs"; const _OpenInPrivateWindow = site => ({ id: "newtab-menu-open-new-private-window", diff --git a/browser/components/newtab/content-src/lib/perf-service.js b/browser/components/newtab/content-src/lib/perf-service.mjs index 6ea99ce877..25fc430726 100644 --- a/browser/components/newtab/content-src/lib/perf-service.js +++ b/browser/components/newtab/content-src/lib/perf-service.mjs @@ -2,8 +2,6 @@ * 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/. */ -"use strict"; - let usablePerfObj = window.performance; export function _PerfService(options) { @@ -37,8 +35,8 @@ _PerfService.prototype = { * @param {String} type eg "mark" * @return {Array} Performance* objects */ - getEntriesByName: function getEntriesByName(name, type) { - return this._perf.getEntriesByName(name, type); + getEntriesByName: function getEntriesByName(entryName, type) { + return this._perf.getEntriesByName(entryName, type); }, /** @@ -89,11 +87,11 @@ _PerfService.prototype = { * See [bug 1369303](https://bugzilla.mozilla.org/show_bug.cgi?id=1369303) * for more info. */ - getMostRecentAbsMarkStartByName(name) { - let entries = this.getEntriesByName(name, "mark"); + getMostRecentAbsMarkStartByName(entryName) { + let entries = this.getEntriesByName(entryName, "mark"); if (!entries.length) { - throw new Error(`No marks with the name ${name}`); + throw new Error(`No marks with the name ${entryName}`); } let mostRecentEntry = entries[entries.length - 1]; diff --git a/browser/components/newtab/content-src/lib/screenshot-utils.js b/browser/components/newtab/content-src/lib/screenshot-utils.mjs index 7ea93f12ae..2d1342be4f 100644 --- a/browser/components/newtab/content-src/lib/screenshot-utils.js +++ b/browser/components/newtab/content-src/lib/screenshot-utils.mjs @@ -30,7 +30,7 @@ export const ScreenshotUtils = { } if (this.isBlob(false, remoteImage)) { return { - url: global.URL.createObjectURL(remoteImage.data), + url: globalThis.URL.createObjectURL(remoteImage.data), path: remoteImage.path, }; } @@ -41,7 +41,7 @@ export const ScreenshotUtils = { // This should always be called with a local image and not a remote image. maybeRevokeBlobObjectURL(localImage) { if (this.isBlob(true, localImage)) { - global.URL.revokeObjectURL(localImage.url); + globalThis.URL.revokeObjectURL(localImage.url); } }, diff --git a/browser/components/newtab/content-src/lib/selectLayoutRender.js b/browser/components/newtab/content-src/lib/selectLayoutRender.mjs index 8ef4dd428f..8ef4dd428f 100644 --- a/browser/components/newtab/content-src/lib/selectLayoutRender.js +++ b/browser/components/newtab/content-src/lib/selectLayoutRender.mjs |