Safari Web Extensions: storage.local.get unexpectedly returns undefined

I have noticed that storage.local.get API works differently in Safari 18 compare to other browsers and Safari 17.

browser.storage.local.set({abc: 123})
browser.storage.local.get(console.log) // {abc: 123}
browser.storage.local.get({abc: null}, console.log) // expect {abc: 123} but got undefined instead.

According to MDN, storage.local.get should work with an object with object names as keys and the default value as value.

According to Safari 18 Release notes, this may be related to a fix: 'Fixed getting an empty key from storage. (99440265) (FB11427769)'.

Answered by Frameworks Engineer in 806848022

Thank you for the bug report! We've identified the issue and have implemented a fix.

Accepted Answer

Thank you for the bug report! We've identified the issue and have implemented a fix.

Fixed in Safari 18.0.1

Safari Web Extensions: storage.local.get unexpectedly returns undefined
 
 
Q