Bug 252111

Summary: WebDriver reads localstorage of web extension from the wrong browser instance
Product: WebKit Reporter: Oskar <oskar.persson>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bburg, jberlin, pangle, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: All   
OS: All   

Description Oskar 2023-02-11 08:18:59 PST
When using the WebDriver through Selenium to read from the local storage of a web extension, the data is read from the wrong instance of the browser. Instead of reading from the instance created by the WebDriver, it reads from the "real" instance, instead. I have created a project showcasing the problem here: https://github.com/oskarpersson/storagebug

To reproduce:

1. Open the project in xcode and set a signing team on the extension
2. Build and run the extension and go to example.com
3. Edit test.py and change the team id of "com.oskarpersson.storagebug.Extension (H528K2VA5W)" to the id of the team you set in step 1. The id can for example be found at https://developer.apple.com/account#MembershipDetailsCard
4. Install the Selenium Python library: pip install selenium
5. Run python test.py

As you can (hopefully) see the test will go to https://webkit.org and then communicate with the extension and print out the response. Instead of printing out a list of "https://webkit.org" it will instead print out a list of "https://example.com" or whatever website you went to in step 2.
Comment 1 Oskar 2023-02-13 02:13:24 PST
I noticed that I had missed to make the repository public. This is now fixed.
Comment 2 Radar WebKit Bug Importer 2023-02-18 08:19:18 PST
<rdar://problem/105632078>