473,323 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Determine if browser window has an address bar

Hi,

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

Thanks,
Raffi

Nov 23 '05 #1
10 6793
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 23 '05 #2
Randy Webb wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


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

Nov 23 '05 #3
VK
> Is there no way to get this property for the current window?

Nop. Absolutely no way.

Nov 23 '05 #4
Raffi said the following on 11/21/2005 6:28 PM:
Randy Webb wrote:
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.

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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 23 '05 #5
Raffi wrote:
Hi,

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


In some browsers:

alert('window.locationbar: '
+ (window && window.locationbar && window.locationbar.visible));

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

<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/dhtml_node_entry.asp>

--
Rob
Nov 23 '05 #6
RobG wrote:
[...]

IE has no equivalent:

<URL:http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/dhtml_node_entry.asp>


Sorry, #@%$@#! frames!!

<URLLL:http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_location.asp>


--
Rob
Nov 23 '05 #7
VK

RobG wrote:
Sorry, #@%$@#! frames!!

<URLLL:http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_location.asp>


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 :-(

Nov 23 '05 #8
RobG wrote:
[...]
<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
Nov 23 '05 #9
VK wrote:
RobG wrote:
Sorry, #@%$@#! frames!!
<URLLL:http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_location.asp>
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
Nov 23 '05 #10
Raffi wrote :
Randy Webb wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

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
--
remove blah to email me
Nov 24 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David | last post by:
Hi I'm developing an internet app. in which I want to prevent the user from being able to browse the web whikst they are in the app. So I want to hide the I.E. address bar and prevent any new...
20
by: msa | last post by:
Hi there, First off, let me say that I know that launching to full screen is a bad idea. I would never do it given the choice, but I must follow orders from my boss, the boss that desparately...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
5
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which...
6
by: Biguana | last post by:
Hi, Just wondering if anyone can help here. We have a site where most of the site opens in a window with no toolbars or menubar: window.open('mypage.aspx','self','toolbar=0, menubar=0, etc,...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
1
by: joe | last post by:
If I had a webpage that displayed a database in tabular form, it would be nice to know how many lines of text the browser could display without scrolling, then have the cgi script output the...
2
by: Sai Kiran | last post by:
Hi! 1. I am using asp.net 2.0 for my application and was wondering is there a way we can hide address bar, menu bar, Links and Standard Buttons of the browser without opening a new window. ...
6
by: bushi | last post by:
hi everyone! i have diplayed my hyperlinks in a iframe.when i redirect to next page.the next page also open in the same frame,but i want to open a new browser window,when i click on the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.