View Full Version : Firefox URL persists in popup despite "location=0"

08-13-2008, 06:15 PM
I open a popup window using Firefox,
with a spec that reads "location=0", (which is the default anyway).

This spec in fact disables user modification of the displayed URL,
but, for one thing, the URL stays on display,
and, more importntly, there's the arrow next to the URL
the user can click to reach an error page.

Can either, or both, be avoided?

rnd me
08-13-2008, 07:42 PM
not in firefox3, the window.open location option has been disabled as a security precaution.

08-13-2008, 07:53 PM
rnd me - you misunderstood me.
I am aware of the disabling.
I want to know if I can eliminate the URL altogether
or eliminate or disable the arrow to the right of the URL.

08-13-2008, 08:18 PM
ruffy, the little arrow is a part of the location bar and cannot be disabled.
Just as rnd me said, the location bar cannot be hidden in popup windows due to improved security.

What exactly are you having problems with? What is the error page you referred to?

08-14-2008, 05:09 AM
eak - The Firefox's URL has this arrow after the disabled URL.
Were the user to click that arrow for some reason,
he'd be taken to my main screen, which does not expect
such a move and therefore would throw up all sorts of errors.
My Submit button on that popup is the one that has to be clicked,
nothing else.

In Safari that entire URL field can be eliminated with location = 0.
But not in Firefox. That arrow may never get pressed by a user,
but as a coder I have to think of all "unlikelihoods" just to keep
things clean, always.

Thus my original question.

08-14-2008, 11:49 AM
Can either, or both, be avoided?No. .

rnd me
08-14-2008, 03:18 PM
when Firefox disabled it, they also forced it to display the parent page's url.

again, there is nothing you can do about it.

08-14-2008, 04:40 PM
Since you can't do anything about the location bar (in FF3), you may want to recode your "main screen" to remove the errors.

Is there a URL we can go to? Maybe we can help.

08-14-2008, 06:16 PM
eak - How about if I code into the document
where an attempt to navigate out of it simply
brings the user right back,
thus forcing him to use the Submit to go anywhere.

08-14-2008, 06:44 PM
You cannot force someone to stay on a page, but you can ask if they want to leave.

check out onbeforeunload (http://www.google.com/search?q=onbeforeunload).

I have used it to check if a user really wants to leave a page but hasn't saved their work yet.

08-14-2008, 08:50 PM
eak - Using onbeforeunload will be tricky and will need plenty of code
because it executes also when the user exits using the
upper corner X icon,
and even when the user properly hits the Submit button.

08-14-2008, 10:54 PM
This is the JS I used on one of my projects.
It only prompts the user if a form was modified or if they didn't click the submit button.


var formSubmission = false;
window.onbeforeunload = function(){
if( !formSubmission && formValueHasChanged() )
return 'You have not saved yet.';

function formValueHasChanged(){
var f = document.forms, i = 0, l = f.length;
for( ; i < l ; ++i ){
var elms = f[i].elements, j = 0, el = elms.length;
for( ; j < el ; ++j ){
if( !isset(elms[j].defaultValue) )continue;
if(elms[j].value!=elms[j].defaultValue)return true;
return false;


<form action="whatever.php" onsubmit="formSubmission = true;">

I think that may help you get started with your own before unload prompt.

08-15-2008, 03:08 AM
Thanks eak - I didn't dare ask that you bother, but
since you offered, I thank you for the code.