2007-08-15 17:43:12 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-08-15 17:43:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2008-11-02 04:13:48 -08:00
|
|
|
interface nsIPluginTag;
|
2010-09-01 18:35:06 -07:00
|
|
|
interface nsIVariant;
|
2008-11-02 04:13:48 -08:00
|
|
|
|
2014-01-14 08:54:30 -08:00
|
|
|
[scriptable, uuid(d463dfbb-89c4-4553-97af-b4fd8854e161)]
|
2007-08-15 17:43:12 -07:00
|
|
|
interface nsIBlocklistService : nsISupports
|
|
|
|
{
|
2008-11-02 04:13:48 -08:00
|
|
|
// Indicates that the item does not appear in the blocklist.
|
|
|
|
const unsigned long STATE_NOT_BLOCKED = 0;
|
|
|
|
// Indicates that the item is in the blocklist but the problem is not severe
|
|
|
|
// enough to warant forcibly blocking.
|
|
|
|
const unsigned long STATE_SOFTBLOCKED = 1;
|
|
|
|
// Indicates that the item should be blocked and never used.
|
|
|
|
const unsigned long STATE_BLOCKED = 2;
|
2009-10-02 04:26:04 -07:00
|
|
|
// Indicates that the item is considered outdated, and there is a known
|
|
|
|
// update available.
|
|
|
|
const unsigned long STATE_OUTDATED = 3;
|
2012-07-11 08:56:34 -07:00
|
|
|
// Indicates that the item is vulnerable and there is an update.
|
|
|
|
const unsigned long STATE_VULNERABLE_UPDATE_AVAILABLE = 4;
|
|
|
|
// Indicates that the item is vulnerable and there is no update.
|
|
|
|
const unsigned long STATE_VULNERABLE_NO_UPDATE = 5;
|
2008-11-02 04:13:48 -08:00
|
|
|
|
2007-08-15 17:43:12 -07:00
|
|
|
/**
|
|
|
|
* Determine if an item is blocklisted
|
2014-01-14 12:30:26 -08:00
|
|
|
* @param addon
|
|
|
|
* The addon item to be checked.
|
2007-08-15 17:43:12 -07:00
|
|
|
* @param appVersion
|
|
|
|
* The version of the application we are checking in the blocklist.
|
2008-02-29 11:06:29 -08:00
|
|
|
* If this parameter is null, the version of the running application
|
|
|
|
* is used.
|
2007-08-15 17:43:12 -07:00
|
|
|
* @param toolkitVersion
|
|
|
|
* The version of the toolkit we are checking in the blocklist.
|
2008-02-29 11:06:29 -08:00
|
|
|
* If this parameter is null, the version of the running toolkit
|
|
|
|
* is used.
|
2007-08-15 17:43:12 -07:00
|
|
|
* @returns true if the item is compatible with this version of the
|
|
|
|
* application or this version of the toolkit, false, otherwise.
|
|
|
|
*/
|
2014-01-14 12:30:26 -08:00
|
|
|
boolean isAddonBlocklisted(in jsval addon,
|
2008-11-02 04:13:48 -08:00
|
|
|
[optional] in AString appVersion,
|
|
|
|
[optional] in AString toolkitVersion);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the blocklist state of an add-on
|
|
|
|
* @param id
|
2014-01-14 12:30:26 -08:00
|
|
|
* The addon item to be checked.
|
2008-11-02 04:13:48 -08:00
|
|
|
* @param appVersion
|
|
|
|
* The version of the application we are checking in the blocklist.
|
|
|
|
* If this parameter is null, the version of the running application
|
|
|
|
* is used.
|
|
|
|
* @param toolkitVersion
|
|
|
|
* The version of the toolkit we are checking in the blocklist.
|
|
|
|
* If this parameter is null, the version of the running toolkit
|
|
|
|
* is used.
|
|
|
|
* @returns The STATE constant.
|
|
|
|
*/
|
2014-01-14 12:30:26 -08:00
|
|
|
unsigned long getAddonBlocklistState(in jsval addon,
|
2008-11-02 04:13:48 -08:00
|
|
|
[optional] in AString appVersion,
|
|
|
|
[optional] in AString toolkitVersion);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the blocklist state of a plugin
|
|
|
|
* @param plugin
|
|
|
|
* The plugin to get the state for
|
|
|
|
* @param appVersion
|
|
|
|
* The version of the application we are checking in the blocklist.
|
|
|
|
* If this parameter is null, the version of the running application
|
|
|
|
* is used.
|
|
|
|
* @param toolkitVersion
|
|
|
|
* The version of the toolkit we are checking in the blocklist.
|
|
|
|
* If this parameter is null, the version of the running toolkit
|
|
|
|
* is used.
|
|
|
|
* @returns The STATE constant.
|
|
|
|
*/
|
|
|
|
unsigned long getPluginBlocklistState(in nsIPluginTag plugin,
|
|
|
|
[optional] in AString appVersion,
|
|
|
|
[optional] in AString toolkitVersion);
|
2011-05-25 14:31:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the blocklist web page of an add-on.
|
2014-01-14 12:30:26 -08:00
|
|
|
* @param addon
|
|
|
|
* The addon item whose url is required.
|
2011-05-25 14:31:56 -07:00
|
|
|
* @returns The URL of the description page.
|
|
|
|
*/
|
2014-01-14 12:30:26 -08:00
|
|
|
AString getAddonBlocklistURL(in jsval addon,
|
2011-05-25 14:31:56 -07:00
|
|
|
[optional] in AString appVersion,
|
|
|
|
[optional] in AString toolkitVersion);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the blocklist web page of a plugin.
|
|
|
|
* @param plugin
|
|
|
|
* The blocked plugin that we are determining the web page for.
|
|
|
|
* @returns The URL of the description page.
|
|
|
|
*/
|
|
|
|
AString getPluginBlocklistURL(in nsIPluginTag plugin);
|
2007-08-15 17:43:12 -07:00
|
|
|
};
|
2010-09-01 18:35:06 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* nsIBlocklistPrompt is used, if available, by the default implementation of
|
|
|
|
* nsIBlocklistService to display a confirmation UI to the user before blocking
|
|
|
|
* extensions/plugins.
|
|
|
|
*/
|
2014-01-14 08:54:30 -08:00
|
|
|
[scriptable, uuid(ba915921-b9c0-400d-8e4f-ca1b80c5699a)]
|
2010-09-01 18:35:06 -07:00
|
|
|
interface nsIBlocklistPrompt : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Prompt the user about newly blocked addons. The prompt is then resposible
|
|
|
|
* for soft-blocking any addons that need to be afterwards
|
|
|
|
*
|
|
|
|
* @param aAddons
|
|
|
|
* An array of addons and plugins that are blocked. These are javascript
|
|
|
|
* objects with properties:
|
|
|
|
* name - the plugin or extension name,
|
|
|
|
* version - the version of the extension or plugin,
|
|
|
|
* icon - the plugin or extension icon,
|
|
|
|
* disable - can be used by the nsIBlocklistPrompt to allows users to decide
|
|
|
|
* whether a soft-blocked add-on should be disabled,
|
|
|
|
* blocked - true if the item is hard-blocked, false otherwise,
|
|
|
|
* item - the nsIPluginTag or Addon object
|
|
|
|
* @param aCount
|
|
|
|
* The number of addons
|
|
|
|
*/
|
|
|
|
void prompt([array, size_is(aCount)] in nsIVariant aAddons,
|
2012-08-22 08:56:38 -07:00
|
|
|
[optional] in uint32_t aCount);
|
2010-09-01 18:35:06 -07:00
|
|
|
};
|