Determine if browser window has an address bar

R

Raffi

Hi,

I'm looking for a way using JavaScript to determine if the browser
window has an address bar.

Thanks,
Raffi
 
R

Randy Webb

Raffi said the following on 11/21/2005 3:56 PM:
Hi,

I'm looking for a way using JavaScript to determine if the browser
window has an address bar.

You can't.
 
R

Raffi

Randy said:
Raffi said the following on 11/21/2005 3:56 PM:

You can't.

When opening a window, you can specify this with the location property.
Is there no way to get this property for the current window? I know
this can be done for the window size and possibly position.

Raffi
 
R

Randy Webb

Raffi said the following on 11/21/2005 6:28 PM:
When opening a window, you can specify this with the location property.
Is there no way to get this property for the current window? I know
this can be done for the window size and possibly position.

Even when opening a new window, you can only suggest that there be no
location bar. That does not insure that it's not there.

But you can not determine, programatically and reliably, whether the
address bar is present or not.
 
R

RobG

V

VK

RobG said:

Hah! They got'ya too?! :)

About Mozilla "location" object:
It's is important to mention that it requires UniversalBrowserWrite
privilege which has to be granted by user in the popup dialog box. And
this popup dialog will appear only for a local file. For server-side
files dialog will appear only if the HTML page is in a jar file signed
with a valid certificate from a valid certificate authority.
<http://www.mozilla.org/projects/security/components/signed-script-example.html>

That may save some OP's precious time ;-)

Goind out of the sandbox we can get an equivalent for IE either using
WScript.Shell sidewalk with the same security limitations.

So the original answer remains correct: no, you cannot do it from
JavaScript :-(
 
T

Thomas 'PointedEars' Lahn

RobG said:
[...]
<URL:http://developer.mozilla.org/en/docs/DOM:window.locationbar>

According to the above, it's DOM 0 - support may be patchy.

IE has no equivalent:

I am wondered by your repeated definition of "DOM (Level) 0". Specified
definition is that it includes all DOM features originating from NN3 and
IE3, hence those that are very likely to be supported in all JS-enabled
HTML user agents. Which is why the `locationbar' property would not
qualify as a DOM (Level) 0 feature, but only as a Gecko DOM feature.

<http://www.w3.org/TR/DOM-Level-2-HTML/glossary.html>


PointedEars
 
T

Thomas 'PointedEars' Lahn

Hah! They got'ya too?! :)

About Mozilla "location" object:

He referred to the `locationbar' property of Mozilla (more precise: the
Gecko DOM), and, with the latter URI, the `location' property of the IE
DOM. Both have nothing to do with each other, hence your reference to
browser privileges does not matter and is inappropriate here, especially
not regarding _read_ access to the property which is always possible in
the former without them.
So the original answer remains correct: no, you cannot do it from
JavaScript :-(

Wrong. Mozilla/5.0-based UAs implement only JavaScript (IE-based
UAs implement JScript), and it can be done there. However, it is
only occasionally that the DOM required for support of a feature
also requires support of the language, meaning that the feature
cannot be expected to be supported in JavaScript-supporting host
environments.

You have still not understood the difference between the each of
the languages, and between the language and the AOM/DOM accessible
through it.


PointedEars
 
G

Gérard Talbot

Raffi wrote :
When opening a window, you can specify this with the location property.

You can't force this in Opera 7+. You can't force this in any
Mozilla-based browsers. You probably can't force this in Konqueror 3.3+
and Safari 2.x. And you won't be able to force this in MSIE 7:

"We think the address bar is also important for users to see in pop-up
windows. A missing address bar creates a chance for a fraudster to forge
an address of their own. To help thwart that, IE7 will show the address
bar on all internet windows to help users see where they are."
Better Website Identification and Extended Validation Certificates in
IE7 and Other Browsers
November 21, 2005
http://blogs.msdn.com/ie/archive/2005/11/21.aspx
Is there no way to get this property for the current window?

Yes. Just imagine+assume that all responsible browser manufacturers
force the presence of the address bar otherwise assume that all
security-concerned web users force the presence of the address bar.

Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top