• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Check for another open browser window

I have an application written in VID using mostly VB and some Java script.  I would like to be able to check to see if the user has a specific Internet web page open on their PC and then if yes, grab some hidden XML from that page.  Is this possible?  If so, how do I get started?

TIA
0
Overthere
Asked:
Overthere
  • 2
1 Solution
 
LlamaJoeCommented:
The only way to grab from another page is if:
a) it is on the same domain name as your page (otherwise this is a cross site scripting attack)
b) one window of internet explorer opens a new window - if someone clicks on internet explorer, this is then a new instance and you can't grab from one or the other.

in your situation, if you use window.open in script to open a new window, this new window can reference the window that launched it by referencing window.opener - then you can find any object in the document object model.

example:
parent.html
<a href=# onclick="window.open('child.html')">click me</a><br>
<input type="text" id="box" name="box" value="yo"></input>

child.html
<script>
alert(window.opener.document.getElementById('box').value);
alert(window.opener.document.URL);  //especially for you
</script>
0
 
OverthereAuthor Commented:
So if from my webpage (MYSITE.com/whatever.asp) I open another window to a different website (THEIRSITE.com/page1.htm) and send over some input data, then the user adds more data but also goes to another page on that website (THEIRSITE.com/finalpage.htm) - that's where I want to pull the XML from.  So I opened that browser window and want to pull data even though the page name is different, I can do that???  That's exactly what I would need.
0
 
LlamaJoeCommented:
sorry dude, java script will not allow you to pull data from a page that exists in another domain.  
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now