|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 interface nsIPluginTag; |
|
10 interface nsIVariant; |
|
11 |
|
12 [scriptable, uuid(d463dfbb-89c4-4553-97af-b4fd8854e161)] |
|
13 interface nsIBlocklistService : nsISupports |
|
14 { |
|
15 // Indicates that the item does not appear in the blocklist. |
|
16 const unsigned long STATE_NOT_BLOCKED = 0; |
|
17 // Indicates that the item is in the blocklist but the problem is not severe |
|
18 // enough to warant forcibly blocking. |
|
19 const unsigned long STATE_SOFTBLOCKED = 1; |
|
20 // Indicates that the item should be blocked and never used. |
|
21 const unsigned long STATE_BLOCKED = 2; |
|
22 // Indicates that the item is considered outdated, and there is a known |
|
23 // update available. |
|
24 const unsigned long STATE_OUTDATED = 3; |
|
25 // Indicates that the item is vulnerable and there is an update. |
|
26 const unsigned long STATE_VULNERABLE_UPDATE_AVAILABLE = 4; |
|
27 // Indicates that the item is vulnerable and there is no update. |
|
28 const unsigned long STATE_VULNERABLE_NO_UPDATE = 5; |
|
29 |
|
30 /** |
|
31 * Determine if an item is blocklisted |
|
32 * @param addon |
|
33 * The addon item to be checked. |
|
34 * @param appVersion |
|
35 * The version of the application we are checking in the blocklist. |
|
36 * If this parameter is null, the version of the running application |
|
37 * is used. |
|
38 * @param toolkitVersion |
|
39 * The version of the toolkit we are checking in the blocklist. |
|
40 * If this parameter is null, the version of the running toolkit |
|
41 * is used. |
|
42 * @returns true if the item is compatible with this version of the |
|
43 * application or this version of the toolkit, false, otherwise. |
|
44 */ |
|
45 boolean isAddonBlocklisted(in jsval addon, |
|
46 [optional] in AString appVersion, |
|
47 [optional] in AString toolkitVersion); |
|
48 |
|
49 /** |
|
50 * Determine the blocklist state of an add-on |
|
51 * @param id |
|
52 * The addon item to be checked. |
|
53 * @param appVersion |
|
54 * The version of the application we are checking in the blocklist. |
|
55 * If this parameter is null, the version of the running application |
|
56 * is used. |
|
57 * @param toolkitVersion |
|
58 * The version of the toolkit we are checking in the blocklist. |
|
59 * If this parameter is null, the version of the running toolkit |
|
60 * is used. |
|
61 * @returns The STATE constant. |
|
62 */ |
|
63 unsigned long getAddonBlocklistState(in jsval addon, |
|
64 [optional] in AString appVersion, |
|
65 [optional] in AString toolkitVersion); |
|
66 |
|
67 /** |
|
68 * Determine the blocklist state of a plugin |
|
69 * @param plugin |
|
70 * The plugin to get the state for |
|
71 * @param appVersion |
|
72 * The version of the application we are checking in the blocklist. |
|
73 * If this parameter is null, the version of the running application |
|
74 * is used. |
|
75 * @param toolkitVersion |
|
76 * The version of the toolkit we are checking in the blocklist. |
|
77 * If this parameter is null, the version of the running toolkit |
|
78 * is used. |
|
79 * @returns The STATE constant. |
|
80 */ |
|
81 unsigned long getPluginBlocklistState(in nsIPluginTag plugin, |
|
82 [optional] in AString appVersion, |
|
83 [optional] in AString toolkitVersion); |
|
84 |
|
85 /** |
|
86 * Determine the blocklist web page of an add-on. |
|
87 * @param addon |
|
88 * The addon item whose url is required. |
|
89 * @returns The URL of the description page. |
|
90 */ |
|
91 AString getAddonBlocklistURL(in jsval addon, |
|
92 [optional] in AString appVersion, |
|
93 [optional] in AString toolkitVersion); |
|
94 |
|
95 /** |
|
96 * Determine the blocklist web page of a plugin. |
|
97 * @param plugin |
|
98 * The blocked plugin that we are determining the web page for. |
|
99 * @returns The URL of the description page. |
|
100 */ |
|
101 AString getPluginBlocklistURL(in nsIPluginTag plugin); |
|
102 }; |
|
103 |
|
104 /** |
|
105 * nsIBlocklistPrompt is used, if available, by the default implementation of |
|
106 * nsIBlocklistService to display a confirmation UI to the user before blocking |
|
107 * extensions/plugins. |
|
108 */ |
|
109 [scriptable, uuid(ba915921-b9c0-400d-8e4f-ca1b80c5699a)] |
|
110 interface nsIBlocklistPrompt : nsISupports |
|
111 { |
|
112 /** |
|
113 * Prompt the user about newly blocked addons. The prompt is then resposible |
|
114 * for soft-blocking any addons that need to be afterwards |
|
115 * |
|
116 * @param aAddons |
|
117 * An array of addons and plugins that are blocked. These are javascript |
|
118 * objects with properties: |
|
119 * name - the plugin or extension name, |
|
120 * version - the version of the extension or plugin, |
|
121 * icon - the plugin or extension icon, |
|
122 * disable - can be used by the nsIBlocklistPrompt to allows users to decide |
|
123 * whether a soft-blocked add-on should be disabled, |
|
124 * blocked - true if the item is hard-blocked, false otherwise, |
|
125 * item - the nsIPluginTag or Addon object |
|
126 * @param aCount |
|
127 * The number of addons |
|
128 */ |
|
129 void prompt([array, size_is(aCount)] in nsIVariant aAddons, |
|
130 [optional] in uint32_t aCount); |
|
131 }; |