Solved

Check whether internet / intranet ....  and other questions..

Posted on 2004-09-02
6
384 Views
Last Modified: 2008-03-17
Hi Experts,
Could you please help me in the following :

I'm trying to make sure that my web-based product works without any problems in Windows XP SP2.

Since the security settings in the intranet zone and internet zone are different, I would like to put a check in my product to find out if the URL is accessed within intranet or internet.  How do I do this through client-side scripting ?

Also,
1. how do I check the security level (medium / medium-low) ?

2. how do I check if popups are blocked ?

3. how do I check if there are any window-restrictions (status bar, scroll bar - on or off) ?

Thanks,
Benny
0
Comment
Question by:bennyv
  • 2
  • 2
6 Comments
 
LVL 4

Assisted Solution

by:sgalzin
sgalzin earned 40 total points
ID: 11972348
hi,

sometimes intranets have a different url. the reason for that is, on the intranet, you can access the server by its internal name or alias directly. so one possiblity would be to check if the url has the actual internet domain name or not. depending on the answer, your either dealing with a client from the internet or the intranet (respectively).

the code for that in JavaScript would look like this :

var onTheInternet = ( new String ( window.location ) ) .toLowerCase () .indexOf ( 'http://www.mydomainname.com' ) != -1;

hope that helps,

stephane.
0
 

Author Comment

by:bennyv
ID: 11972512
Hi sgalzin,

Thanks for your reply.

Do you mean to give the domain name as a hard coded string (like 'http://www.mydomainname.com' ) in the script ?  I think we cannot do that.   I'm working on a product which can be used by any customer and their website names or domain names will be different.  

What about the other questions ?  Any clue ?

Thanks,
benny
0
 
LVL 3

Accepted Solution

by:
andYetAnotherLoginName earned 85 total points
ID: 11973413
For intranet ranges, consult http://www.faqs.org/rfcs/rfc1918.html section "3. Private Address Space". Yet, there's no cross-platform-safe way to find out IP from JavaScript, so that must be done with server-side. IP check then can be performed on client-side, with JavaScript.
0
 
LVL 3

Assisted Solution

by:andYetAnotherLoginName
andYetAnotherLoginName earned 85 total points
ID: 11973473
oh, there's more...

2. how do I check if popups are blocked ?
 open one :) if you don't receive valid window handle, than you have them blocked.

3. how do I check if there are any window-restrictions (status bar, scroll bar - on or off) ?
 I doubt that's possible...
0
 

Author Comment

by:bennyv
ID: 12306327
Hi,

Could you please split the points to "andYetAnotherLoginName" and "sgalzin" (65 to "andYetAnotherLoginName" and 60 to "sgalzin") and accept both the answers.

Thanks,
Benny
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

759 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

23 Experts available now in Live!

Get 1:1 Help Now