My add-on not meet the criteria[HELP]

My add-on not meet the criteria:

  1. Add-ons need to revert changes to internal preferences when they are uninstalled or disabled

How can I fix this?

What kind of addon? Bootstrapped? SDK? WebExtension?

Add-on must unregister/disconnect observers, remove listeners, clearInterval (for setInterval), revert all built-in preferences which add-on changes, and remove its own imported modules (not imported Firefox modules), unregisterSheet; on ‘disable’ or ‘uninstall’.
https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Listening_for_load_and_unload
https://developer.mozilla.org/en-US/docs/Extensions/Common_causes_of_memory_leaks_in_extensions

@erosman, I’m doing an extension, to enable OpenTok in firefox.(https://tokbox.com/developer/guides/screen-sharing/js/#firefox-extension)
I need to use the feature screen share.
Here my code, it should be correct, right?

var pageMod = require('sdk/page-mod');
var prefsService = require('sdk/preferences/service');
var allowDomainsPrefKey = 'media.getusermedia.screensharing.allowed_domains';
var gDomains = ['*.localhost', '*.opentokscreen.com'];

exports.main = function (options) {

  if (options.loadReason !== 'startup') {
    var curPrefs = prefsService.get(allowDomainsPrefKey).replace(/\s/g, '').split(',');

    gDomains.forEach(function(domain){
      if (curPrefs.indexOf(domain) !== -1) {
        return;
      }
      curPrefs.push(domain);
    });
    prefsService.set(allowDomainsPrefKey, curPrefs.join(','));
  }
};

exports.onUnload = function (reason) {
  if (reason === 'uninstall' || reason === 'disable') {
    gDomains.forEach(function(domain){
      var curPref = prefsService.get(allowDomainsPrefKey);
      var newPref = curPref.split(',').filter((pref) => pref.trim() != domain).join(',');
      prefsService.set(allowDomainsPrefKey, newPref);
    });

  }
};

pageMod.PageMod({
  include: gDomains.map(domain => domain[0] === '*' ? domain : `https://${domain}/*`),
  contentScript: 'unsafeWindow.OTScreenSharing = cloneInto({}, unsafeWindow);'
});

Please note that since you are tracking OTScreenSharing, you would need to mention it.

Any tracking (e.g. affiliate/referral/install/uninstall/upgrade/disable/error etc) to outside sources requires clear disclosure in both the add-on description and the Privacy Policy.

I mention it in package.json:

  "id": "xxx@xxx.com",
  "title": "Gene Screen-sharing extension",
  "version": "0.0.1",
  "description": "A screen-sharing extension for Gene",
  "author": "Humberto Elias @ JayaApps",
  "main": "index.js",
  "engines": {
    "firefox": ">=38.0a1",
    "fennec": ">=38.0a1"
  },
  "license": "MIT",
  "keywords": [
    "screen-sharing"
  ]
}

It should be in addon’s description (on addon’s page) and Privacy Policy.

thx again @erosman however my addon review alert me about any configuration being inserted but are not removed after delete/disable the addon, but I not see it. Can u see anything wrong?

Which addon?

I must have expressed myself badly. The guy who did the review told me about an configuration being inserted but are not removed after delete/disable the addon

As I said… if you tell me which addon it is, I can look it up.