There is still, however, the problem of updating the database file used by the extension. As I anticipated, trying to drop the existing data with the following line of code:
   mainDB.createStatement("drop table rulesets").execute();
I think you shouldn't be doing this at the SQL level, you should be doing it by dropping the new file into place, which it sounds like you are going to do next. Take a look at how user rulesets are implemented. The (immutable) extension files go under .mozilla/firefox/xjhfewkj.dev/extensions/[email protected]. But when the user creates new rules they go under .mozilla/firefox/xjhfewkj.dev/HTTPSEverywhereUserRules, which is modifiable.

Probably the best approach is this: Choose some directory under the profile root, say HTTPSEverywhereRulesetUpdates. At startup or when reloading rulesets, look for a rulesets.sqlite there. If not present, load the immutable copy from the extension directory. When an update is downloaded, store it in the profile root under HTTPSEverywhereRulesetUpdates. There are some extension APIs that should allow you to get the profile directory and the extension directory. I don't remember them offhand but the user rules example should show you the way.

Thanks for all your hard work on this!
_______________________________________________
HTTPS-Everywhere mailing list
[email protected]
https://lists.eff.org/mailman/listinfo/https-everywhere

Reply via email to