aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/node/nodeprincipal/index.html
blob: 58844aef2e0de3ea7dcea5b993d106f2d7cac456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
title: Node.nodePrincipal
slug: Web/API/Node/nodePrincipal
translation_of: Web/API/Node
translation_of_original: Web/API/Node/nodePrincipal
---
<div>
 {{APIRef}}{{Fx_minversion_header(3)}}{{Non-standard_header}}
 <p>The <code><strong>Node.nodePrincipal</strong></code> read-only property returns the {{Interface("nsIPrincipal")}} object representing current security context of the node.</p>
 <p>{{Note("This property exists on all nodes (HTML, XUL, SVG, MathML, etc.), but only if the script trying to use it has chrome privileges.")}}</p>
 <h2 id="Syntax" name="Syntax">Syntax</h2>
 <pre class="syntaxbox"><i>principalObj</i> = element.nodePrincipal
</pre>
 <h2 id="Notes" name="Notes">Notes</h2>
 <p>This property is read-only; attempting to write to it will throw an exception. In addition, this property may only be accessed from privileged code.</p>
 <h2 id="Specification" name="Specification">Specification</h2>
 <p>Not in any specification.</p>
</div>
<p> </p>