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

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
LVL 44
scrathcyboyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michel PlungjanIT ExpertCommented:
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");
0
scrathcyboyAuthor Commented:
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.
0
scrathcyboyAuthor Commented:
basically, one has to have the location bar showing for the title bar to display correctly, the FF "hack".
0
Michel PlungjanIT ExpertCommented:
<blushing>

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.
So
window.open('page.html','_blank','width=300,height=400,location=no,resizable=yes')
is the same as
window.open('page.html','_blank','width=300,height=400,resizable')

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...

Michel
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.