-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Add docs for {NavigateEvent,PopStateEvent}.hasUAVisualTransition
#36705
Add docs for {NavigateEvent,PopStateEvent}.hasUAVisualTransition
#36705
Conversation
7ca90f7
to
b65b486
Compare
b65b486
to
98f3c4b
Compare
98f3c4b
to
b918c05
Compare
files/en-us/web/api/navigateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/navigateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/popstateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/popstateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
```js | ||
window.addEventListener("popstate", (event) => { | ||
// Fetch the new content | ||
const newContent = await fetchNewContent(event.destination.url, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the origin important here given the event type? The same-origin clarification was good above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argee...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean is this relevant for popstate
:
if (!event.canIntercept) {
return;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I've fixed the examplecode, as the event type is PopStateEvent
, which only supports state
and hasUAVisualTransition
properties
Co-authored-by: Brian Smith <[email protected]>
files/en-us/web/api/popstateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Brian Smith <[email protected]>
files/en-us/web/api/popstateevent/hasuavisualtransition/index.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super, ty. Once clarification open about popstate
but otherwise looking good!
Thank you, merging now 👍🏻 |
Description
https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-hasuavisualtransition
https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-popstateevent-hasuavisualtransition
https://chromestatus.com/feature/5204831477694464
https://developer.chrome.com/docs/web-platform/view-transitions/same-document?hl=zh-cn
Motivation
Additional details
Related issues and pull requests