LocalStorage access issue since chrome version 113.0.0

1,684 views
Skip to first unread message

Yuri Vainstain

unread,
Aug 20, 2023, 3:19:26 AM8/20/23
to Chromium Extensions
Hi all,
We have a Chrome Extension which embeds an iframe in the web page that the user is using.
The Iframe src is the application we are developing, in this application, we are using localStorage quite a lot, for managing persistence between tabs and other use cases.
Lately, we noticed that users with Chrome version above 113.0.0 started to experience an error of `can't access localStorage`. I know this error can pop up when a user blocks third-party cookies, but it's hard to believe that so many users set this toggle on in one day.

The localStorage access is under the iframe's src domain.

Does someone knows maybe which change could pop this issue? and how can we fix it?

wOxxOm

unread,
Aug 20, 2023, 4:56:25 AM8/20/23
to Chromium Extensions, Yuri Vainstain
Sounds related to storage partitioning, which is enabled since Chrome 113: "to prevent certain types of side-channel cross-site tracking, Chrome is partitioning storage and communications APIs in third-party contexts."

Per this documentation you need to add the iframe's origin to host_permissions in manifest.json.

Yuri Vainstain

unread,
Aug 20, 2023, 8:05:28 AM8/20/23
to Chromium Extensions, wOxxOm, Yuri Vainstain
Our host_permissions are ["https://*/*", "http://*/*"]
shouldn't it cover the iframe origin as well?

wOxxOm

unread,
Aug 20, 2023, 8:12:18 AM8/20/23
to Chromium Extensions, Yuri Vainstain, wOxxOm
It'd covered. So it looks like a bug in Chrome because even if the iframe origin wasn't in host permissions, the result would be a missing value but not "can't access localStorage" error - assuming this error is shown by the browser and not by your extension that displays it when it can't find the value.

Yuri Vainstain

unread,
Aug 20, 2023, 8:13:40 AM8/20/23
to Chromium Extensions, wOxxOm, Yuri Vainstain
Thanks!
So you think I should report a bug in the storage partitioning page?

wOxxOm

unread,
Aug 20, 2023, 8:17:53 AM8/20/23
to Chromium Extensions, Yuri Vainstain, wOxxOm
Reply all
Reply to author
Forward
0 new messages