window.open with target "_blank" in Chrome

I have a small javascript function which opens an url in a new tab:

function RedirectToPage(status) {
   var url = 'ObjectEditor.aspx?Status=' + status;
   window.open(url , '_blank');
}

This always works when called client-side by clicking a button, even in chrome. But in Chrome it won't work when it's called from server-side(!) by using

ScriptManager.RegisterClientScriptBlock()

In Firefox and IE it opens the url in a new tab, but chrome opens the url in a new window. What could be a workaround to force Chrome to open it in a new tab?

Answers


It's a setting in chrome. You can't control how the browser interprets the target _blank.


"_blank" is not guaranteed to be a new tab or window. It's implemented differently per-browser.

You can, however, put anything into target. I usually just say "_tab", and every browser I know of just opens it in a new tab.

Be aware that it means it's a named target, so if you try to open 2 URLs, they will use the same tab.


You can't do it because you can't have control on the manner Chrome opens its windows


As Dennis says, you can't control how the browser chooses to handle target=_blank.

If you're wondering about the inconsistent behavior, probably it's pop-up blocking. Many browsers will forbid new windows from being opened apropos of nothing, but will allow new windows to be spawned as the eventual result of a mouse-click event.


window.open(skey, "_blank", "toolbar=1, scrollbars=1, resizable=1, width=" + 1015 + ", height=" + 800);

Need Your Help

C++ -- return x,y; What is the point?

c++ c syntax return-value comma-operator

I have been programming in C and C++ for a few years and now I'm just now taking a college course in it and our book had a function like this for an example:

Embedded code development (especially for PIC with C18) in Visual Studio

visual-studio ide embedded pic pic18

I'm using Visual Studio for writing desktop applications, and I find it very user friendly and easy to use.