Cant remove URL from Title in Popup - Mozilla / Firefox defect?

Posted on 2006-04-05
Medium Priority
Last Modified: 2008-01-09
Opening a popup window, either with html page, or contents of DIV, even though you specify the title, Mozilla / Firefox put the site URL infront of title, so user cannot see real page title in a small popup.  Behaviour is same in Moz and FF whether popup blocker is turned on or off, no difference.

This annoyance robs user of correct page information.  Surely can be fixed, if not, it is big flaw in Moz / FF.  It only happens in JS popup window, not a page link.  MSIE first shows URL, but then correct title when page loads.  I try

    win.document.write("<TITLE>" + divName + " Information</TITLE>");
     win.document.title = divName + "Information";

Neither fix Moz/FF, the site URL is always in front, hiding real title.  Need to eliminate URL from Title, as in MSIE.

These parameters do not affect title display of the popup window, so please not suggest them -
win = window.open(pg,"","height=550,width=470,location=0,resizable=1,scrollbars=1,status=0,toolbar=0");

I did extensive search on expert exchange site, no one has answered this question fully/correctly.
That includes previous question I asked in this section recently - /JavaScript/Q_21800380.html
Question by:scrathcyboy
  • 3
  • 2
LVL 75

Accepted Solution

Michel Plungjan earned 2000 total points
ID: 16395056
It is not a flaw. It is a security hobble.
You can see your title if you add the location to the open:

win = window.open(pg,"","height=550,width=470,location,resizable,scrollbars");

anything that is =0 can be omitted and you do not need the =1 or =yes, just the keyword
LVL 75

Expert Comment

by:Michel Plungjan
ID: 16395069
So if you want to help the firefoxes but let IE have the hidden url, use

win = window.open(pg,"","height=550,width=470,"+((document.all)?"":"location")+",resizable,scrollbars");
LVL 44

Author Comment

ID: 16395900
Amazing, everyone else in the web, and on expert exchange, seem to have it backward, all but mplungjan.  Any future readers, the first solution solves the problem completely, both in IE and Moz/Firefox.

Everyone else, uncluding JS tutorials say, you must specify location=0, and you need to use either 0 or 1, or yes or no on these parameters -- but they don't work, in fact they have opposite effect desired - location=0 stops the display from being correct.  Only mplungjans solution above makes both browsers work exactly as intended.  i.e. the docs are wrong!!!  Thank you again, mplungjan for brilliant assistance.
LVL 44

Author Comment

ID: 16396097
basically, one has to have the location bar showing for the title bar to display correctly, the FF "hack".
LVL 75

Expert Comment

by:Michel Plungjan
ID: 16398545

The textbooks are correct.
The canonical way to call window.open is

windowHandle = window.open(url,windowname,parms)
where url may be empty - if it is empty, the open returns the handle to an existing window with the windowname specified (e.g. 'mywindow')
If the windowname is the special window name _blank, it will not return the handle of an existing window opened with _blank but return the handle of a new window.

The parms, which may not contain spaces by the way (newer browsers do not care but older do care) can be
height, width, top, left, screenX, screenY, which are all integers (Some browsers will not allow width/height to be < 100 pixels unless the script is signed)
and the so-called chrome parameters like
location, resizable, scrollbars, menubar and a few more, which are all parameters taking 0,1,yes,no as values
however: If you set ONE parameter, the rest are off by default, and just putting the parameter name there is enough.
is the same as

Some of the rest of the chrome parms need the script to be signed to work, for example you need a signed script to turn off the titlebar in Mozilla/Netscape6/Firefox

The issue with the location bar is a securoty issue - it seems that the folks at Mozilla did not like the idea that you could not see where the page came from so they will put the url in the titlebar if location is not specified. I would say that is overly cautious and annoying - a much better idea would be to do something if the popup was not from the domain it was popped from, but I guess it is the fear of  you linking to a banking site and popping a logon screen from your own site...


Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question