Bug 265065 - Window scrolls back to URL hash when adding <style> element to page with Safari extension <link> stylesheet
Summary: Window scrolls back to URL hash when adding <style> element to page with Safa...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 17
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-17 13:33 PST by Jeff Johnson
Modified: 2023-11-24 13:34 PST (History)
2 users (show)

See Also:


Attachments
Sample Xcode project (325.18 KB, application/zip)
2023-11-17 13:33 PST, Jeff Johnson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Johnson 2023-11-17 13:33:47 PST
Created attachment 468658 [details]
Sample Xcode project

Steps to reproduce:
1. Unzip attached sample Safari extension project HashBug
2. Open HashBug in Xcode 15
3. Build and run
4. Open Safari Developer Settings
5. Allow unsigned extensions
6. Open Safari Extensions Settings
7. Enable HashBug Extension
8. Always Allow on Every Website
9. Open https://www.webkit.org/#posts
10. Scroll down the page to the bottom
11. Open the Safari web inspector
12. In the web inspector console, add an Inspector Style Sheet, or enter the following in the console: document.head.append(document.createElement("style"));

Expected results: The page does not scroll.

Actual results: The page scrolls back to #posts from the URL hash.
Comment 1 Radar WebKit Bug Importer 2023-11-24 13:34:15 PST
<rdar://problem/118777589>