-1

In the Chrome extension I am trying to write, I need to talk to a service over TLS. For this purpose, I need access to a CA cert pem file and client cert and key pem files which are on my disk.

Is any of the below possible -

  • The extension has file upload dialog for each of the file - where the user can 'upload' the pem files once during setup phase. The extension stores them in some kind of storage and uses them to talk to the service.
  • The user specifies the paths to each of the files on filesystem during setup phase and the extension reads the files from disk when needed.

I have searched on both of these alternatives. For the first one, Chrome's browser storage is not storing a file object, it also has a limit of 8KB per key where the pem contents can slightly exceed that limit. For the second approach, I don't think extensions have access to user's entire filesystem.

Any pointers on how to proceed will be really helpful!

upInCloud
  • 979
  • 2
  • 10
  • 29

1 Answers1

1

regarding your first suggestion: You could use the localStorage or the indexedDB of your background page to store the values of the files. They have a greater limit. Although I'm not quite sure, if this storage survives an update.

Regarding your second suggestion: From a chrome extension, you only have access to the Download Folder of the system via the chrome downloads api. But I haven't seen a way to create a file. So your user may have to put it there himself which may be bad ux.

I personally would try the first way first.

Good luck:)

crimbler2
  • 23
  • 7