JS GetSecurityCallbacks

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_GetSecurityCallbacks
  • Revision title: JS GetSecurityCallbacks
  • Revision id: 313191
  • Created:
  • Creator: tschneidereit
  • Is current revision? Yes
  • Comment

Revision Content

{{ jsapi_minversion_header("1.8.1") }}

Configure SpiderMonkey security hooks.

Syntax

struct JSSecurityCallbacks {
    JSCheckAccessOp            checkObjectAccess;
    JSCSPEvalChecker           contentSecurityPolicyAllows; {{ Jsapi_minversion_inline("1.8.5") }}
    JSPrincipalsTranscoder     principalsTranscoder; {{ obsolete_inline("jsapi13") }}
    JSObjectPrincipalsFinder   findObjectPrincipals; {{ obsolete_inline("jsapi13") }}
};

JSSecurityCallbacks * JS_GetSecurityCallbacks(JSRuntime *rt); {{ Jsapi_minversion_inline("13") }}

JSSecurityCallbacks * JS_SetSecurityCallbacks(JSRuntime *rt, JSSecurityCallbacks *callbacks); {{ Jsapi_minversion_inline("13") }}

JSSecurityCallbacks * JS_SetContextSecurityCallbacks(JSContext *cx, JSSecurityCallbacks *callbacks); {{ obsolete_inline("jsapi13") }}

JSSecurityCallbacks * JS_GetRuntimeSecurityCallbacks(JSRuntime *rt); {{ obsolete_inline("jsapi13") }}

JSSecurityCallbacks * JS_SetRuntimeSecurityCallbacks(JSRuntime *rt, JSSecurityCallbacks *callbacks); {{ obsolete_inline("jsapi13") }}

Description

Allows the embedding to control certain aspects of JS code execution based on security settings of the global object the code is executed in.

The specifics are described in the callbacks' documentation.

{{ LXRSearch("ident", "i", "JS_GetSecurityCallbacks") }}

{{ LXRSearch("ident", "i", "JS_SetSecurityCallbacks") }}

Revision Source

<p>{{ jsapi_minversion_header("1.8.1") }}</p>
<p>Configure SpiderMonkey security hooks.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="eval">
struct <strong>JSSecurityCallbacks</strong> {
    <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/SpiderMonkey/JSAPI Reference/JSCheckAccessOp">JSCheckAccessOp</a>            <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/SpiderMonkey/JSAPI Reference/JSSecurityCallbacks.checkObjectAccess">checkObjectAccess</a>;
    <a href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSSecurityCallbacks.contentSecurityPolicyAllows" title="/en-us/SpiderMonkey/JSAPI_Reference/JSCSPEvalChecker">JSCSPEvalChecker</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSSecurityCallbacks.contentSecurityPolicyAllows" title="/en-us/SpiderMonkey/JSAPI_Reference/JSSecurityCallbacks.contentSecurityPolicyAllows">contentSecurityPolicyAllows</a>; {{ Jsapi_minversion_inline("1.8.5") }}
    <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSPrincipalsTranscoder" title="en/SpiderMonkey/JSAPI Reference/JSPrincipalsTranscoder">JSPrincipalsTranscoder</a>     <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSSecurityCallbacks.principalsTranscoder" title="en/SpiderMonkey/JSAPI Reference/JSSecurityCallbacks.principalsTranscoder">principalsTranscoder</a>; {{ obsolete_inline("jsapi13") }}
    <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSObjectPrincipalsFinder" title="en/SpiderMonkey/JSAPI Reference/JSObjectPrincipalsFinder">JSObjectPrincipalsFinder</a>   <a class="internal" href="/en-us/docs/SpiderMonkey/JSAPI_Reference/JSSecurityCallbacks.findObjectPrincipals" title="en/SpiderMonkey/JSAPI Reference/JSSecurityCallbacks.findObjectPrincipals">findObjectPrincipals</a>; {{ obsolete_inline("jsapi13") }}
};

JSSecurityCallbacks * <strong>JS_GetSecurityCallbacks</strong>(<a href="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime" title="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime">JSRuntime</a> *rt); {{ Jsapi_minversion_inline("13") }}

JSSecurityCallbacks * <strong>JS_SetSecurityCallbacks</strong>(<a href="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/SpiderMonkey/JSAPI_Reference/JSRuntime">JSRuntime</a> *rt, JSSecurityCallbacks *callbacks); {{ Jsapi_minversion_inline("13") }}

JSSecurityCallbacks * <strong>JS_SetContextSecurityCallbacks</strong>(<a href="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/SpiderMonkey/JSAPI_Reference/JSRuntime">JSContext</a> *cx, JSSecurityCallbacks *callbacks); {{ obsolete_inline("jsapi13") }}

JSSecurityCallbacks * <strong>JS_GetRuntimeSecurityCallbacks</strong>(<a href="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/SpiderMonkey/JSAPI_Reference/JSRuntime">JSRuntime</a> *rt); {{ obsolete_inline("jsapi13") }}

JSSecurityCallbacks * <strong>JS_SetRuntimeSecurityCallbacks</strong>(<a href="/en-us/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/SpiderMonkey/JSAPI_Reference/JSRuntime">JSRuntime</a> *rt, JSSecurityCallbacks *callbacks); {{ obsolete_inline("jsapi13") }}
</pre>
<h2 id="Description">Description</h2>
<p>Allows the embedding to control certain aspects of JS code execution based on security settings of the global object the code is executed in.</p>
<p>The specifics are described in the callbacks' documentation.</p>
<p>{{ LXRSearch("ident", "i", "JS_GetSecurityCallbacks") }}</p>
<p>{{ LXRSearch("ident", "i", "JS_SetSecurityCallbacks") }}</p>
Revert to this revision