Preferences and Secure Preferences

806 views
Skip to first unread message

John

unread,
Jun 19, 2023, 5:19:51 PM6/19/23
to Chromium Extensions
Hello everyone! I'm supporting a tool that manages Chrome on several hundred PC in the corporate network. One of the features of the tool is automatic installation/uninstallation extensions. It doing it pretty straight - via configs (Preferences and Secure Preferences) modification (I will be happy to rewrite it someday, but not today).

Most Chrome on users' PC uses Secure Preferences to manage extensions. If I install Chrome in my VM, it uses Secure Preferences too. But some Chrome on user machines unexpectedly use Preferences for that purpose. Both use almost the same structure (except super_mac in Secure Preferences), but if I "inject" an extension in Preferences the same way I do it for Secure Preferences, Chrome wipes it out after the first launch :(

I've googled much but didn't get what forces Chrome to make a decision on which config file to use for extension management. The documentation has very few details about it too. I've tried copy-paste entire profiles and even Chrome (tho all users are updating regularly and use +- the last version) without success.

I'll be very grateful for any info! Thanks!

wOxxOm

unread,
Jun 20, 2023, 1:36:57 AM6/20/23
to Chromium Extensions, John
You'll have to inspect the source code of chromium. In my profile there are many differences between the two files, Secure Preferences stores each extension's state under extensions.settings tree and a hash of each extension's settings object (either from the main Prefs or from the Secure Prefs) under protection.macs.browser.extensions.settings tree. To change these you'll need to compute the corresponding hashes using the same algo from the source code of chromium.

John

unread,
Jun 20, 2023, 4:50:03 AM6/20/23
to Chromium Extensions, wOxxOm, John
Yes, I know :) The issue is secprefs on some PC may have only ~400 bytes and in fact doesn't in use and all extension data stored in prefs. I am exploring Chromium code right now but maybe there is someone who could help me take a shortcut... That's very strange behavior: the same Chrome, the same profile folder, but on my PC extensions are stored in secprefs, on the user's PC - in prefs. Maybe there's a politic that changes the default behavior...
Reply all
Reply to author
Forward
0 new messages