| asrouter-message-utils.mjs |
Returns true if the Messages state has a visible message whose messageType
matches componentId.
@param {object} messagesProp - The Messages slice of Redux state ({ messageData, isVisible }).
@param {string} componentId - The messageType value to match against.
@returns {boolean}
|
2002 |
- |
| BaseContext.jsx |
|
286 |
- |
| constants.mjs |
|
1367 |
- |
| customize-panel-telemetry.mjs |
|
1059 |
- |
| detect-user-session-start.mjs |
sendEventOrAddListener - Notify immediately if the page is already visible,
or else set up a listener for when visibility changes.
This is needed for accurate session tracking for telemetry,
because tabs are pre-loaded.
|
2861 |
- |
| dwell-id.mjs |
@returns {number} an id no other link opened from this document has had
|
702 |
- |
| init-store.mjs |
A higher-order function which returns a reducer that, on MERGE_STORE action,
will return the action.data object merged into the previous state.
For all other actions, it merely calls mainReducer.
Because we want this to merge the entire state object, it's written as a
higher order function which takes the main reducer (itself often a call to
combineReducers) as a parameter.
@param {function} mainReducer reducer to call if action != MERGE_STORE_ACTION
@return {function} a reducer that, on MERGE_STORE_ACTION action,
will return the action.data object merged
into the previous state, and the result
of calling mainReducer otherwise.
|
5951 |
- |
| link-menu-options.mjs |
List of functions that return items that can be included as menu options in a
LinkMenu. All functions take the site as the first parameter, and optionally
the index of the site.
|
19667 |
- |
| panel-list-utils.jsx |
Subscribe to a panel-list's open/close lifecycle.
@param {Element|null|undefined} panelList
The <panel-list> element (e.g. a ref's `.current`). A nullish value is a
no-op, so callers don't need their own guard.
@param {object} handlers
@param {function} [handlers.onShown] Called when the panel-list opens.
@param {function} [handlers.onHidden] Called when the panel-list closes.
@returns {function} Cleanup that removes the listeners.
|
2307 |
- |
| perf-service.mjs |
Calls the underlying mark() method on the appropriate Window.performance
object to add a mark with the given name to the appropriate performance
timeline.
@param {string} name the name to give the current mark
@return {void}
|
3567 |
- |
| screenshot-utils.mjs |
List of helper functions for screenshot-based images.
There are two kinds of images:
1. Remote Image: This is the image from the main process and it refers to
the image in the React props. This can either be an object with the `data`
and `path` properties, if it is a blob, or a string, if it is a normal image.
2. Local Image: This is the image object in the content process and it refers
to the image *object* in the React component's state. All local image
objects have the `url` property, and an additional property `path`, if they
are blobs.
|
2182 |
- |
| selectLayoutRender.mjs |
A copy of the layout rows holding only the named sections. Components with no
sections left, and rows left with no components, are dropped so the caller can
tell an empty feed from a full one by the row count alone.
@param {Array} layoutRender - rows from selectLayoutRender
@param {string[]} sectionKeys - sectionKeys to keep
@returns {Array}
|
14776 |
- |
| SpaceActiveContext.jsx |
Whether the enclosing space is the active one. Impression observers only
observe while it is true, since a peeked space does not register impressions.
Observing again on activation reports what is already in view.
|
526 |
- |
| theme-picker-shown.mjs |
Tells a toolkit theme picker it is visible, which makes it record shown
telemetry. The element module loads lazily on the first open. By the time
the element is defined the panel may have closed or moved to a subpanel,
which is why the caller confirms the picker is still on screen.
|
2370 |
- |
| usePointerReorder.jsx |
Finds which slot the cursor is over, using the positions measured when the
drag started. Returns null when the cursor is in a gap between items, which
the caller treats as no change, so moving through a gap does not jump the
item to whichever slot happens to be nearest.
|
17380 |
- |
| useReorderFlip.jsx |
Framework-agnostic FLIP (First-Last-Invert-Play) reorder animator for a grid
whose tiles are repositioned by something CSS can't transition (a changed
`order`, grid placement, or DOM reordering). After the layout has changed,
`sync()` measures every `childSelector` element, snaps each back to where it
was with an instant inverse transform, then releases it so it transitions to
its new cell.
Rects are keyed by the DOM node itself, so any consumer that preserves its
nodes across a reorder (stable React keys, or a stable CSS `order`) works
with no per-item id attribute. `skipSelector` matches tiles to leave
untransformed — the one being dragged, which should track the cursor
instantly rather than be flung by its own (largest) inverse transform.
A sliding tile's transform also moves its hit-testing box, so with
dragenter-based drop detection (TopSites) a tile sliding under a still cursor
re-triggers the reorder and oscillates. The engine exposes `isAnimating()`;
such a consumer should ignore reorder events while it returns true, which
fully decouples detection from the animation.
The caller drives intent via `sync(container, { enabled, reset })`:
- `reset: true` only refreshes the baseline (measure, no animation). Used at
a drag's start so the first move animates from the tiles' current on-screen
positions rather than a stale snapshot — e.g. one captured while newtab was
preloaded offscreen, where getBoundingClientRect reports the origin.
- otherwise tiles that moved animate from the previous baseline.
getBoundingClientRect includes transforms, so in-flight transforms are
cleared before measuring — this keeps deltas correct when a drag reorders
faster than an animation can finish. The "Play" step forces a synchronous
reflow to commit the inverted state instead of waiting for rAF: a native
HTML5 drag runs a nested event loop where rAF callbacks are throttled, so an
rAF-driven release intermittently skips the transition (most visibly on slow
drags).
|
5682 |
- |
| utils.jsx |
A custom react hook that sets up an IntersectionObserver to observe a single
or list of elements and triggers a callback when the element comes into the viewport
Note: The refs used should be an array type
@function useIntersectionObserver
@param {function} callback - The function to call when an element comes into the viewport
@param {object} options - Options object passed to Intersection Observer:
https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#options
@param {boolean} [isSingle = false] Boolean if the elements are an array or single element
@returns {React.MutableRefObject} a ref containing an array of elements or single element
|
14135 |
- |
| web-notification-icon.mjs |
The proxied URL for a notification icon.
Returns null for anything that cannot be proxied, and callers then render no
icon at all rather than falling back to the origin URL — a fallback would
reintroduce the direct third-party load this exists to prevent.
@param {string} [url] The icon URL the notification carried.
@returns {?string}
|
1561 |
- |
| web-notification-match.mjs |
@param {string} url
@returns {?string} The http(s) origin, or null for other schemes / bad input.
|
2910 |
- |