localStorage exception in color-contribution

I’m encountering an issue with localStorage when working with incognito:

Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
at Function.e.initBackground

It looks like initBackground in packages/core/src/browser/color-application-contribution.ts is failing on access to localStorage. Since initBackground is static and invoked from frontend-application-module.ts: https://github.com/eclipse-theia/theia/blob/6798167b50e5df4682ec218294a4eb1f3817904f/packages/core/src/browser/frontend-application-module.ts#L103, I’m not sure how I can fix this.

Any suggestions?

@dberlin thank you for the discussion, based on the documentation it seems that different browsers handle incognito or private browsing differently, and may even restrict use of localStorage. Which browser were you using, and what are you trying to achieve?

thanks @vince-fugnitto, I’m using Theia in an iframe. Users working in Chrome’s incognito mode are experiencing this exception that crashes the environment.