Home > Not Working > Window.opener.focus Not Working In Chrome

Window.opener.focus Not Working In Chrome

Contents

Does any organism use both photosynthesis and respiration? Here is a workaround: In the parent window, declare a function in "window.external" that will trigger Javascript "alert()" or "confirm()". You may have to register before you can post: click the register link above to proceed. share|improve this answer edited Feb 17 '12 at 16:56 answered Feb 15 '12 at 16:28 tobinibot 11028 Interesting approach! http://powerglobaldesigns.com/not-working/window-opener-focus-not-working-in-ie8.html

Reply With Quote 10-20-2004,12:53 AM #6 meeble View Profile View Forum Posts Registered User Join Date Oct 2004 Posts 9 Originally posted by Jona I can't see what the problem is... Focus does not shift. I have found a strange, strange workaround for Chrome (29, possibly others). This works in IE 6/7/8, FireFox, Safari but not Chrome. // Well in Chrome it works the first time, but subsequent focus attempts fail,. http://stackoverflow.com/questions/18501095/window-opener-focus-doesnt-work

Javascript Window Opener Focus

There is a sequence of focused objects where focus is only obtained through user interaction. instead of http://localhost/Default.aspx ... !/^http(?:s?):/.test(url) && (currentLocation.pathname + currentLocation.search + currentLocation.hash) !== url ) ) { // Not the same URL, so load the new one. Word to describe object that can be physically passed through Returning the length of largest word in a sentence Did the Gang of Four thoroughly explore "Pattern Space"? But in my case, the popup is an edit window for data.

I realize that's probably not very common, but it's what I needed to do. –tobinibot Feb 16 '12 at 17:54 The second part answers exactly what I was asking Removed launching blank window from catch block, instead launching the url directly, which avoids user's confusion when he says blank window. In your privileged JavaScript code: // get API constants (might already be available) const {Cc,Ci,Cu} = require("chrome"); // import js-ctypes var file=null, lib=null, ctypes = {}; Cu.import("resource://gre/modules/ctypes.jsm", ctypes); var ctypes = Window.opener.focus() Not Working In Firefox What OS and browser are you using?

windowHandles[windowTarget] = windowHandle; windowHandles[windowTarget].focus(); } } } } } share|improve this answer edited Jan 9 '14 at 16:17 answered May 3 '10 at 16:59 nickytonline 4,57143167 I am having Makes for a handy query and review results then modify query scenario but in separate tabs. All other major browsers do not have this problem: FireFox, IE6-IE8 and Safari. http://stackoverflow.com/questions/14473407/window-opener-focus-does-not-work-in-firefox-any-workaround The window_focus() JavaScript function is exposed which does what you want.

Unable to change publishing settings as admin Why would a teen TV show need an FBI warning inside the Young Justice universe? Window.focus Not Working In Ie Are there any other workarounds to give focus to a popup window using setTimeout? –teo Jan 26 '11 at 14:08 1 Version 46.0.2490.86 (64-bit) Mac OSX 10.11.1. Skeleton HTML Email CSS suport. windowHandle.blur(); windowHandle.focus(); So I ended up trying this instead: windowHandle.blur(); setTimeout(windowHandle.focus, 0); and that seems to work.

How To Set Focus On Parent Window In Javascript

Googling shows that I do not appear to be the only person frustrated with this. I've updated my code here: MyCompany = { UI: {} }; // Put this here if you want to test the code. Javascript Window Opener Focus Invoke that function from the child window. Window.focus Not Working In Chrome of ways to write a 2x2 matrix whose determinant equals 0 Taxing GoFundMe Donations What specifically did Hillary Clinton say or do, to seem untrustworthy to Americans?

There is no good workaround, because I can't close a window every time and start it again to get it in focus. Check This Out If this is for a public-facing website, then just don't bother -- as they say, "Don't break the web." But I really wanna! Who are the people on this picture? It seems to be testing for something, and forcing my code to reload? Go Back To Parent Window Javascript

  • Why do Internet forums tend to prohibit responding to inactive threads?
  • MyCompany.UI.Window = new function() { // Private fields var that = this; var windowHandles = {}; var isChrome = /chrome/.test(navigator.userAgent.toLowerCase()); // Public Members this.focus = function(windowHandle) { if (!windowHandle) { throw
  • This bug reduce usability of my application on chrome.
  • Jesse Baird - rad javascript dude Login Got a question?
  • From what I can tell, this appears to be a security feature to avoid annoying pop-ups and it does not appear to be a WebKit issue as it works in Safari.
  • the top header's src is adHeader.jsp, and this is where the problem is.
  • There is a bug logged on the Chromium project about this, check it out here.
  • We already do so for IE, and only because they have a substantial userbase.
  • This way I can get the page to respond to keyboard input.

The time now is 10:04 AM. EDIT: Example for Firefox on Win32... current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. http://powerglobaldesigns.com/not-working/window-opener-focus-not-working.html Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name

It seems to work fine for me. Window.focus Javascript Yeah, I guess I could create some custom JSP code to not use frames if the ad URL contains "compassion.com", but that seems like a last resort to me. What could cause humanity to migrate from land to water?

If the form was submitted again the child tab is deleted and replaced by a new child tab.

What should I do about this security issue? Emphasis mine. My AccountSearchMapsYouTubePlayNewsGmailDriveCalendarGoogle+TranslatePhotosMoreShoppingWalletFinanceDocsBooksBloggerContactsHangoutsEven more from GoogleSign inHidden fieldsSearch for groups or messages To use Google Groups Discussions, please enable JavaScript in your browser settings, and then refresh this page. . Javascript Window Onfocus The trick was in returning focus to the parent.

Because sometimes you only reload parts of the page (with Ajax, triggered by another window) and need the page back in the front. As window name is same, the focus should go to the already open child window. You'll just need to make sure that you are able to grab everything you need for the new window. have a peek here I wanted a reference to another window, so I was issuing a: otherWinRef = window.open("","OtherWindow"); However when I issue this command, the browser will switch focus to the OtherWindow.

It may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns. Unbelievably, the solution is quite simple. I never get the loop thing with the Dave Ramsey ad. so it can keep track of them and get rid of them as needed.

What if the popup has data that you want to save? Hope this helps someone else. Browse other questions tagged javascript html focus or ask your own question. Comment 9 by [email protected], Sep 28 2009 Processing While I understand that Google may be reluctant to fix this (because of the above statement) it should be recognized that ONLY Chrome