Intent to Ship: navigateEvent.intercept()

101 views
Skip to first unread message

Nate Chapin

unread,
Jun 14, 2022, 2:25:35 PM6/14/22
to blink-dev

Contact emails

jap...@chromium.org, dom...@chromium.org


Specification

https://github.com/WICG/navigation-api/pull/235


Summary

intercept() works very similarly to the already existing navigateEvent.transitionWhile(), except that instead of taking a mandatory Promise, it takes an optional handler function. If a function is provided and it returns a promise, navigation finish will be delayed until the Promise resolves, just as transitionWhile() delays navigation finish for its Promise.


This address design problems with transitionWhile(), detailed in https://github.com/WICG/navigation-api/issues/230#issuecomment-1137891972


We will send a separate Intent to Deprecate and Remove for navigateEvent.transitionWhile().



Blink component

Blink>History


TAG review

https://github.com/w3ctag/design-reviews/issues/717


TAG review status

Issues open


Risks



Interoperability and Compatibility

Most of the compatibility risk comes from the removal of transitionWhile(), and will be discussed in that separate Intent. For those migrating to intercept(), the main risk is that web developer "handling" logic will run at a subtly different time, but per the explainer that time will actually be less buggy in the usual case.



Gecko: No signal. https://github.com/mozilla/standards-positions/issues/543 remains open as the positions request for the original API.


WebKit: No signal. https://www.mail-archive.com/webki...@lists.webkit.org/msg30257.html remains open as the positions request for the original API.


Web developers: Positive. The problem this was solving was discovered by a web developer in https://github.com/WICG/navigation-api/issues/230, and has some engagement there. The bonus of no longer having to pass an empty promise also addresses some feedback we've heard in the past.


Activation

Any developer able to use navigateEvent.transitionWhile() should find intercept() a modestly more usable substitute.



Security

None different than transitionWhile()



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None, this should work identically on all platforms.



Debuggability

Debugging should be no different than debugging transitionWhile().



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

The navigation-api/ directory makes extensive use of transitionWhile(), and we're updating it to use intercept() instead alongside implementation of intercept().



Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1336000


Estimated milestones

M105



Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5194055716700160


This intent message was generated by Chrome Platform Status.


Chris Harrelson

unread,
Jun 22, 2022, 12:23:36 PM6/22/22
to Nate Chapin, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACf%3D2LL04%2B1%2B6Ap5%3D-SoocDJYA2M8BvYai1STObqt26tduHTuw%40mail.gmail.com.

Mike Taylor

unread,
Jun 22, 2022, 12:57:41 PM6/22/22
to Chris Harrelson, Nate Chapin, blink-dev

Mike West

unread,
Jun 29, 2022, 10:48:10 AM6/29/22
to Mike Taylor, Chris Harrelson, Nate Chapin, blink-dev
Reply all
Reply to author
Forward
0 new messages