## Addresses #11037 ### Implement the `privacy_preferences` table for the Fleetd Chrome extension. Columns correspond to the available properties of [`chrome.privacy`](https://developer.chrome.com/docs/extensions/reference/privacy/). Chrome on mac: <img width="816" alt="Screenshot 2023-06-23 at 11 55 21 AM" src="https://github.com/fleetdm/fleet/assets/61553566/a4700749-6325-442e-acf2-c14b1c9adf8f"> Chromebook with enterprise access (actual use case):  * Chromebook w/o enterprise access: as you can see, sometimes certain APIs are not available - this error occurs because the expected API object that would have a `get` method is actually `undefined` TODO – How to handle this case given that we want to let errors bubble up to the level at which Fleet can catch them? Maybe it would be nice to catch such errors and send them up to the Fleet layer, and still allow the loop to continue to populate the columns whose APIs _are_ available. _Decision: catch API errors here to preserve functionality of the remaining columns_  - [x] Changes file - [x] Manual QA --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
Fleetd Chrome Extension
Packaging the extension
Generate a .pem file to be the key for the chrome extension.
(In parent dir) Run the following command to generate an extension.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=./fleetd-chrome --pack-extension-key=path/to/chrome.pem
Adding Chrome to Fleet
To learn how to package and add hosts to Fleet, visit: https://fleetdm.com/docs/using-fleet/adding-hosts#add-chromebooks-with-the-fleetd-chrome-extension.
Debugging
Service worker
View service worker logs in chrome://serviceworker-internals/?devtools (in production), or in chrome://extensions (only during development).
Manual Enroll
Steps 1 and 2 can be performed on your workstation. Step 3 and 4 are to be executed on the target Chromebook.
- Create your .env file:
IMPORTANT: The address in
FLEET_URLmust have a valid TLS certificate.
echo 'FLEET_URL="https://your-fleet-server.example.com"' >> .env
echo 'FLEET_ENROLL_SECRET="<your enroll secret>"' >> .env
To test with your local Fleet server, you can use ngrok:
ngrok http https://localhost:8080
- Build the "unpacked extension":
npm install && npm run build
The above command will generate an unpacked extension in ./dist.
-
Send the
./distfolder to the target Chromebook. -
In the target Chromebook, go to
chrome://settings, toggleDeveloper modeand click onLoad unpackedand select thedistfolder.