If localStorage throws SecurityError inside a PlaywrightCrawler page, it is not a Crawlee bug. Playwright always runs pages in a fresh incognito-like browser context, so localStorage and session state do not behave like a normal persistent window. The SecurityError specifically comes from third-party cookie blocking. Do not chase useIncognitoPages - it will not change this. Instead pass a launch flag through the crawler's launch options to relax the cookie blocking, or avoid localStorage in the page function entirely and use the crawler's own state (session pool, key-value store) to pass data between pages.

Context: Issue apify/crawlee#2259 (closed, 22 comments): a reporter found PlaywrightCrawler opening incognito contexts for Chrome and Firefox regardless of configuration, and injecting localStorage threw DOMException - Failed to read the localStorage property from Window, access denied. The useIncognitoPages option did not change it. After investigating, the reporter confirmed the incognito context is by design in Playwright-backed crawlers and the real culprit was Chrome's third-party cookie blocking setting, which makes localStorage access throw a SecurityError. The fix direction was a Chrome launch flag, not a library option.