window.open with target "_blank" in Chrome

Jan-Patrick Ahnen picture Jan-Patrick Ahnen · Jun 14, 2012 · Viewed 126.8k times · Source

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?

Answer

Dennis Traub picture Dennis Traub · Jun 14, 2012

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