-
Notifications
You must be signed in to change notification settings - Fork 23.2k
Bug 1891478 Implementation of documentId in more extension APIs
#44491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rebloor
merged 13 commits into
mdn:main
from
rebloor:Bug-1891478-Implementation-of-documentId-in-extension-APIs
Jun 23, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2ec4972
Bug 1891478 Implementation of `documentId` in more extension APIs
rebloor 28c2557
Apply suggestions from @Rob--W
rebloor d29797d
Clarified optionality of `webNavigation.getFrame` parameters
rebloor a1d2764
List of listeners receiving `documentId` from `runtime.MessageSender`
rebloor b70809f
Add article on working with the documentId
rebloor 37ff3f2
Merge branch 'main' into Bug-1891478-Implementation-of-documentId-in-…
rebloor c8bcf35
Apply suggestions from @Rob--W
rebloor 6619900
Updates for feedback from @Rob--W and the linter
rebloor 998257e
Add article link to `parentDocumentId`
rebloor 1f6ab2d
Fix runtime.runtime typo
rebloor 9c89112
Apply suggestions from @Rob--W
rebloor 6331972
History API link and minor grammar fixes
rebloor 043ad30
Merge branch 'main' into Bug-1891478-Implementation-of-documentId-in-…
rebloor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
files/en-us/mozilla/add-ons/webextensions/api/runtime/getdocumentid/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| title: runtime.getDocumentId() | ||
| slug: Mozilla/Add-ons/WebExtensions/API/runtime/getDocumentId | ||
| page-type: webextension-api-function | ||
| browser-compat: webextensions.api.runtime.getDocumentId | ||
| sidebar: addonsidebar | ||
| --- | ||
|
|
||
| Returns the document ID of any window global or frame element. See the [Work with documentId](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_documentId) article for more information. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```js-nolint | ||
| let documentId = browser.runtime.getDocumentId( | ||
| target // object | ||
| ) | ||
| ``` | ||
|
|
||
| ### Parameters | ||
|
|
||
| - `target` | ||
| - : A {{glossary("WindowProxy")}} or a {{glossary("browsing context")}} container {{DOMxRef("Element","element")}} (iframe, frame, embed, or object) for the target frame. | ||
|
|
||
| ### Return value | ||
|
|
||
| Returns the document UUID of the target. Throws an error if the window or frame was unloaded. | ||
|
|
||
| ## Examples | ||
|
|
||
| This code gets the document IDs of the top-level frame and its child frames: | ||
|
|
||
| ```js | ||
| const documentId = browser.runtime.getDocumentId(window); | ||
| const frameDocumentId = browser.runtime.getDocumentId( | ||
| document.querySelector("iframe"), | ||
| ); | ||
| ``` | ||
|
|
||
| {{WebExtExamples}} | ||
|
|
||
| ## Browser compatibility | ||
|
|
||
| {{Compat}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.