Jump to content

Control another browser window.


iPixel

Recommended Posts

/bump [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]

[!--quoteo(post=376402:date=May 23 2006, 01:24 PM:name=iPixel)--][div class=\'quotetop\']QUOTE(iPixel @ May 23 2006, 01:24 PM) [snapback]376402[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Please read >

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=94053\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=94053[/a]

I was sent here .. can someone help me out.

Thanks in advance.
[/quote]
You can open a new browser window from the current one with javascript:

[code]
newWindow = window.open("yourURL", "yourwindowName")
[/code]

where yourURL is the address of the page you want opened, and yourwindowName is the object name. You can now address objects in the new window using newWindow.document.whatever... Does this help any?
Ive seen this done with C-sharp.... any idea why that isnt considered a "Security Risk" ?

It was basically a PC application that found a specific and specified window (hard coded) that was already opened and basically
controlled it. Im attempting the same with JavaScript.
Even if the javascript opened the window, you cannot get any elements from the new window if it was in a different domain. For example, if you are trying to get the HTML code, or a input value. You'll get "Access Denied" error.

Here are general restriction when opening a window, from MSDN
[a href=\"http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/window_restric.asp\" target=\"_blank\"]http://msdn.microsoft.com/library/default....dow_restric.asp[/a]

If the application was a desktop application (or a PC) application, it'll be considered as a trusted application so there are less restrictions.

You can try to create an HTA file (normal HTML, just rename it to something.hta) which is a trusted html application. It'll have less restrictions, and you can run it from you PC. I am not sure if you can access remote sites with it or not.

[a href=\"http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp\" target=\"_blank\"]http://msdn.microsoft.com/library/default....htaoverview.asp[/a]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.