Danielle
Danielle

Reputation: 880

Refresh Chrome policies programmatically?

I wrote a Chrome extension, that uses local storage.

When I open chrome://policy/ in the browser I can see my extension's data according to the its ID, however, when I change the value manually in the registry it DOES NOT get updated automatically. Instead I have to click on the "Reload policies" button.

My extension uses this data and has to be updated. How can I refresh chrome policies from my code? (As if the user would click on the "Reload policies" button.)

Thanks!

enter image description here

Upvotes: 6

Views: 5899

Answers (2)

Shadow fiend
Shadow fiend

Reputation: 753

On mac you can use these commands to make it reload chrome policy

 mv /Library/Managed\ Preferences  olddd
 mv olddd /Library/Managed\ Preferences

Upvotes: 0

shawn
shawn

Reputation: 413

For Windows, even if you're just managing the information in the registry and not via GPO, you force the updates to be reflected in Chrome with:

gpupdate /force

Note that this only works with shortened result (up to 15m after gpupdate /force) for policies with the "Dynamic Policy Refresh" (dynamic_refresh) flag.

Other policies will require a manual restart of Chrome or use of the Reload policies button at chrome://policy/.

This doesn't have an immediate response and can take 15 minutes after gpupdate is run before the changes will be observed...for those policies that support it.

Upvotes: 2

Related Questions