0

I am completely new to Chrome extension development, but have an issue for which I didn't find an answer anywhere. Hopefully someone can help me.

We need to change a setting of the 'Zotero Connector' extension for each user. This extensions talks to the program Zotero (a reference manager) via a http port, and when running this program on an application server the port number must be unique for each user. This port number is stored in the chrome.storage and when I change it from the default I can see it via the method described here: https://stackoverflow.com/questions/11922964/how-do-i-view-the-storage-of-a-chrome-extension-ive-installed#:~:text=16-,Open%20the%20Chrome%20Devtool%20by%20clicking%20on%20the%20background%20page,local%20storage%20on%20the%20left.

My question: how can we change the value of this port number via a script running on the application server?

Dennis
  • 1
  • Assuming you don't modify the extension to support chrome.storage.managed API, it won't be easy. You'll have to start chrome with a command line switch `--remote-debugging-port=1234`, write a script in Puppeteer (or a similar utility) to connect to this port, attach to the extension's background page, and run js code like chrome.storage.local.set({port: 2222}) – wOxxOm Mar 15 '21 at 12:38
  • Could this be done in Powershell? – Dennis Mar 16 '21 at 15:04
  • Should be possible, see the [documentation for CDP](https://chromedevtools.github.io/devtools-protocol/#endpoints) and a random [ps1 example](https://github.com/AndreyRainchik/CookieMonster/blob/master/cookies.ps1). – wOxxOm Mar 16 '21 at 15:27

0 Answers0