The browsingContext.navigate command currently has no special handling for javascript: URLs and the await a navigation logic compared to WebDriver classic. The algorithm parses the URL, creates a request, and delegates to the HTML spec's Navigate algorithm.
However, javascript: URLs have unique semantics compared to regular navigations. They execute script and may or may not result in an actual navigation depending on the return value. This can lead to unclear behavior, particularly around:
- What the
wait parameter means for a javascript: URL that doesn't produce a document
- What
url value should be returned in the NavigateResult
- Whether navigation in the result should be null
- Which navigation events (if any) should be emitted
The spec should either:
- Explicitly define how
javascript: URLs interact with the navigate algorithm, or
- Return an
invalid argument error for javascript: URLs, since script.evaluate / script.callFunction provide a more appropriate way to execute JavaScript.
The
browsingContext.navigatecommand currently has no special handling forjavascript:URLs and theawait a navigationlogic compared to WebDriver classic. The algorithm parses the URL, creates a request, and delegates to the HTML spec's Navigate algorithm.However,
javascript:URLs have unique semantics compared to regular navigations. They execute script and may or may not result in an actual navigation depending on the return value. This can lead to unclear behavior, particularly around:waitparameter means for ajavascript:URL that doesn't produce a documenturlvalue should be returned in the NavigateResultThe spec should either:
javascript:URLs interact with the navigate algorithm, orinvalid argumenterror forjavascript:URLs, sincescript.evaluate/script.callFunctionprovide a more appropriate way to execute JavaScript.