Re: XUL - How i get the code from the open website?
Neil <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: >i want to get the code from the open website and put the string into a variable. how i get the code? > > var x = window.content; > > "x" is now roughly equivalent to the open website's "window" variable. You can then use "x.document" in the same way as the site would use "document". >In a addon Code i found this snippet: > > var objContentWindow = gBrowser.getBrowserAtIndex(0).contentWindow; > > This only works for the first tab, not the current tab. > var objDocument = objContentWindow.document; > >if i alert(objDocument) it shows [object HTMLDocument] > >Is [object HTMLDocument] a dom node? > > Yes, it's a document node. -- Warning: May contain traces of nuts.