JavaScripts opening new windows or tabs

Questions and comments about currently under development PWB v3

Moderators: Tyler, Scott

Post Reply
timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

JavaScripts opening new windows or tabs

Post by timh »

Hi all,

The linking component of our Ex Libris library system, SFX, uses JavaScript to open a new window with the linked content. The HTML of the page says

<input class="button" type="button" style="background-image:url(/sfxlcl41/img/simplified_template1/general/default/button_bg.gif);" onclick="javascript:window.open('https://ab.cdef.ghijk.uk/welcome.html?ark:/81055/vdc_100026716572.0x000001','newwin','toolbar=yes,location=yes,directories=yes,buttons=yes,
status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=700');newwin.focus;" value="Go" title="Navigate to target in new window">

So PWB is doing what our linking system is telling it and opening a new window 600 pixels wide by 700 high, however IE running natively seems to open a new tab instead. Is there anyway to get PWB to follow the IE behaviour and open a tab rather than a window? Failing that, is there any way to say that such JavaScript opened windows must follow the [SecondWindow] size settings?

Thanks,

Tim

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: JavaScripts opening new windows or tabs

Post by Scott »

If the following code PWB believes the web designer wants to open a new window with a width of 600 and a height of 700 because of the highlighted portion of the code.

<input class="button" type="button" style="background-image:url(/sfxlcl41/img/simplified_template1/general/default/button_bg.gif);" onclick="javascript:window.open('https://ab.cdef.ghijk.uk/welcome.html?a ... uttons=yes,
status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=700');newwin.focus;" value="Go" title="Navigate to target in new window">

Removing the window sizing option in the JavaScript code will open the URL in a new tab in PWB v3 "CEF". In PWB v3 "IE", due to limitations of the IE WebBrowser Control it is not possible to determine the disposition of the window without explicitly defining it in the JavaScript.

Please note, in PWB 3.05.0 CEF "j" Beta, Chrome is allowed to determine the disposition of the new window. The "j" version will be available later today.

--Scott

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: JavaScripts opening new windows or tabs

Post by timh »

Thanks Scott,

The JavaScript that the SFX system uses is multi-purpose and the size, with the window being resizable, is fine in most circumstances. However in this case the content that is being loaded in the new window is an HTML5 interface to an RDP connection and the virtual screen size set for the RDP session is set and locked to that of the JavaScript opened window at the time of the initial connection. Which is not so good. Unfortunately the JavaScript is not under my department's control and is unlikely to get changed without many weeks notice and loads of testing, if at all.

I'll have a look at the 3.05.0 CEF "j" Beta release, will the .ini file line(s) for telling Chrome that it is allowed to determine the disposition of the new window be in the release notes?

Thanks again for the quick response,

Tim

Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: JavaScripts opening new windows or tabs

Post by Scott »

There is not a setting in the INI file for the new window determination. We defer to Chrome to handle this in the new version of PWB CEF.

--Scott

Post Reply