nsIDOMWindowInternal 编辑

 

dom/interfaces/base/nsIDOMWindowInternal.idlScriptable This interface is part of a chain of interfaces used to represent a window in the DOM. 66   Introduced Gecko 1.0 Deprecated Gecko 8.0 Inherits from: nsIDOMWindow Last changed in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)

 

In Gecko 8.0 this Interface was merged into the nsIDOMWindow interface.

This interface no longer has any members; it exists solely to prevent add-ons that reference it from failing completely. Add-ons should be updated to use nsIDOMWindow instead.

It provides many of the common functions used in JavaScript such as alert() or open().

Note: Because most of nsIDOMWindowInternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented. However, they are not guaranteed to document all available arguments (i.e. see window.prompt).

Method overview

 

Firefox 3.5 note

The prompt() and find() methods changed in Firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required.

 

void alert(in DOMString text)
boolean confirm(in DOMString text)
DOMString prompt([optional]in DOMString aMessage,[optional]in DOMString aInitial,[optional]in DOMString aTitle,[optional]in unsigned long aSavePassword)
void focus()
void blur()
void back()
void forward()
void home()
void stop()
void print()
void moveTo(in long xPos, in long yPos)
void moveBy(in long xDif, in long yDif)
void resizeTo(in long width, in long height)
void resizeBy(in long widthDif, in long heightDif)
void scroll(in long xScroll, in long yScroll)
nsIDOMWindow Window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">open(in DOMString url, in DOMString name, in DOMString options)
nsIDOMWindow nsISupports aExtraArgument)
void close()
void updateCommands(in DOMString action)
boolean find([optional] in DOMString str,[optional]in boolean caseSensitive,[optional]in boolean backwards,[optional]in boolean wrapAround,[optional]in boolean wholeWord,[optional]in boolean searchInFrames,[optional]in boolean showDialog)
DOMString atob(in DOMString aAsciiString)
DOMString btoa(in DOMString aBase64Data)
nsIVariant showModalDialog(in nsIVariant aArgs, [optional] in DOMString aOptions)
void postMessage(in DOMString message, in DOMString targetOrigin)

Attributes

AttributeTypeDescription
windownsIDOMWindowInternalReadonly: The window object itself.
selfnsIDOMWindowInternalReadonly: Returns an object reference to the window object.
navigatornsIDOMNavigatorReadonly: Returns a reference to the navigator object.
screennsIDOMScreenReadonly: Returns a reference to the screen object associated with the window.
historynsIDOMHistoryReadonly: Returns a reference to the History object, which provides an interface for manipulating the browser session history.
contentnsIDOMWindowReadonly: Returns a Window object for the primary content window.
prompternsIPromptReadonly:
menubarnsIDOMBarPropReadonly: Returns the menubar object, whose visibility can be toggled in the window.
toolbarnsIDOMBarPropReadonly: Returns the toolbar object, whose visibility can be toggled in the window.
locationbarnsIDOMBarPropReadonly: Returns the locationbar object, whose visibility can be toggled in the window.
personalbarnsIDOMBarPropReadonly: Returns the personalbar object, whose visibility can be toggled in the window.
statusbarnsIDOMBarPropReadonly: Returns the statusbar object, whose visibility can be toggled in the window.
directoriesnsIDOMBarPropReadonly: Returns the window directories toolbar object.
closedbooleanReadonly: This property indicates whether the referenced window is closed or not.
cryptonsIDOMCryptoReadonly: Returns the browser crypto object, which can then be used to manipulate various browser security features.
pkcs11nsIDOMPkcs11Obsolete: this property is not supported in newer versions of Firefox.
controllersnsIControllersReadonly: Returns the XUL controllers of the chrome window.
openernsIDOMWindowInternalReturns a reference to the window that opened this current window.
statusDOMStringSets the text in the status bar at the bottom of the browser or returns the previously set text.
defaultStatusDOMStringGets/sets the status bar text for the given window.
locationnsIDOMLocationReadonly: Returns a nsIDOMLocation object, which contains information about the URL of the document.
innerWidthlongWidth of the browser window.
innerHeightlongHeight of the browser window.
outerWidthlongGets the width of the outside of the browser window.
outerHeightlongGets the height of the outside of the browser window.
screenXlongThe horizontal distance of the left border of the user's browser from the left side of the screen.
screenYlongThe vertical distance of the top border of the user's browser from the top edge of the screen.
pageXOffsetlongReturns the number of pixels that the document has already been scrolled horizontally.
pageYOffsetlongReturns the number of pixels that the document has already been scrolled vertically.
scrollMaxXlongReturns the maximum number of pixels that the document can be scrolled horizontally.
scrollMaxYlongReturns the maximum number of pixels that the document can be scrolled vertically.
lengthunsigned longReadonly: Returns the number of frames in the window.
fullScreenbooleanWhether the window is displayed in full screen mode or not
frameElementnsIDOMElementReadonly: The element in which the window is embedded, or null if the window is top-level.
URLnsIDOMMozURLProperty

Readonly: A DOM URL object, which provides the window.URL.createObjectURL() and window.URL.revokeObjectURL() methods.

Note: Prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4), this attribute was part of nsIDOMWindow_2_0_BRANCH.

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:102 次

字数:18407

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文