Components.utils.isXrayWrapper 编辑
When privileged JavaScript in Gecko accesses objects belonging to less-privileged code (such as untrusted web content), it does so, by default, with "Xray vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. For example, privileged code using an Xray to a DOM object sees only the original, native version of the DOM object. Any expando properties are not visible, and if any native properties have been redefined, this has no effect.
Use this function to determine whether a given object is an Xray or not.
Syntax
boolean Components.utils.isXrayWrapper(obj);
Parameters
obj
- The object to check.
Returns
true
if the object is an Xray: false
otherwise.
Example
var isXray = Components.utils.isXrayWrapper(gBrowser.contentWindow); // true
var waived = Components.utils.waiveXrays(gBrowser.contentWindow);
isXray = Components.utils.isXrayWrapper(waived); // false
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论