Reference an Already Opened Browser Window

  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 437

Post 3+ Months Ago

I've ran into an issue of trying to communicate between browser windows. In fact, in my application I do use javascript to send information from a popup window back to the main window. Basically, the user clicks a value in the popup window and it populates an input field in the main window. However, the popup is created by the main window so the references are created and everything is fine.

I've ran into an issue now where a windows program running on our user's machine can launch a web browser and send a URL string. My application is web based and runs in Chrome so my users throughout the day are always logged in and continually have their dashboard open. The problem is the windows program opens a new browser window instead of sending the user from the dashboard to the URL page. I thought I could tell the windows program to go to a webpage that once opened finds the browser window of my user's dashboard, push a URL to browser window with the dashboard, and then close itself leaving my user with the current browser window on the correct page.

Is there a way to reference the browser window (user's dashboard) that is already open and not the parent of another? I've already looked and the windows program will always open a new window.

I've ready that web sockets may be able to help but I'm not sure how to implement.

Seems kinda silly that it is so difficult to get one window to send another window to a URL and then close. Also, both scripts are on the same server and domain. So, dashboard.php and windows_web_browser_launch_page.php are in the same directory.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9099
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I did some brief research, and from my understanding you must know the windows name to be able to reference and manipulate it. I was trying to find a way to use JavaScript to list all open windows so that you could then reference it, but it does not look like that is possible.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6254
  • Loc: Seattle, WA

Post 3+ Months Ago

Bigwebmaster wrote:
I was trying to find a way to use JavaScript to list all open windows so that you could then reference it, but it does not look like that is possible.

For good reason -- that would be a huge security hole. Imagine if it were possible to do that, and you had your online banking open in another browser window, and then went to a malicious site.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9099
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Yeah that makes perfect sense, I was more referring to just getting access to a window if you didn't have a name for it. I believe the only way to get access to any windows is if you set a name for it or saved a reference. If you created a child window but didn't set a name or reference, I think there is no way to get access to it by listing the available windows you have access to.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 64 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.