Skip to content

feat: add support for long-animation-frame script attribution - #49706

Merged
VerteDinde merged 7 commits into
mainfrom
nikwen/loaf-script-attribution
Feb 11, 2026
Merged

VerteDinde merged 7 commits into
mainfrom
nikwen/loaf-script-attribution

Conversation

@nikwen

@nikwen nikwen commented Feb 6, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Fixes #47630.

Backports https://crrev.com/c/7510894 (minus the test changes) and adds an Electron-specific test.

The change is guarded behind the AlwaysLogLOAFURL Chromium feature (--enable-features=AlwaysLogLOAFURL), which is disabled by default. Thus, the change is very low risk and safe to backport.

The backported CL makes it possible to get script attribution for long-animation-frame PerformanceObserver events in Electron apps.

long-animation-frame events can be used to debug UI freezes. Script attribution via the sourceURL attribute lets the application developer figure out which script is slow.

By default, script attribution is only available for http(s), blob, and data URLs. Electron apps use file:// or custom protocols. Hence, this feature is needed to get script attribution working in Electron apps.

Checklist

Release Notes

Notes: Added support for long-animation-frame script attribution (via --enable-features=AlwaysLogLOAFURL).


Image

@nikwen
nikwen requested a review from a team as a code owner February 6, 2026 19:59
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Feb 6, 2026
@nikwen nikwen added target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. semver/minor backwards-compatible functionality labels Feb 6, 2026
@nikwen

nikwen commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

No API review necessary. It's a backport of a Chromium CL. No API is changed on the Electron side.

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. This needs a callout in the docs since the majority cases are apps with custom protocol. Possible good home would be under https://github.com/electron/electron/blob/main/docs/api/command-line-switches.md#chromium-flags

  2. Can you add a test for the custom protocol case, you can use RemoteControlApp helper to run an isolated test with the feature enabled.

@nikwen

nikwen commented Feb 7, 2026 •

Copy link
Copy Markdown
Member Author

@deepak Thanks for the review!

I can adjust the docs.

The upstream CL has a test for the custom protocol case. (I just excluded tests from the backport.) Do we need an additional one in Electron?

@deepak1556

Copy link
Copy Markdown
Member

Yes having a test on our end would help to identify when the feature flag gets removed from upstream. The feature flag is not compile time validated on our end, so needs an integration test.

@nikwen
nikwen force-pushed the nikwen/loaf-script-attribution branch from ea630aa to 1e12528 Compare February 8, 2026 11:32
@nikwen

nikwen commented Feb 8, 2026

Copy link
Copy Markdown
Member Author

@deepak1556 PR updated.

@nikwen
nikwen requested a review from deepak1556 February 8, 2026 11:35
Comment thread docs/api/command-line-switches.md Resolved
deepak1556
deepak1556 previously approved these changes Feb 9, 2026

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@deepak1556
deepak1556 dismissed their stale review February 9, 2026 08:15

Failing tests are related

@nikwen

nikwen commented Feb 9, 2026 •

Copy link
Copy Markdown
Member Author

Sorry about the test failures! Should hopefully be fixed now.

EDIT: Looks like I'll still need to make some changes. Will do that soon. (Locally, the tests ran through fine.)

@nikwen

nikwen commented Feb 10, 2026 •

Copy link
Copy Markdown
Member Author

Looks like we ran into #32001. As a result, long-animation-frame events weren't triggered.

Edit: Tests have succeeded now with the patch.

@itsananderson itsananderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@VerteDinde
VerteDinde merged commit ce47542 into main Feb 11, 2026
60 of 61 checks passed
@release-clerk

release-clerk Bot commented Feb 11, 2026

Copy link
Copy Markdown

Release Notes Persisted

Added support for long-animation-frame script attribution (via --enable-features=AlwaysLogLOAFURL).

@trop

trop Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "39-x-y", please check out #49771

@trop

trop Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #49772

@trop trop Bot removed the target/39-x-y PR should also be added to the "39-x-y" branch. label Feb 11, 2026
@trop

trop Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #49773

@trop trop Bot added in-flight/40-x-y in-flight/41-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels Feb 11, 2026
@nikwen nikwen mentioned this pull request Feb 17, 2026
5 tasks done
@trop trop Bot added merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. and removed in-flight/40-x-y in-flight/41-x-y in-flight/39-x-y labels Feb 18, 2026
kycutler pushed a commit to kycutler/electron that referenced this pull request Feb 26, 2026
…tron#49706)

* feat: add support for `long-animation-frame` script attribution

* docs: document `AlwaysLogLOAFURL`

* chore: add test

* docs: adjust docs as per PR comment

* fix: test failures

* chore: simplify test

* fix: tests on Windows and Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-review/requested 🗳 merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. new-pr 🌱 PR opened recently semver/minor backwards-compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support long-animation-frame event script attribution for non-HTTPS source urls

6 participants