1 |
|
2 |
|
3 |
|
4 |
|
5 | var domains = ["simplewebrtc.com"];
|
6 | var addon_domains = [];
|
7 | var PREF = "media.getusermedia.screensharing.allowed_domains";
|
8 |
|
9 | function startup(data, reason) {
|
10 | if (reason === APP_STARTUP) {
|
11 | return;
|
12 | }
|
13 | var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
14 | .getService(Components.interfaces.nsIPrefBranch);
|
15 | var values = prefs.getCharPref(PREF).split(',');
|
16 | domains.forEach(function (domain) {
|
17 | if (values.indexOf(domain) === -1) {
|
18 | values.push(domain);
|
19 | addon_domains.push(domain);
|
20 | }
|
21 | });
|
22 | prefs.setCharPref(PREF, values.join(','));
|
23 | }
|
24 |
|
25 | function shutdown(data, reason) {
|
26 | if (reason === APP_SHUTDOWN) {
|
27 | return;
|
28 | }
|
29 |
|
30 | var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
31 | .getService(Components.interfaces.nsIPrefBranch);
|
32 | var values = prefs.getCharPref(PREF).split(',');
|
33 | values = values.filter(function (value) {
|
34 | return addon_domains.indexOf(value) === -1;
|
35 | });
|
36 | prefs.setCharPref(PREF, values.join(','));
|
37 | }
|
38 |
|
39 | function install(data, reason) {}
|
40 |
|
41 | function uninstall(data, reason) {}
|