WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
224833
[GTK] API to list all anchors aka element ids / URL fragment/hash of the current page
https://bugs.webkit.org/show_bug.cgi?id=224833
Summary
[GTK] API to list all anchors aka element ids / URL fragment/hash of the curr...
Haelwenn (lanodan) Monnier
Reported
2021-04-20 14:53:47 PDT
URL fragments: Anchors defined with the `id` (and formerly `name`) attribute in HTML, visible via `location.hash` in JavaScript. This is possible to do right now via executing code in JavaScriptCore on page loads but it would probably be more efficient* to have a proper API endpoint to list the available fragments. A use case for this would be to list fragments either in a menu or when completing the URL. *: document.anchors seems to be only for the `name` attribute and I haven't found a better solution than going through each node and checking if they have an `id` attribute
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug