Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add integration points for WebDriver BiDi load scripts #8300

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Sep 20, 2022

These scripts are intended to run early in the Document lifecycle, before any content scripts have run. The actual running of the scripts is defined in the WebDriver BiDi specification, so HTML just needs to call to the relevant algorithm at the correct point in the document lifecycle.

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chrome: …
    • Firefox: …
    • Safari: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …

(See WHATWG Working Mode: Changes for more details.)


/document-lifecycle.html ( diff )
/document-sequences.html ( diff )
/infrastructure.html ( diff )

@jgraham jgraham changed the title Add integration pints for WebDriver BiDi load scripts Add integration points for WebDriver BiDi load scripts Sep 20, 2022
@jgraham jgraham force-pushed the webdriver_load_scripts branch from db3f039 to 962814e Compare September 20, 2022 20:59
@domenic
Copy link
Member

domenic commented Sep 28, 2022

This might be too early, for the navigation/traversal case. At the point these scripts run, there will be no DOM at all, besides the Document object. So e.g. scripts that expect the presence of document.documentElement or document.body will fail.

The DOM only gets created inside the various "page load processing model for..." sections, e.g. in the parser for HTML or for text files, or synthetically for media.

@jgraham
Copy link
Member Author

jgraham commented Dec 16, 2022

"No DOM at all apart from the Document object" is more or less what's required; if you want access to some specific part of the document to work on you can register a mutation observer or similar; it's not expected that people will directly try to do DOM manipulation in the top level script. But the hard requirement is that it runs before any script on the page (similar to Web Extensions content scripts).

@jgraham jgraham force-pushed the webdriver_load_scripts branch from 962814e to 28044ae Compare December 21, 2022 21:22
These scripts are intended to run early in the Document lifecycle,
before any content scripts have run. The actual running of the scripts
is defined in the WebDriver BiDi specification, so HTML just needs to
call to the relevant algorithm at the correct point in the document
lifecycle.
@jgraham jgraham force-pushed the webdriver_load_scripts branch from 28044ae to 6353b85 Compare December 22, 2022 11:57
@jgraham jgraham marked this pull request as ready for review December 22, 2022 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants