Bug 290336
| Summary: | Extension storage.onChanged API missing second callback parameter in Safari for iOS | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | marcustyphoon |
| Component: | WebKit Extensions | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | bfulgham, carlosj-webkit-bugzilla, timothy, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 18 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 18 | ||
marcustyphoon
As noted in https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/onChanged, a web extension storage listener callback registered with e.g. browser.storage.onChanged.addListener((changes, areaName) => console.log({ changes, areaName })) should have an areaName parameter with the string 'local' when triggered by e.g. browser.storage.local.set; it does in Chromium and Firefox.
I am observing, however, that the parameter is undefined.
Tested in iOS 18.1.1 in a content script in a Manifest v3 extension loaded via xcrun safari-web-extension-converter. (The extension in question is https://github.com/AprilSylph/XKit-Rewritten, though I don't have a Safari framework committed to git/specific test code.)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/147776365>
marcustyphoon
Example code: https://github.com/marcustyphoon/storage-extension-test/tree/main/src
This logs {changes: Object, areaName: "local"} in MacOS Safari 17.6 but {changes: Object, areaName: undefined} in Safari on iOS 18.1.1.
Carlos J.
Tested in iOS 18.3.1, and the areaName has been returned. Seems it has been fixed with https://github.com/WebKit/WebKit/pull/35493
Related bug: https://bugs.webkit.org/show_bug.cgi?id=281644
Brent Fulgham
*** This bug has been marked as a duplicate of bug 281644 ***
Brent Fulgham
@Carlos J. Thank you for confirming.