1999-07-16 03:23:16 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-07-16 03:23:16 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-07-16 03:23:16 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-07-16 03:23:16 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1999 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-07-16 03:23:16 +04:00
|
|
|
*/
|
|
|
|
|
1999-09-08 00:40:20 +04:00
|
|
|
#include "nsISupports.idl"
|
1999-09-08 01:26:56 +04:00
|
|
|
#include "nsIPrincipal.idl"
|
1999-07-16 03:23:16 +04:00
|
|
|
|
|
|
|
interface nsIScriptContext;
|
|
|
|
interface nsIURI;
|
|
|
|
|
|
|
|
[uuid(58df5780-8006-11d2-bd91-00805f8ae3f4)]
|
|
|
|
interface nsIScriptSecurityManager : nsISupports
|
|
|
|
{
|
1999-09-15 08:05:43 +04:00
|
|
|
/**
|
|
|
|
* Checks whether the currently executing script can access the given
|
|
|
|
* property.
|
|
|
|
*
|
|
|
|
* @param cx The current active script context
|
|
|
|
* @param obj The object that is being accessed
|
1999-11-20 10:28:34 +03:00
|
|
|
* @param prop The ordinal of the property being accessed (see nsDOMPropEnums.h)
|
1999-09-15 08:05:43 +04:00
|
|
|
* @param isWrite True if write access is being attempted
|
|
|
|
* @return True if access is granted
|
|
|
|
*/
|
1999-09-01 04:54:35 +04:00
|
|
|
boolean CheckScriptAccess(in nsIScriptContext cx, in voidStar obj,
|
1999-11-20 10:28:34 +03:00
|
|
|
in long prop, in boolean isWrite);
|
1999-09-01 04:54:35 +04:00
|
|
|
|
1999-11-16 08:07:31 +03:00
|
|
|
/**
|
|
|
|
* Check that the script with context "cx" can load "uri".
|
|
|
|
*
|
|
|
|
* Will return error code NS_ERROR_DOM_BAD_URI if the load request
|
|
|
|
* should be denied.
|
|
|
|
*/
|
|
|
|
void CheckLoadURIFromScript(in nsIScriptContext cx, in nsIURI uri);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check that content from "from" can load "uri".
|
|
|
|
*
|
|
|
|
* Will return error code NS_ERROR_DOM_BAD_URI if the load request
|
|
|
|
* should be denied.
|
|
|
|
*/
|
|
|
|
void CheckLoadURI(in nsIURI from, in nsIURI uri);
|
1999-09-01 04:54:35 +04:00
|
|
|
|
1999-12-02 01:23:22 +03:00
|
|
|
/**
|
|
|
|
* Return the principal of the innermost frame of the currently
|
|
|
|
* executing script. Will return null if there is no script
|
|
|
|
* currently executing.
|
|
|
|
*/
|
1999-09-16 00:58:41 +04:00
|
|
|
nsIPrincipal GetSubjectPrincipal();
|
|
|
|
|
1999-09-01 04:54:35 +04:00
|
|
|
nsIPrincipal GetSystemPrincipal();
|
|
|
|
|
1999-11-16 08:07:31 +03:00
|
|
|
nsIPrincipal GetCodebasePrincipal(in nsIURI aURI);
|
1999-09-15 08:05:43 +04:00
|
|
|
|
1999-09-18 00:13:52 +04:00
|
|
|
boolean CanExecuteScripts(in nsIPrincipal principal);
|
|
|
|
|
|
|
|
boolean CanExecuteFunction(in voidStar jsFunction);
|
|
|
|
|
1999-10-29 02:09:03 +04:00
|
|
|
boolean IsCapabilityEnabled(in string capability);
|
|
|
|
|
|
|
|
void EnableCapability(in string capability);
|
1999-09-15 08:05:43 +04:00
|
|
|
|
1999-10-29 02:09:03 +04:00
|
|
|
void RevertCapability(in string capability);
|
1999-09-15 08:05:43 +04:00
|
|
|
|
1999-10-29 02:09:03 +04:00
|
|
|
void DisableCapability(in string capability);
|
1999-07-16 03:23:16 +04:00
|
|
|
};
|
1999-08-20 13:51:02 +04:00
|
|
|
|
1999-07-16 03:23:16 +04:00
|
|
|
%{C++
|
1999-08-20 13:51:02 +04:00
|
|
|
#define NS_SCRIPTSECURITYMANAGER_PROGID "component://netscape/scriptsecuritymanager"
|
|
|
|
#define NS_SCRIPTSECURITYMANAGER_CLASSNAME "scriptsecuritymanager"
|
1999-09-01 04:54:35 +04:00
|
|
|
%}
|