Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a configuration file for chrome extension using a local script

I have a chrome extension (intended to be used by companies internally) that needs to have user specific configurations but I want to avoid the user having to do all that and have a sysadmin configure those things for them via a script.

EDIT: Basically, I just need to read from a file that sysadmin can write.

Is this in any way possible?

like image 859
Mental Zenga Avatar asked Sep 04 '25 01:09

Mental Zenga


1 Answers

You have two solutions.

First one is to ask your sysadmin to properly locate chrome's extension folder on all platforms, and edit a file in there. It might be a bit complicated if all computers at your company are not the same or use different platforms.

See: Where to find extensions installed folder for Google Chrome on Mac?

The second one, is simply to ask for the file:///* permission when you install the extension.

It will allow your extension to read files on the whole hard drive, and load the configuration file on a predetermined place.

Here is a related question: Chrome plugin reading text file on hard drive and replacing textbox content

edit: for the second solution to work, you need your users to enable "Allow access to file URLs" in chrome's config (not sure you can do that automatically)

like image 76
Eloims Avatar answered Sep 07 '25 11:09

Eloims