Will prevent use of localStorage, sessionStorage
chrome://settings/content/siteData
Settings > Privacy and security > Site settings > Additional content settings > On-device site data > Don't allow sites to save data on your device
localStorage
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
sessionStorage
Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
indexedDB.databases()
Uncaught (in promise)
Uncaught (in promise) DOMException: Failed to execute 'databases' on 'IDBFactory': Access to the IndexedDB API is denied in this context.
chrome://settings/cookies
Settings > Privacy and security > Third-party cookies > Block third-party cookies
test case
NOTE: Chrome do not allow to paste javascript:
URLs directly
Not allowed in javascript:
javascript:console.log('Cookies enabled:', navigator.cookieEnabled, 'allowed:', (() => {try {return !!document.cookie} catch { return false }})());document.cookie=`test=true; expires=${new Date(+Date.now()+1000).toUTCString()}`;
Not allowed in data:text/html
data:text/html;,<scr…ing()}`;</script>:1 Uncaught DOMException: Failed to set the 'cookie' property on 'Document': Cookies are disabled inside 'data:' URLs.
data:text/html;,<script>console.log('Cookies enabled:', navigator.cookieEnabled, 'allowed:', (() => {try {return !!document.cookie} catch { return false }})());document.cookie=`test=true; expires=${new Date(+Date.now()+1000).toUTCString()}`;</script>
chrome://settings/security
Settings > Privacy and security > Security > Enhanced protection