-
Notifications
You must be signed in to change notification settings - Fork 44
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
Need a way to feature detect #19
Comments
I propose adding an object on |
I'm curious why I'll note that I am pretty sure you can feature detect in a roundabout way by doing something like: <span hidden id="targetTextTest">put-a-guid-here</span>
<script>
window.location = "###targetText=put-a-guid-here";
if (document.querySelector("#targetTextTest").matches(":target")) {
// feature is supported
}
</script> (Possible modifications: if we don't plan to scroll to hidden things, then just make it 0x0, or transparent. Also, clean up after the feature detection, e.g. by removing the targetText from the |
I agree, will change it.
That won't work because, to mitigate concerns around cross-origin information exfiltration, we restrict the contexts around which the directive will be activated. This includes requiring a user-gesture. It's discussed in more detail in https://github.com/WICG/ScrollToTextFragment#security but I just realized we didn't put it in the spec so I filed #46 to followup on that. |
Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af
Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#705010}
Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#705010}
…ity API, a=testonly Automatic update from web-platform-tests Update scroll to text feature detectability API Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#705010} -- wpt-commits: 084d7fc3c77c1c5d581395fa834245ed527b0664 wpt-pr: 19610
…ity API, a=testonly Automatic update from web-platform-tests Update scroll to text feature detectability API Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#705010} -- wpt-commits: 084d7fc3c77c1c5d581395fa834245ed527b0664 wpt-pr: 19610
…ity API, a=testonly Automatic update from web-platform-tests Update scroll to text feature detectability API Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokanchromium.org> Reviewed-by: David Bokan <bokanchromium.org> Cr-Commit-Position: refs/heads/master{#705010} -- wpt-commits: 084d7fc3c77c1c5d581395fa834245ed527b0664 wpt-pr: 19610 UltraBlame original commit: 627cd54b6eeac59971c7640c8f18d4238675e3d6
…ity API, a=testonly Automatic update from web-platform-tests Update scroll to text feature detectability API Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokanchromium.org> Reviewed-by: David Bokan <bokanchromium.org> Cr-Commit-Position: refs/heads/master{#705010} -- wpt-commits: 084d7fc3c77c1c5d581395fa834245ed527b0664 wpt-pr: 19610 UltraBlame original commit: 627cd54b6eeac59971c7640c8f18d4238675e3d6
…ity API, a=testonly Automatic update from web-platform-tests Update scroll to text feature detectability API Update the feature detectability API to window.location.fragmentDirective per WICG/scroll-to-text-fragment#19 Also updated web platform tests and confirmed tests pass. Bug: 1000308 Change-Id: Ib2391abe3d142d57cea61840e721ed35c81089af Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850364 Commit-Queue: David Bokan <bokanchromium.org> Reviewed-by: David Bokan <bokanchromium.org> Cr-Commit-Position: refs/heads/master{#705010} -- wpt-commits: 084d7fc3c77c1c5d581395fa834245ed527b0664 wpt-pr: 19610 UltraBlame original commit: 627cd54b6eeac59971c7640c8f18d4238675e3d6
In #15 we're discussing ways to spec the feature such that it doesn't break pages that use the hash fragment for their own purposes. If we succeed in doing that, this means that UAs implementing this feature can follow links with the
targetText
to pages that would otherwise break with a hand-crafted fragment. The canonical example from that issue is https://www.webmd.com/skin-problems-and-treatments/lice-treatment#anything.However, this would mean that a page sending a user to https://www.webmd.com/skin-problems-and-treatments/lice-treatment##targetText=sometext will load and work correctly in UAs that support the feature, but completely break the page for UAs that don't.
We should support some method of feature detection so pages can check whether adding a
targetText
has the potential to break the link and avoid adding it for UAs that don't support it.The text was updated successfully, but these errors were encountered: