Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hooking to browser instance through javascript

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this mean that for cross-domain recording there is no javascript option available - but would have to go throgh the IWebBrowser route?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic