I need a way of programmatically triggering either bringing the browser window to front or at least the window flickering. I have noticed that window.alert does it in firefox but it doesn't in chrome. Opening a new tab (window.open)causes flickering in Chrome but it's not a solution - it would be if I could close the "old tab"
Is there something like "visually notify user" working at least for current versions of firefox, chrome and edge?
Related
I am running a legacy app in MS edge in IE mode. Pages on web app can open a pop up in new window (but this on edge and not IE mode) using window.open.
When pop up is launched, this pop up redirects to another url on same pop up window.
now window.close is throwing some error and not closing the pop up. Is it due to Ms edge IE mode to Edge pop issue?
I have not catched the exception but the exception is coming.
It's impossible to get the Edge window handler in IE browser, so it's impossible to get documentWindow to close the window.
As you can't use the two windows in the same browser kernel, the only workaround I think is using window.self.close() to close the pop up window by itself.
I am doing a POC around browser window. I want following behaviors when a new browser window is opened.
Pop-up: New window should have focus
Pop-under: Parent window should have focus
Tab-over: New Tab should have focus
Tab-under: Parent Tab should have focus
Out of these 4, Pip-up and Tab-over are supported by Chrome, Firefox and Internet Explorer.
Any one know if other two are supported by these browsers or not ?
Any implementation links would be helpful. I an doing this POC using Javascript and JQuery.
I have a JavaScript to re-size all my popup windows:
function resize()
{
window.resizeTo(240,230);
}
But now it is not resizing in Mozilla Firefox, but it was doing earlier, also
or if the popup window is opened in a new tab, it is not resizing, also in some browsers it is not also. Is there any piece of JavaScript code which works in all scenarios and all browsers?
Firefox comes with a preference for user to allow/disallow resizing of
window using Javascript. It's in Tools - Options - Content - Enable
Javascript -> [Advanced].
I am not sure if resizing is disabled by default, but you might want
to check your own Firefox installation first.
If it's disabled by default, then unfortunately there is nothing you
could do to resize the window after it has been opened. An ugly
workaround would be to open itself once again using window.open() with
the preferred size though.
Source: timdream (here)
I'll also add that:
You can't be assured that any browser will let you control the size of
windows you create. You can't even be sure you'll get a window at all
- people can instruct their browsers to open all new windows as browser tabs
Source: Pointy (same source as timdream)
On iPad Safari, there seems to be issue with popup. When a popup (opened using window.open()) is closed, it remains in minimized mode (or grid view) after closing the popup...It
does not return focus to the parent window.
I have tried using parent.opener.focus(), but still does not work.
Is this a known iPad issue OR can we fix this issue using some JS code?
Please help.
I'm not sure if this would help, but just some personal experience on this issue:
Did you try going to iPad's Setting - Safari - Block Pop-ups? Try turning off Block Pop-ups, it should work.
If it still doesn't appear, try turning on the Debug Console for the ipad and check if any error appears during the popup event.
Try using a URL for window.open to be a local / same domain url address. I think that works (without needing to turn off the popup blocker in safari ipad).
I want a script that makes a user's Internet Explorer open a new tab instead of a new window whenever someone clicks on a (target="_blank") link/banner on my webpage.
I hate how Internet Explorer defaults to opening new windows instead of new tabs when a link/banner is clicked. All the other popular browsers (e.g. Chrome, Opera, Firefox) open tabs by default.
Preferably this script would need to work in all versions of IE that support tabs.
So... How to, using JavaScript force IE into opening new tab instead of window, which is it's default behaviour?
This isn't possible; it's a browser setting/behavior which is not callable from a script loaded on the page.
Programmatically open new pages on Tabs
In IE11 at least, the default user setting is to 'Let Internet Explorer decide how popups should open' (Off-hand, I'm not sure what the default was in previous versions). Some context around the IE behaviour with this default setting can be found here: https://superuser.com/questions/713743/what-rules-apply-when-ie9-decides-how-to-open-popups
Per others' answers/comments here, generally speaking, we as web programmers have little control over how popups are opened. However, provided users have not changed their default selection (in IE11 at least!), you can approximate the behaviour you want through appropriate invocation of the window.open() method. Specifically, if you pass less than three arguments to the method, IE will generally open a new tab, while passing the specs (third) argument (even if with a null or undefined value <- this caught me out initially!) results in IE popping a separate window.
If you're happy to live with a solution that isn't guaranteed but works a fair amount of the time, this may help. The 'tyranny of the default' works in our favour in this instance at least!
Chrome at least is not quite so picky about the specs argument - if null or undefined, it will pop the tab instead of the window under default configuration.
What I did was to go to the tab settings of IE and under the section 'When a pop-up is encountered' select 'Always open pop-ups in a new tab'. I hope this helps.
To navigate to this menu open IE settings (Cog icon at the top-right, Internet Options) and click the tabs button under the Tabs section.
The below post show you how to navigate to the menu in the screenshot.
https://superuser.com/questions/507798/prevent-a-single-ie-window-with-multiple-open-tabs-from-being-displayed-as-multi
IE Settings