Skip to content

webextension.api.webNavigation.onCommitted Chrome only properties#27012

Merged
rebloor merged 8 commits intomdn:mainfrom
rebloor:webextension.api.webNavigation.onCommitted-Chrome-only-properties
Oct 31, 2025
Merged

webextension.api.webNavigation.onCommitted Chrome only properties#27012
rebloor merged 8 commits intomdn:mainfrom
rebloor:webextension.api.webNavigation.onCommitted-Chrome-only-properties

Conversation

@rebloor
Copy link
Contributor

@rebloor rebloor commented Jun 9, 2025

Summary

Add details of properties added to webNavigation.onCommitted in Chrome in version 74 and 106.

Related issues

Addresses the issue raised in webNavigation.onCommitted details does not mention discrepancy with Chromium #39630 by providing clarification that these properties are only supported in Chrome.

MDN content update in mdn/content#39893

@rebloor rebloor requested a review from dotproto June 9, 2025 03:14
@rebloor rebloor self-assigned this Jun 9, 2025
@rebloor rebloor added the data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions label Jun 9, 2025
@github-actions github-actions bot added the size:m [PR only] 25-100 LoC changed label Jun 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

"__compat": {
"support": {
"chrome": {
"version_added": "106"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this value correct? Chrome's API documentation indicates that this property was added in Chrome 74. https://developer.chrome.com/docs/extensions/reference/api/webNavigation#property-onCommitted-callback-details-parentFrameId

It also looks like this property is exposed on nine Web Navigation API events in total.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's annoying, because I knew that (as you see, I even commented on it in the summary information for the PR). Exposure in the other events, I did overlook. However, only introduced in 74 in onCompleted, onDOMContentLoaded, onErrorOccurred, onHistoryStateUpdated, and onReferenceFragmentUpdated, and those are now added.

@github-actions github-actions bot added the size:l [PR only] 101-1000 LoC changed label Jun 9, 2025
@rebloor rebloor requested a review from dotproto June 9, 2025 11:57
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like Chrome added a number of other Chrome-only properties to various events and methods in the same commit in 106:

  • Methods
    • getFrame
      • arguments
        • details.documentId
      • return value
        • details.documentId
        • details.parentDocumentId
        • details.documentLifecycle
        • details.frameType
    • getAllFrames
      • return value
        • details[].documentId
        • details[].parentDocumentId
        • details[].documentLifecycle
        • details[].frameType
  • Events
    • onBeforeNavigate has parentDocumentId, documentLifecycle, and frameType
    • the following events all have documentId, parentDocumentId, documentLifecycle, and frameType
      • onDOMContentLoaded
      • onCompleted
      • onErrorOccurred
      • onReferenceFragmentUpdated
      • onHistoryStateUpdated

Additionally, several of the events on this namespace don't have information for any of their properties. I don't want to blow out the scope this PR by trying to tackle everything here, so we should create an issue to document all of the event properties on this namespace.

@rebloor, would you prefer to address the Chrome-only properties as part of this PR or as part of the "document all event properties" task? I'm good with either approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dotproto done, with the corresponding documentation updates in mdn/content#39893

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the getAllFrames() function and onReferenceFragmentUpdated event aren't included. Was that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dotproto The change is for getAllFrames() are from line 322 and onReferenceFragmentUpdated from line 1433. I double-checked everything else, and it all appears to be there.

Copy link
Contributor

Choose a reason for hiding this comment

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

My mistake. Thanks for providing the additional details.

@github-actions github-actions bot added size:xl [PR only] >1000 LoC changed and removed size:l [PR only] 101-1000 LoC changed labels Sep 15, 2025
@rebloor rebloor requested a review from dotproto September 15, 2025 17:34
@Rob--W
Copy link
Member

Rob--W commented Oct 25, 2025

@rebloor This fell through the cracks. Could you update the PR please?

This is part of the work needed for mdn/content#39630

@rebloor
Copy link
Contributor Author

rebloor commented Oct 25, 2025

@Rob--W as I noted back in September, I believe this is complete, but (@dotproto) I can't proceed until the request for change has been cleared.

Copy link
Contributor

@dotproto dotproto left a comment

Choose a reason for hiding this comment

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

LGTM :)

Copy link
Contributor

Choose a reason for hiding this comment

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

My mistake. Thanks for providing the additional details.

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

NOTE: this is not blocking the merge, feel free to merge what you have already, and create a new PR with a follow-up.

I started offering suggested edits, but stopped when I noticed that some part of the diff cannot be edited because of the way that Github hides "unmodified" lines.

Could you update all entries of documentId and parentDocumentId and set Safari's support to 18.4? It is part of https://developer.apple.com/documentation/safari-release-notes/safari-18_4-release-notes#Web-Extensions

(there are many other documentId properties that have yet to be documented on MDN and BCD - see w3c/webextensions#890 (comment) and comments below that )

@github-actions github-actions bot added size:l [PR only] 101-1000 LoC changed and removed size:xl [PR only] >1000 LoC changed labels Oct 31, 2025
@rebloor
Copy link
Contributor Author

rebloor commented Oct 31, 2025

@Rob--W I completed the relevant support information in this PR and created Safari 18.4 support for documentId #28341 to cover changes in other APIs.

@rebloor rebloor merged commit 40568a9 into mdn:main Oct 31, 2025
6 checks passed
@rebloor rebloor deleted the webextension.api.webNavigation.onCommitted-Chrome-only-properties branch October 31, 2025 17:05
@mdn-bot mdn-bot mentioned this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions size:l [PR only] 101-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants