views:

1276

answers:

2

Hi Folks!

I have been working on a web app and for part of it I need to open a new window. I have this working on all browsers, my sticking point is with Google Chrome.

Chrome seems to ignore the window features which is causing me issues, the thing I'm struggling with is I need the address bar to be editable within the new window. FF, IE, Safari and Opera do this fine, Chrome does not.

My Code:

<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
 newwindow=window.open(url,'name','toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=1,resizable=1,width=800,height=600');
 if (window.focus) {newwindow.focus()}
 return false;
}

// -->
</script>

Any help would be gratefully received! Thanks in advance :)

+3  A: 

The location=1 part should enable an editable location bar.

As a side note, you can drop the language="javascript" attribute from your script as it is now deprecated.

update:

Setting the statusbar=1 to the correct parameter status=1 works for me

scunliffe
thanks for the reply scunliffe :)I just tried with those settings and the location bar displays the URL but still cannot be edited :(
McBonio
A: 

I believe currently no javascript way to force chrome to open as a new window in tab mode. A ticket has been submitted as in here Pop-ups to show as tab by default. But the user can always click the top left corner chrome icon and select "Show as tab", the address bar is editable.

Similar question asked in javascript open in a new window not tab

Dingle
If you don't specify and window properties when you open a window, it should put it in a tab. Conversely, if you want a window to open instead of a tab, specify at least one window property.
nickyt
The OP's problem is not about opening as a new window or tab. In chrome, OP is opening a new window, but the location bar is grayed out. The address bar is only editable when the new window is "show as tab".
Dingle
thanks for the input Dingle, I might be able to work around that somehow ;)
McBonio
@McBonio, Please update the post with your workaround method, thanks.
Dingle