Thursday, June 26, 2025

Changing Chrome User Data location

By default, Google Chrome on Windows stores all its data in:

C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data

This folder seems to top around 2.5 GB, as I tested both in Chrome and Brave.

When digging the portable version of Brave, I found that it uses the --user-data-dir command line switch to store the data somewhere else – that’s the whole point of being portable.

This command line switch, obviously, belongs to Chromium, and so to all its derivative browsers, like Chrome itself. Therefore, you can move Chrome’s User Data folder to any location. After moving the folder itself, you just have to pass the new location via the --user-data-dir command line switch, as explained in Chromium Docs:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=D:\Stuff\ChromeUserData

This finding is also useful because it shows that the whole User Data folder can ba copied to a different computer.

I found a possible Chromium bug, however, when moving User Data to my D:\ drive. When a notification pops-up, clicking it will open another Chrome window, and this new window will point to the original User Data location. Which means native notifications are unusable.

Monday, June 23, 2025

Install PKCS#11 in Brave, Linux

As Chrome’s adoption of Manifest V3 approaches, I’ve been trying Brave more and more, even in my Android. Using it for work had me in trouble though, since unlike Firefox, it has no native support to PKCS#11 USB tokens.

After trying a few things, I gave up. But a few minutes ago I stumbled upon a website which I’ve seen before, probably when setting up Chrome, and to my surprise it worked for my Linux Mint. He uses the same SafeNet eToken 5110 I’ve got here.

modutil -dbdir sql:.pki/nssdb/ -add "eToken" -libfile /usr/lib/libeTPkcs11.so

I don’t know if it matters, but I ran the command above before installing Brave itself.

Friday, June 20, 2025

Cleaning Windows temp folder

As my SSD gets more and more stuffed, I’m searching for ways to remove the cruft from it. It’s a Windows 10 installation from 2018, which I have a feeling that it needs a fresh formatted install. But since I cannot afford that now, I just keep going.

Cleaning the temp folder manually is a cumbersome chore and also takes a lot of time. The batch script below, in the other hand, deletes all the files instantly:

@echo off

echo Cleaning temp...
cd %temp%
rmdir . /s /q

pause

A double click on the clean.bat file now can be done at any time, in no time.