Hello,
I deployed an extension that has been approved by the reviwers, but it does not work properly when install.
The extension should edit one config parameter (‘media.getusermedia.screensharing.allowed_domains’) during install, which is not happening,
here is the code of the index.js of my extension :
var prefService = require(‘sdk/preferences/service’);
var configToReferListOfAllowedDomains = ‘media.getusermedia.screensharing.allowed_domains’;
var configToEnableScreenCapturing = ‘media.getusermedia.screensharing.enabled’;
// replace your own domains with below array
var arrayOfMyOwnDomains = [’.inpi.fr’,‘www.formation-creation-reprise-entreprise.com’,‘formation-creation-reprise-entreprise.com’,‘www.demo-formation.com’,‘demo-formation.com’,‘www.campus26.com’, ‘campus26.com’,‘abc-learning.eu’, ‘www.abc-learning.eu’, '.tree-learning.fr’, ‘.tree-learning.eu’, '.tree-learning.com’, ‘.logipro.com’, '.crea-learning.com’, ‘.agora-learning.com’, ‘www.e-ifsi-midipy.fr’,‘e-ifsi-midipy.fr’, '.alpi40.fr’];
// Patterns to match the websites that may check whether ther add-on is installed.
// See https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/util_match-pattern
var patternsOfMyDomains = [’.inpi.fr’,‘www.formation-creation-reprise-entreprise.com’,‘formation-creation-reprise-entreprise.com’,‘www.demo-formation.com’,‘demo-formation.com’,‘www.campus26.com’, ‘campus26.com’,‘abc-learning.eu’, ‘www.abc-learning.eu’, '.tree-learning.fr’, ‘.tree-learning.eu’, '.tree-learning.com’, ‘.logipro.com’, '.crea-learning.com’, ‘.agora-learning.com’, ‘www.e-ifsi-midipy.fr’,‘e-ifsi-midipy.fr’, '.alpi40.fr’];
// e.g. if 127.0.0.1 or localhost is already allowed by anyone else
var listOfSimilarAlreadyAllowedDomains = [];
// this flag is enabled by default since Firefox version 37 or 38.
// it maybe get removed in version 47-48. (As far as I can assume)
// i.e. screen capturing will always be allowed to list of allowed_domains.
prefService.set(configToEnableScreenCapturing, true);
function addMyOwnDomains() {
var existingDomains = prefService.get(configToReferListOfAllowedDomains).split(’,’);
arrayOfMyOwnDomains.forEach(function(domain) {
if (existingDomains.indexOf(domain) === -1) {
existingDomains.push(domain);
}
else if (existingDomains.indexOf(domain) !== -1) {
// Seems domain is already in the list.
// Keep it when this addon is uninstalled.
listOfSimilarAlreadyAllowedDomains.push(domain);
}
});
prefService.set(configToReferListOfAllowedDomains, existingDomains.join(’,’));
}
addMyOwnDomains();
this is the link of my extension if you want to test : https://addons.mozilla.org/fr/firefox/addon/logipro-capture-video-ecran/
Any help is appreciated