Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - IE7 detect protected mode in script

Reply
 
Old 11-08-2006   #1 (permalink)
Ty


 
 

IE7 detect protected mode in script

Hi,

I was referred to this group because the people on the scripting/IE
groups thought I'd have better luck here.

I need to identify if IE7 is running in protected mode on Vista so my
web page can help the user (in a user friendly way) add my site to their
trusted zone.

Does anyone know how to do this using scripting?

I've had the following 2 suggestions so far:
1. get the temp directory and if it ends in a directory called "Low"
then the browser is likely to be in protected mode.

2. use a try/catch block to capture the exception from performing an
operation that is prohibited when running in protected mode.

I like the 2nd suggestion the best since it will probably get fewer
false positives than the 1st suggestion.

Does anyone have a suggestion for the prohibited operation I should use?

Naturally, I want the script to be as reliable and robust as possible.
It's pretty frustrating that there is a function to do this when writing
a browser extension but there seems to be nothing when scripting on web
pages...


Thanks
Ty

Please reply to the group as my e-mail probably won't work.

My System SpecsSystem Spec
Old 11-09-2006   #2 (permalink)
Steve Riley [MSFT]


 
 

Re: IE7 detect protected mode in script

Here's a general article that describes a variety of interesting bits about protected mode in IE: http://msdn.microsoft.com/library/de...tectedMode.asp

This section of MSDN describes protected mode: http://msdn.microsoft.com/library/de..._ref_entry.asp

The IEIsProtectedModeProcess() function will return a result indicating whether IE is running in protected mode: http://msdn.microsoft.com/workshop/s...odeprocess.asp

--
Steve Riley
steve.riley@microsoft.com
http://blogs.technet.com/steriley
http://www.protectyourwindowsnetwork.com


"Ty" <tyn@newsgroups.nospam> wrote in message news:ei9%23RC7AHHA.3560@TK2MSFTNGP04.phx.gbl...
Hi,

I was referred to this group because the people on the scripting/IE
groups thought I'd have better luck here.

I need to identify if IE7 is running in protected mode on Vista so my
web page can help the user (in a user friendly way) add my site to their
trusted zone.

Does anyone know how to do this using scripting?

I've had the following 2 suggestions so far:
1. get the temp directory and if it ends in a directory called "Low"
then the browser is likely to be in protected mode.

2. use a try/catch block to capture the exception from performing an
operation that is prohibited when running in protected mode.

I like the 2nd suggestion the best since it will probably get fewer
false positives than the 1st suggestion.

Does anyone have a suggestion for the prohibited operation I should use?

Naturally, I want the script to be as reliable and robust as possible.
It's pretty frustrating that there is a function to do this when writing
a browser extension but there seems to be nothing when scripting on web
pages...


Thanks
Ty

Please reply to the group as my e-mail probably won't work.
My System SpecsSystem Spec
Old 11-09-2006   #3 (permalink)
Ty


 
 

Re: IE7 detect protected mode in script

Hi,

Thanks for the response and the links. I had hit these pages already
and thought that the code examples and API were for browser extensions
only. There seemed to be nothing for web page scripting.

Have I misread/misinterpreted the information? I'm not a programmer so
it wouldn't surprise me if I have.

If I have, can you give me an example (or point me to an example) of
using IEIsProtectedModeProcess() in script?


Thanks,
Ty

Steve Riley [MSFT] wrote:
> Here's a general article that describes a variety of interesting bits
> about protected mode in IE:
> http://msdn.microsoft.com/library/de...tectedMode.asp
>
> This section of MSDN describes protected mode:
> http://msdn.microsoft.com/library/de..._ref_entry.asp
>
> The IEIsProtectedModeProcess() function will return a result indicating
> whether IE is running in protected mode:
> http://msdn.microsoft.com/workshop/s...odeprocess.asp
>
> --
> Steve Riley
> steve.riley@microsoft.com <mailto:steve.riley@microsoft.com>
> http://blogs.technet.com/steriley
> http://www.protectyourwindowsnetwork.com
>
>
>
> "Ty" <tyn@newsgroups.nospam <mailto:tyn@newsgroups.nospam>> wrote in
> message news:ei9%23RC7AHHA.3560@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> I was referred to this group because the people on the scripting/IE
> groups thought I'd have better luck here.
>
> I need to identify if IE7 is running in protected mode on Vista so my
> web page can help the user (in a user friendly way) add my site to
> their
> trusted zone.
>
> Does anyone know how to do this using scripting?
>
> I've had the following 2 suggestions so far:
> 1. get the temp directory and if it ends in a directory called "Low"
> then the browser is likely to be in protected mode.
>
> 2. use a try/catch block to capture the exception from performing an
> operation that is prohibited when running in protected mode.
>
> I like the 2nd suggestion the best since it will probably get fewer
> false positives than the 1st suggestion.
>
> Does anyone have a suggestion for the prohibited operation I should use?
>
> Naturally, I want the script to be as reliable and robust as possible.
> It's pretty frustrating that there is a function to do this when
> writing
> a browser extension but there seems to be nothing when scripting on web
> pages...
>
>
> Thanks
> Ty
>
> Please reply to the group as my e-mail probably won't work.

My System SpecsSystem Spec
Old 11-13-2006   #4 (permalink)
ThePluginGuy


 
 

Re: IE7 detect protected mode in script


Here is the script to solve all your problems:


if (navigator.userAgent.indexOf("Mac") > -1)
{
alert("Not in protected mode!")
}


--
ThePluginGuy
------------------------------------------------------------------------
ThePluginGuy's Profile: http://forums.techarena.in/member.php?userid=19136
View this thread: http://forums.techarena.in/showthread.php?t=622126

http://www.techarena.in

My System SpecsSystem Spec
Old 11-13-2006   #5 (permalink)
tdinneen


 
 

Re: IE7 detect protected mode in script


I think you'll find that the sample script should read

if (navigator.userAgent.indexOf("Mac") == -1)
{
alert("Not in protected mode!")
}


--
tdinneen
------------------------------------------------------------------------
tdinneen's Profile: http://forums.techarena.in/member.php?userid=19137
View this thread: http://forums.techarena.in/showthread.php?t=622126

http://www.techarena.in

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Detect IE 7 Protected mode using javascript Vista security
Detect Vista in Logon Script Vista account administration
Re: mailto from Protected Mode: Off to Protected Mode: On Vista mail
IE 7 Protected Mode: Off Vista security
IE7 Protected Mode: Off Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46