Browser

A frame which is expected to contain a view of a Web document. It is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page.

Most of the properties and methods of the browser would rarely be used and can only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document.

The browser element implements the following interfaces:

nsIAccessibleProvider  

ウェブ文書の表示を目的として用意されたフレーム。ページ履歴をもつことと、表示中のページに対する操作のためのメソッドが追加されていることを除けば iframe 要素と同様である。

browser 要素のプロパティとメソッドの多くはあまり使用されず、単にクロム URL から呼び出されるだけである。他の URL では、表示された文書を変更するには文書オブジェクトや履歴オブジェクトを使う必要がある。

browser 要素は以下のインタフェースを実装している。

nsIAccessibleProvider  

属性:

autocompleteenabled autocompletepopup autoscroll disablehistory disablesecurity
homepage src type

プロパティとメソッド:

accessible addProgressListener canGoBack canGoForward contentDocument
contentTitle contentViewerEdit contentViewerFile contentWindow currentURI
docShell documentCharsetInfo goBack goForward goHome
gotoIndex homePage loadURI loadURIWithFlags markupDocumentViewer
preferences reload reloadWithFlags removeProgressListener securityUI
sessionHistory stop webBrowserFind webNavigation webProgress

属性:

XUL Element から継承:

align
allowevents
allownegativeassertions
class
coalesceduplicatearcs
collapsed
container
containment
context
contextmenu
datasources
debug
dir
empty
equalsize
flags
flex
height
hidden
id
insertafter
insertbefore
left
maxheight
maxwidth
menu
minheight
minwidth
mousethrough
observes
ordinal
orient
pack
persist
popup
position
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width

autocompleteenabled    Firefox only

Type: boolean

Set to true to enable autocomplete of fields.

型 : boolean

true に設定すると、フィールドの自動補完が有効になる。

autocompletepopup

Type: id of popup element

The id of a popup element used to hold autocomplete results for the browser.

型 : ポップアップ要素の id

自動補完の結果をブラウザ用に保持するのに用いるポップアップ要素の id。

autoscroll    Firefox only

Type: boolean

Set to false to disable autoscroll for this browser. If this attribute is set to true or omitted, autoscroll will be enabled or depending on the user preference 'general.autoScroll'.

型 : boolean

false に設定すると、このブラウザの自動スクロールが無効になる。この属性を true にするか取り除くと、自動スクロールが有効になる、あるいはユーザ設定の 'general.autoScroll' に依存する。

disablehistory

Type: boolean

If false, an arrow button will appear on the end of the textbox which, when pressed, will open a dropdown menu of all available results. The default value is true, which will hide the dropdown button.

型 : boolean

false のとき、矢印ボタンがテキストボックスの端に表示される。これを押すと、利用可能な全結果を示すドロップダウンメニューが開く。デフォルト値は true で、ドロップダウンメニューは隠されている。

disablesecurity

Type: boolean

Set this attribute to true to disable the security UI for this browser. Leave the attribute off to enable it.

型 : boolean

この属性を true に設定すると、このブラウザのセキュリティ UI を無効にする。属性を取り除くと、有効にできる。

homepage

Type: string home page URL

This attribute allows you to set a homepage for the browser element. It does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page. You can switch to this home page using the goHome method.

型 : ホームページ URL の文字列

この属性により、browser 要素にホームページを設定することができる。これは、ユーザのブラウザのホームページとは全く関わりがない。そういうものではなく、ホームページを保持する便利なプロパティである。goHome メソッドを使ってこのホームページに切り替えることができる。

src

Type: URL

The URL of the page to appear in the browser.

型 : URL

ブラウザに表示されるページの URL。

type

Type: string

The type of browser, which can be used to set the access of the document loaded inside the browser. If this is not set, the loaded document has the same access as the window containing the .

  • content: A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it.
  • content-primary: The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a web browser, this would be the element that displays the web page. The window for the primary content can be retrieved more conveniently using 'window.content'.

型 : 文字列

ブラウザの型。ブラウザに読み込まれる文書へのアクセスを設定するのに使われる。この属性が設定されていないときは、読み込まれた文書は browser 要素を持つウィンドウと同じアクセスを持つ。

  • content: 内容用のブラウザ。ブラウザに読み込まれる内容は、その上のクロムへのアクセスが禁止されている。
  • content-primary: 内容用の主ブラウザ。ブラウザに読み込まれる内容は、その上のクロムへのアクセスが禁止されている。例えばウェブブラウザでは、ウェブページを表示する要素のことである。ウィンドウの主内容は、 'window.content' を使って簡単に得ることができる。

プロパティとメソッド:

XUL Element から継承:

align
allowEvents
blur
boxObject
boxObject.element
boxObject.getLookAndFeelMetric
boxObject.height
boxObject.screenX
boxObject.screenY
boxObject.width
boxObject.x
boxObject.y
builder
className
click
collapsed
contextMenu
controllers
database
datasources
dir
doCommand
flex
focus
getElementsByAttribute
height
hidden
id
left
maxHeight
maxWidth
menu
minHeight
minWidth
observes
ordinal
orient
pack
persist
ref
resource
statusText
style
tooltip
tooltipText
top
width

Element から継承:

addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName

accessible

Type: nsIAccessible

Returns the accessibility object for the browser.

型 : nsIAccessible

ブラウザの accessibility オブジェクトを返す。

addProgressListener ( listener )

Return Type: no return value

Add a progress listener to the browser which will monitor loaded documents. The progress listener should implement the nsIWebProgressListener interface.

戻り値の型 : 戻り値なし

ブラウザに、読み込んだ文書をモニタするプログレスリスナを追加する。プログレスリスナは、 nsIWebProgressListener インタフェースを実装する必要がある。

canGoBack

Type: boolean

This read-only property is true if there is a page to go back to in the session history and the Back button should be enabled.

型 : boolean

セッション履歴に戻りのページがあり、「戻る (Back)」ボタンが有効になっているとき、この読み込み専用プロパティは true である。

canGoForward

Type: boolean

This read-only property is true if there is a page to go forward to in the session history and the Forward button should be enabled.

型 : boolean

セッション履歴に進むページがあり、「進む (Forward)」ボタンが有効になっているとき、この読み込み専用プロパティは true である。

contentDocument

Type: document

This read-only property contains the document object in the browser.

型 : document

この読み込み専用プロパティは、ブラウザの文書オブジェクトを持つ。

contentTitle

Type: string

This read-only property contains the title of the document object in the browser.

型 : 文字列

この読み込み専用プロパティは、ブラウザの文書オブジェクトのタイトルを持つ。

contentViewerEdit

Type: nsIContentViewerEdit

This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document.

型 : nsIContentViewerEdit

この読み込み専用プロパティは、文書のクリップボード操作を処理する nsIContentViewerEdit を持つ。

contentViewerFile

Type: nsIContentViewerFile

Reference to the nsIContentViewerFile interface for the document.

型 : nsIContentViewerFile

文書の nsIContentViewerFile インタフェースへの参照。

contentWindow

Type: window

This read-only property contains the window object in the browser.

型 : window

この読み込み専用プロパティは、ブラウザの window オブジェクトを持つ。

currentURI

Type: string current URI

This read-only property contains the currently loaded URL. To change the URL, use the loadURI method.

型 : カレント URI の文字列

この読み込み専用プロパティは、現在読み込み済みの URL を持つ。 URL を変更するには、 loadURI メソッドを使用する。

docShell

Type: nsIDocShell

This read-only property contains the nsIDocShell object for the document.

型 : nsIDocShell

この読み込み専用プロパティは、文書の nsIDocShell オブジェクトを持つ。

documentCharsetInfo

Type: nsIDocumentCharsetInfo

This read-only property contains the nsIDocumentCharsetInfo object for the document which is used to handle which character set should be used to display the document.

型 : nsIDocumentCharsetInfo

この読み込み専用プロパティは、文書の nsIDocumentCharsetInfo オブジェクトを持つ。これは、文書を表示するにあたり、どの文字セットを使う必要があるのかを処理するのに用いられる。

goBack ( )

Return Type: no return value

Go back one page in the history.

戻り値の型 : 戻り値なし

履歴を 1 ページ戻る。

goForward ( )

Return Type: no return value

Go forward one page in the history.

戻り値の型 : 戻り値なし

履歴を 1 ページ進む。

goHome ( )

Return Type: no return value

Load the user's home page into the browser.

戻り値の型 : 戻り値なし

ユーザのホームページをブラウザに読み込む。

gotoIndex ( index )

Return Type: no return value

Navigate to the page in the history with the given index. Use a positive number to go forward and a negative number to go back.

戻り値の型 : 戻り値なし

与えられたインデックスの履歴ページに移動する。正の値を与えると前進し、負の値を与えると戻る。

homePage

Type: string home page URL

This property holds the value of the user's home page setting.

型 : ホームページ URL の文字列

このプロパティは、ユーザのホームページ設定値を保持する。

loadURI ( uri , referrer , charset )

Return Type: no return value

Load a URL into the document, with the given referrer and character set.

戻り値の型 : 戻り値なし

与えたリファラ (referrer)、文字セットで URL を文書に読み込む。

loadURIWithFlags ( uri , flags , referrer , charset )

Return Type: no return value

Load a URL into the document, with the specified load flags and the given referrer and character set. In addition to the flags allowed for the reloadWithFlags methods, the following flags are also valid:

  • LOAD_FLAGS_IS_REFRESH: This flag is used when the URL is loaded because of a meta tag refresh or redirect.
  • LOAD_FLAGS_IS_LINK: This flag is used when the URL is loaded because a user clicked on a link. The HTTP Referer header is set accordingly.
  • LOAD_FLAGS_BYPASS_HISTORY: Do not add the URL to the session history.
  • LOAD_FLAGS_REPLACE_HISTORY: Replace the current URL in the session history with a new one. This flag might be used for a redirect.

戻り値の型 : 戻り値なし

指定したロードフラグ、与えたリファラ (referrer)、文字セットで URL を文書に読み込む。reloadWithFlags メソッドに許されたフラグに加えて、以下のフラグも妥当です。

  • LOAD_FLAGS_IS_REFRESH: meta タグの refresh や redirect のために URL が読み込まれるときに、このフラグは使用される。
  • LOAD_FLAGS_IS_LINK: ユーザがリンクをクリックしたために URL が読み込まれるときに、このフラグは使用される。HTTP Referer ヘッダは自動的に設定される。
  • LOAD_FLAGS_BYPASS_HISTORY: URL はセッション履歴に追加されない。
  • LOAD_FLAGS_REPLACE_HISTORY: セッション履歴の現在の URL を新しいもので置き換える。このフラグはリダイレクトに対して用いられる。
markupDocumentViewer

Type: nsIMarkupDocumentViewer

This read-only property contains the nsIMarkupDocumentViewer which is responsible for drawing the document.

型 : nsIMarkupDocumentViewer

この読み込み専用プロパティは、文書の描画を担当する nsIMarkupDocumentViewer を持つ。

preferences

Type: nsIPrefService

This read-only property contains an nsIPref object for getting and setting user preferences.

型 : nsIPrefService

この読み込み専用プロパティは、ユーザ設定を取得/設定する nsIPref オブジェクトを持つ。

reload ( )

Reloads the document in the browser.

ブラウザに文書を再読み込みする。

reloadWithFlags ( flags )

Return Type: no return value

Reloads the document in the browser with the given load flags. The flags listed below may be used, which are all constants of the webNavigation property (or the nsIWebNavigation interface). You may combine flags using a or symbol ( | )

  • LOAD_FLAGS_NONE: No special flags. The document is loaded normally.
  • LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down.
  • LOAD_FLAGS_BYPASS_PROXY: Reload the page, ignoring the proxy server.
  • LOAD_FLAGS_CHARSET_CHANGE: This flag is used if the document needs to be reloaded because the character set changed.

戻り値の型 : 戻り値なし

与えられたロードフラグでブラウザの文書を再読み込みする。以下にリストしたフラグを使うことができる。これらは全て、webNavigation プロパティ (あるいは nsIWebNavigation インタフェース) の定数である。論理和記号 ( | ) を使って、フラグを繋げることができる。

  • LOAD_FLAGS_NONE: 特殊フラグなし。文書は普通に読み込まれる。
  • LOAD_FLAGS_BYPASS_CACHE: キャッシュにすでにあるかどうかは無視して、ページを再読み込みする。Shift キーを押下したまま「再読み込み (Reload)」ボタンを押したときに使われるフラグである。
  • LOAD_FLAGS_BYPASS_PROXY: プロキシサーバを無視して、ページを再読み込みする。
  • LOAD_FLAGS_CHARSET_CHANGE: 文字セットが変更されたために文書が再読み込みされる必要があるときに、このフラグは使用される。
removeProgressListener ( listener )

Return Type: no return value

Remove a progress listener from the browser.

戻り値の型 : 戻り値なし

ブラウザからプログレスリスナを削除する。

securityUI

Type: nsISecureBrowserUI

The readonly property holds an object which may be used to determine the security level of the loaded document.

型 : nsISecureBrowserUI

この読み込み専用プロパティは、読み込んだ文書のセキュリティレベルを決めるのに使われるオブジェクトを保持する。

sessionHistory

Type: nsISHistory

This read-only property contains the nsISHistory object which holds the session history.

型 : nsISHistory

この読み込み専用プロパティは、セッション履歴を保持する nsISHistory オブジェクトを持つ。

stop ( )

Return Type: no return value

Equivalent to pressing the Stop button, this method stops the currently loading document.

戻り値の型 : 戻り値なし

中止 (Stop) ボタンを押すのと等価である。このメソッドは現在読み込み中の文書を停止する。

webBrowserFind

Type: nsIWebBrowserFind

This read-only property contains an nsIWebBrowserFind object which can be used to search for text in the document.

型 : nsIWebBrowserFind

この読み込み専用プロパティは、文書内でテキストを検索するのに用いる nsIWebBrowserFind オブジェクトを持つ。

webNavigation

Type: nsIWebNavigation

This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the browser itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags.

型 : nsIWebNavigation

この読み込み専用プロパティは、文書の nsIWebNavigation オブジェクトを持つ。そのメソッドのほとんどは、goBack や goForward のようにブラウザ自身に直接呼ばれる。reloadWithFlags や loadURIWithFlags で用いられるロード定数も含んでいる。

webProgress

Type: nsIWebProgress

This read-only property contains an nsIWebProgress object which is used to monitor the progress of a document loading.

型 : nsIWebProgress

この読み込み専用プロパティは、文書の読み込みの進捗をモニタするのに使う nsIWebProgress オブジェクトを持つ。


Copyright (C) 1999 - 2004 XulPlanet.com