Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My question is about fine tuning of Chrome or Chromium browser. It have support of new generation of cookies: HTML5 LocalStorage and Databases. Some ad sites uses LocalStorage to do user tracking, some other sites uses this too. Also, chrome plugins (extensions) often uses localstorage to keep settings.

I want to disable LocalStorage&DB for all sites completely or get it in "ask user" mode. But I want to use extensions which uses LocalStorage and DB.

Is it possible?

share|improve this question
    
No. –  Sathya Jun 18 '11 at 15:24
    
I have been manually deleting content in the local storage and DB folders for a while now, I leave the extension settings, but delete the rest twice a day. –  Moab Jun 18 '11 at 17:37
1  
There is a command-line option --disable-localstorage which works but disables localstorage for extensions. –  osgx Jun 19 '11 at 9:14
    
@osgx --disable-local-storage peter.sh/experiments/chromium-command-line-switches/…, yet for some reason using this flag breaks some chrome extensions like adblock plus. –  king_julien Dec 31 '13 at 8:33
add comment

2 Answers 2

up vote 11 down vote accepted

While some resources on the Internet claims that Chrome's cookie blocking does not also block LocalStorage, I just ran a quick test and discovered that it does actually block LocalStorage, (at least in Chrome 12, the current beta version).

Just click the Wrench and choose Options (or Preferences on UNIX-like platforms), go to the Under the Hood tab, select Content Settings, and choose the Block any sites from setting data option:

chrome cookie settings

While you're there, you can select Manage Exceptions to whitelist certain sites, or All Cookies and Site Data to manage or delete existing data.

Now when you visit a site, a small icon will appear indicating cookies or LocalStorage has been blocked: cookie blocked icon screenshot

If you click on that, choose Show cookies and other site data, and select the Blocked tab, you can see what data the site tried to save and whitelist sites on a temporary or permanent basis.

blocked cookies display

share|improve this answer
4  
Blocking all cookies is a bit overkill for me. –  osgx Jun 19 '11 at 9:15
add comment

I came up with a makeshift solution (for Windows users) to block local storage and allow cookies at the same time:

  • First, delete all "http-" prefixed files from your local storage (%AppData%\Google\Chrome\User Data\Default\Local Storage). Don't delete the "chrome-" prefixed files. These are used by extensions, you'll want to keep them.
  • Right click the Local Storage folder -> Properties -> Security Tab -> Advanced
  • Select your username, click Edit, and in the permissions deny "creation of new files" (you may have to do this for all users if it doesn't work)

This will keep your extension settings while preventing new sites from creating local storage data. This is quite a brute force approach, but it does the job. You could extend this by writing a batch script to temporary enable creation of new files if a certain page doesn't work.

If you have trouble because some sites won't load at all, you could also temporarily allow web sites to create local storage files, but automatically purge them whenever you're restarting chrome. A shell script like

del http*
path_to_chrome.exe

to start chrome would do the job. You could even "whitelist" certain local storage items by setting their file attributes to hidden. This way, they won't be removed by the del command.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.