when a user clicks on a featured snippet in Google search results, the text element is highlighted by a text fragment. The browser address looks like example.com/landing-page#:~:text=Start%20of%20fragment%20an,End%20of%20fragement.
I now want to detect with JavaScript if a user visits the page with a highlighted text.
I already tried window.location.hash and document.URL but the value after # is not part of the result.
Is that possible with pure JS?