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

Posted on 2006-04-05
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 =,"","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
    LVL 75

    Accepted Solution

    It is not a flaw. It is a security hobble.
    You can see your title if you add the location to the open:

    win =,"","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
    So if you want to help the firefoxes but let IE have the hidden url, use

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

    Author Comment

    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

    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

    The textbooks are correct.
    The canonical way to call is

    windowHandle =,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'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...


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    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…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now