|
|
| Author |
Message |
spakinz
Joined: 04 Sep 2006
Posts: 15
|
Posted: Tue Sep 05, 2006 11:49 am Post subject: javascript 3 |
|
|
| It seems that doesn't work tool.domain, I've substituted it for window._content.document.domain. |
|
| Back to top |
|
 |
Admin Site Admin
Joined: 22 Aug 2006
Posts: 1055
|
Posted: Wed Sep 06, 2006 8:32 am Post subject: |
|
|
yes, you should use tool.window._content.document.domain
instead of tool.domain
To show alert: tool.alert("Testalert");
Last edited by Admin on Fri Jan 18, 2008 6:00 am; edited 1 time in total |
|
| Back to top |
|
 |
Dr.Snergel
Joined: 17 Oct 2007
Posts: 5
|
Posted: Thu Oct 18, 2007 4:22 pm Post subject: |
|
|
I've been having a similar issue in trying to identify the body of the current web page. Here is what my DocumentComplete function looks like with the comments indicating what actually happens. Is there a way to retrieve the body HTML from a firefox window like the reference tool.explorer.parentWindow.document.body.innerHTML does in IE?
| Code: |
function DocumentComplete(tool) {
// Possible window references
// window.document also works but that refers to the HTML document containing this function and not the web page currently viewed by the user
alert("tool.Explorer: "+tool.Explorer); // IE: [object] or null FF: undefined
alert("tool.explorer: "+tool.explorer); // IE: [object] FF: [object Window]
alert("tool.window: "+tool.window); // IE: undefined FF: [object ChromeWindow]
if( tool.window && tool.explorer ) { // FF only
alert("tool.explorer.window: "+tool.explorer.window); // FF: [object Window]
alert("tool.explorer.window.document: "+tool.explorer.window.document); // FF: [object HTMLDocument]
//alert("tool.explorer.window.document.body: "+tool.explorer.window.document.body); Fails
}
if( tool.Explorer && tool.explorer ) { // IE only
alert("tool.explorer.window: "+tool.explorer.window);
alert("tool.explorer.title: "+tool.explorer.title); // IE: Title of webpage currently viewing
if( tool.explorer.parentWindow ) {
alert("tool.explorer.parentWindow.document: "+tool.explorer.parentWindow.document);
if( tool.explorer.parentWindow.document )
alert("tool.explorer.parentWindow.document.body: "+tool.explorer.parentWindow.document.body.innerHTML);
}
}
}
|
|
|
| Back to top |
|
 |
|