Browser pop-up pop-under, tab-over, tab-under support - javascript

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.

Related

Visual Notification given programmatically from browser window

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?

How to enable browser tabs after using window.open to launch a new window

I've got a link which launches a new window using
window.open( url, '_blank', 'height=400,...')
The window opens fine but tabs are disabled. Is there a way to launch a new window with tabs enabled?
I tried adding as many options as I could think of that might have an effect! ;-)
window.open( url, '_blank', 'height=400, resizable=yes,toolbar=yes,scrollbars=yes,menubar=yes,titlebar=yes');
Thanks
Clem
just found out that, what you are willing to do. It's not supported to Chrome bowers, due to security and memory concerns.
You can find all this info here.
toolbar
If this feature is on, then the new secondary window renders the Navigation Toolbar (Back, Forward, Reload, Stop buttons). In addition to the Navigation Toolbar, Mozilla-based browsers will render the Tab Bar if it is visible, present in the parent window. (If this feature is set to no all toolbars in the window will be invisible, for example extension toolbars).
Supported in: Internet Explorer 5+, Netscape 6.x, Netscape 7.x, Mozilla 1.x, Firefox 1.x

JS/HTML: Opening a link in a new browser window in IE8

So I am trying to make a link that opens a full image version of the one I have in a small version in a new browser window, and I am using the following code (:
test for StackOverflow
It works in all browsers, except in our favorite IE8. Any ideas on how to make it work?
You will have to make sure IE is set to open in new window.
Go to Tools > Internet Options > General. Click on the Settings button in the Tabs section. Set the value of "When a popup is encountered" to "Always open popups in a new window."
One other thing I had to do was right-click on the yellow banner at the top of the page that says, "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options..."
I right-clicked on it and chose: "Allow Blocked Content..."

In Firefox the window is not re-sizeing using JavaScript,

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)

JavaScript: Forcing IE into opening new tab instead of window?

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

Categories