iPixel Posted May 23, 2006 Share Posted May 23, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/ Share on other sites More sharing options...
iPixel Posted May 25, 2006 Author Share Posted May 25, 2006 /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] Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-38937 Share on other sites More sharing options...
king arthur Posted June 1, 2006 Share Posted June 1, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-40988 Share on other sites More sharing options...
iPixel Posted June 8, 2006 Author Share Posted June 8, 2006 Slightly .. but im trying to control a window that is already opened ... its a whole seperate site.Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43146 Share on other sites More sharing options...
nogray Posted June 8, 2006 Share Posted June 8, 2006 Scripts cannot control a page or a window on a different domain (security risk). Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43274 Share on other sites More sharing options...
iPixel Posted June 8, 2006 Author Share Posted June 8, 2006 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 basicallycontrolled it. Im attempting the same with JavaScript. Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43278 Share on other sites More sharing options...
king arthur Posted June 8, 2006 Share Posted June 8, 2006 Javascript can only control a browser window it has opened itself. It doesn't matter what the URL is. Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43363 Share on other sites More sharing options...
iPixel Posted June 8, 2006 Author Share Posted June 8, 2006 So how about if i were to open the PCS site with a pop up script... window.open.blahblahblahwould that allow me to gain control over the pages objects ? Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43384 Share on other sites More sharing options...
nogray Posted June 8, 2006 Share Posted June 8, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43394 Share on other sites More sharing options...
iPixel Posted June 9, 2006 Author Share Posted June 9, 2006 Thanks ill look into this .hta thing. Quote Link to comment https://forums.phpfreaks.com/topic/10282-control-another-browser-window/#findComment-43643 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.