4

I am writing a Google Chrome extension dealing with many user-defined rules, so instead of storing those rules in localstorage, I prefer a way which I could easily import/export these rules, like in a Firefox extension. Can I do that?

Tomalak
  • 332,285
  • 67
  • 532
  • 628
Huang
  • 1,919
  • 3
  • 15
  • 11
  • 1
    Have you seen this? [Writing to local file system in Chrome extension](http://stackoverflow.com/questions/5429513/writing-to-local-file-system-in-chrome-extension) – John Dec 12 '12 at 14:38

2 Answers2

2

As far as I know Chrome extensions don't support reading or writing to disk. So no, you can't do it.

Rick van Mook
  • 2,065
  • 1
  • 12
  • 16
  • 2
    I don't think you can do that with js code. Maybe a binary extension whitch is documented in chrome api website can help you. – legendlee Jan 28 '12 at 15:17
0
  1. I am also trying to read/write from chrome extension to local disk. So far unsuccessful (it appears that for security reason chrome may never allow users to do so; I am not sure).
  2. From chrome app users can read/write to local drive (see also: http://sysmagazine.com/posts/212107/)
  3. From chrome app users can read/write to google drive (sorry lost my reference, but trust me you can do that)
  4. Using a native application (in python, for example) users can retrieve stuff from chrome extension (or probably also from chrome app) and then (of course) write to their local drive. I have not tried this approach. But according to: https://developer.chrome.com/extensions/messaging#native-messaging, I should be able to do so. There is a ready made example for you to download and try (sorry stackoverflow won't allow me to post more than 2 links).
  5. I think theoretically there should be a way to AJAX stuff from chrome extension to your local disk via a webserver/php
ric-salmon
  • 108
  • 1
  • 6