diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/window/controllers | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/window/controllers')
-rw-r--r-- | files/zh-cn/web/api/window/controllers/index.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/controllers/index.html b/files/zh-cn/web/api/window/controllers/index.html new file mode 100644 index 0000000000..972c1fd452 --- /dev/null +++ b/files/zh-cn/web/api/window/controllers/index.html @@ -0,0 +1,45 @@ +--- +title: Window.controllers +slug: Web/API/Window/controllers +tags: + - API + - HTML DOM + - NeedsCompatTable + - NeedsExample + - NeedsMarkupWork + - XUL + - 参考 + - 属性 + - 窗口 + - 非标准 +translation_of: Web/API/Window/controllers +--- +<div>{{APIRef}}{{non-standard_header}}</div> + +<p>{{domxref("Window")}} 接口的 <code><strong>controllers</strong></code> 属性返回 chorme 窗口的 XUL 控制器。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate"><var>controllers</var> = <em>window</em>.controllers +</pre> + +<ul> + <li><code>controllers</code> 是一个类型为 <a href="/en-US/docs/XULControllers"><code>XULControllers</code></a>(<a href="/en-US/docs/XPCOM_Interface_Reference/nsIControllers"><code>nsIControllers</code></a>)的对象。</li> +</ul> + +<h2 id="规范">规范</h2> + +<p>XUL-专有属性,不属于任何规范。</p> + +<div class="note"> +<p>默认情况下,窗口的控制器包含支持全局窗口命令的代码。</p> + +<p>chrome 代码可以添加控制器(与 globalOverlay.js 中的 <code>goDoCommand</code> 和 <code>goUpdateCommand</code> 函数配合使用)。</p> + +<p>然而,浏览器窗口被关闭时,我们必须手动删除这些添加的控制器,因为浏览器并不会自动完成这些操作。</p> + +<p>如果有忘记删除的控制器,则会导致错误:</p> +<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=415775">bug 415775</a>: + +<pre class="bz_comment_text notranslate" id="comment_text_0">ASSERTION: XPConnect is being called on a scope without a 'Components' property!</pre> +</div> |