Reloading subscriptions programmatically
Posted: Wed Oct 12, 2016 2:19 am
Hi.
I'm developing a Firefox-based app that loads different whitelists for different users in addition to the EasyList. For example, user A has domain test.com and user B has mytest.com in their personal whitelist. When the app starts up, I use OS.File.write to write this information at the bottom of patterns.ini.
Sometimes, it works just fine, but sometimes, the changes don't seem to be noticed, even though, if I go to patterns.ini, the personal domain is present there.
However, when I look at the filter list in about:addons, the personal domain is missing.
I was wondering if there's a way I can programmatically trigger a rescan of subscriptions to pick the changes up. I was trying different events dispatched by FilterNotifier.emit(), such as filter.added and removed, subscription.updated, but it doesn't seem to work.
Any suggestions are very appreciated.
Thanks!
Luka
I'm developing a Firefox-based app that loads different whitelists for different users in addition to the EasyList. For example, user A has domain test.com and user B has mytest.com in their personal whitelist. When the app starts up, I use OS.File.write to write this information at the bottom of patterns.ini.
Sometimes, it works just fine, but sometimes, the changes don't seem to be noticed, even though, if I go to patterns.ini, the personal domain is present there.
However, when I look at the filter list in about:addons, the personal domain is missing.
I was wondering if there's a way I can programmatically trigger a rescan of subscriptions to pick the changes up. I was trying different events dispatched by FilterNotifier.emit(), such as filter.added and removed, subscription.updated, but it doesn't seem to work.
Any suggestions are very appreciated.
Thanks!
Luka