So I added the script that hubspot provides to the bottom of my body, but in dev and prod I end up getting the following error:
[hub-http] Exception accessing local storage. DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Well, that's kind of a non-answer, as surely one of the points of incognito mode is to block third party cookies and site data.
Incognito mode is a perfectly acceptable way to browse, and it shouldn't raise javascript errors when a conditional could and should be used to check whether a particular library or object is available.
This is fixable, and I'm not sure why it's taking you so long to fix it.
I did some research on this issue today and managed to find what is casing it. I was able to find a similar issue raised on Chromium Projects: https://www.chromium.org/for-testers/bug-reporting-guidelines/uncaught-securityerror-failed-to-read-.... It looks like this might be an issue stemming from your user environment; if the browser is blocking third-party cookies and site data, it would cause an issue. That would explain why we normally can't replicate on our side. Hope this helps!
Updating settings to "Allow All Cookies" resolves the error. Unfortunately, how users configure their browser is not in our control. Adding a popup that asks users to lower their security settings before entering the website will certainly not inspire confidence. Operating a website with features that may not run correctly due to JS errors is not an operable alternative.
Hubspot, is there a way that the iframe can at least check if localStorage is readable/writable before attempting to read/write to it? And exit before causing a JS error?
This is also happening to me. Only Microsoft Edge (the new chromium version) is showing the error while other browsers are not. Super annoying when having the dev console open trying to develop our web app.
hello @yahyamousavi ! I went to the url you have there and am not seeing any errors. Is there a specific method to reproduce the issue or have you resolved it?