|
|
|
|
| 47 |
%} |
47 |
%} |
| 48 |
|
48 |
|
| 49 |
interface nsIURI; |
49 |
interface nsIURI; |
| 50 |
interface nsIContentSecurityPolicy; |
50 |
interface nsIContentSecurityPolicy; |
| 51 |
|
51 |
|
| 52 |
[ptr] native JSContext(JSContext); |
52 |
[ptr] native JSContext(JSContext); |
| 53 |
[ptr] native JSPrincipals(JSPrincipals); |
53 |
[ptr] native JSPrincipals(JSPrincipals); |
| 54 |
|
54 |
|
| 55 |
[scriptable, uuid(42ba6a38-d619-49ab-8248-3d247e959d5e)] |
55 |
[scriptable, uuid(825ffce8-962d-11e1-aef3-8f2b6188709b)] |
| 56 |
interface nsIPrincipal : nsISerializable |
56 |
interface nsIPrincipal : nsISerializable |
| 57 |
{ |
57 |
{ |
| 58 |
/** |
58 |
/** |
| 59 |
* Values of capabilities for each principal. Order is |
59 |
* Values of capabilities for each principal. Order is |
| 60 |
* significant: if an operation is performed on a set |
60 |
* significant: if an operation is performed on a set |
| 61 |
* of capabilities, the minimum is computed. |
61 |
* of capabilities, the minimum is computed. |
| 62 |
*/ |
62 |
*/ |
| 63 |
const short ENABLE_DENIED = 1; |
63 |
const short ENABLE_DENIED = 1; |
|
Lines 199-231
interface nsIPrincipal : nsISerializable
|
Link Here
|
|---|
|
| 199 |
*/ |
199 |
*/ |
| 200 |
boolean subsumesIgnoringDomain(in nsIPrincipal other); |
200 |
boolean subsumesIgnoringDomain(in nsIPrincipal other); |
| 201 |
|
201 |
|
| 202 |
/** |
202 |
/** |
| 203 |
* Checks whether this principal is allowed to load the network resource |
203 |
* Checks whether this principal is allowed to load the network resource |
| 204 |
* located at the given URI under the same-origin policy. This means that |
204 |
* located at the given URI under the same-origin policy. This means that |
| 205 |
* codebase principals are only allowed to load resources from the same |
205 |
* codebase principals are only allowed to load resources from the same |
| 206 |
* domain, the system principal is allowed to load anything, and null |
206 |
* domain, the system principal is allowed to load anything, and null |
| 207 |
* principals are not allowed to load anything. |
207 |
* principals are not allowed to load anything. This is changed slightly |
|
|
208 |
* by the optional flag allowIfInheritsPrincipal (which defaults to false) |
| 209 |
* which allows the load of a data: URI (which inherits the principal of |
| 210 |
* its loader) or a URI with the same principal as its loader (eg. a |
| 211 |
* Blob URI). |
| 212 |
* In these cases, with allowIfInheritsPrincipal set to true, the URI can |
| 213 |
* be loaded by a null principal. |
| 208 |
* |
214 |
* |
| 209 |
* If the load is allowed this function does nothing. If the load is not |
215 |
* If the load is allowed this function does nothing. If the load is not |
| 210 |
* allowed the function throws NS_ERROR_DOM_BAD_URI. |
216 |
* allowed the function throws NS_ERROR_DOM_BAD_URI. |
| 211 |
* |
217 |
* |
| 212 |
* NOTE: Other policies might override this, such as the Access-Control |
218 |
* NOTE: Other policies might override this, such as the Access-Control |
| 213 |
* specification. |
219 |
* specification. |
| 214 |
* NOTE: The 'domain' attribute has no effect on the behaviour of this |
220 |
* NOTE: The 'domain' attribute has no effect on the behaviour of this |
| 215 |
* function. |
221 |
* function. |
| 216 |
* |
222 |
* |
| 217 |
* |
223 |
* |
| 218 |
* @param uri The URI about to be loaded. |
224 |
* @param uri The URI about to be loaded. |
| 219 |
* @param report If true, will report a warning to the console service |
225 |
* @param report If true, will report a warning to the console service |
| 220 |
* if the load is not allowed. |
226 |
* if the load is not allowed. |
|
|
227 |
* @param allowIfInheritsPrincipal If true, the load is allowed if the |
| 228 |
* loadee inherits the principal of the |
| 229 |
* loader. |
| 221 |
* @throws NS_ERROR_DOM_BAD_URI if the load is not allowed. |
230 |
* @throws NS_ERROR_DOM_BAD_URI if the load is not allowed. |
| 222 |
*/ |
231 |
*/ |
| 223 |
void checkMayLoad(in nsIURI uri, in boolean report); |
232 |
void checkMayLoad(in nsIURI uri, in boolean report, |
|
|
233 |
in boolean allowIfInheritsPrincipal); |
| 224 |
|
234 |
|
| 225 |
/** |
235 |
/** |
| 226 |
* The subject name for the certificate. This actually identifies the |
236 |
* The subject name for the certificate. This actually identifies the |
| 227 |
* subject of the certificate. This may well not be a string that would |
237 |
* subject of the certificate. This may well not be a string that would |
| 228 |
* mean much to a typical user on its own (e.g. it may have a number of |
238 |
* mean much to a typical user on its own (e.g. it may have a number of |
| 229 |
* different names all concatenated together with some information on what |
239 |
* different names all concatenated together with some information on what |
| 230 |
* they mean in between). |
240 |
* they mean in between). |
| 231 |
* |
241 |
* |