| Author |
hooking to browser instance through javascript
|
Ranadhir Nag
Ranch Hand
Joined: Mar 09, 2006
Posts: 137
|
|
We can use attachevent to listen to events on a document. But we wish to open a new browser instance(window.open) and hook into the events of that particular browser instance-how do we do that? We want to provide a recording functionality which allows us to record all user actions/navigations on a browser instance. Is this possible through javascript?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
well you store a reference of the object var newWin = window.open(...); than you can reference the child with that variable example of referencing the form of a child would be: newWin.forms[0].elementName.value = "foo"; Eric
|
 |
Ranadhir Nag
Ranch Hand
Joined: Mar 09, 2006
Posts: 137
|
|
Thanks Eric. But I had an idea that we can sink listeners only if the new page belongs to our domain.If we open a URL belonging to another domain,ther would be some security issues involved is what I hear. Though I could not get any reference on that - can you comment?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
You can not do cross domains. Major security risk. The Firefox Extensions that do monitoring embed an iframe into the page and attach listeners that way. Eric
|
 |
Ranadhir Nag
Ranch Hand
Joined: Mar 09, 2006
Posts: 137
|
|
Can you point me to some refernce document which explains the extent of the problem - since we intend to provide a QA recording solution ,which would most definitely involve recording events on non-host domains,it would be nice if we can understand the issues involved before stroking down this approach. Thanka a lot for the help again.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
It is part of the spec that you can not do cross browser requests. It is so you can not read someones bank account. You might want to try to look through the ECMA docs or Mozilla Docs. Eric
|
 |
Ranadhir Nag
Ranch Hand
Joined: Mar 09, 2006
Posts: 137
|
|
|
Does this mean that for cross-domain recording there is no javascript option available - but would have to go throgh the IWebBrowser route?
|
 |
 |
|
|
subject: hooking to browser instance through javascript
|
|
|