SP2 and Javascript

T

Tony Talmage

I posted this question a while back and never received an answer... now that
I've installed SP2, I see that my fears were correct.. my OP is as follows:

<quote>
I noticed on the page linked below [in reference to the URL
http://www.microsoft.com/windowsxp/sp2/ieoeoverview.mspx lower in quoted
text] that "Internet Explorer has put a stop to this behavior by prohibiting
Web sites from running scripts that resize or reposition your browser
windows." Will my default start page be affected by this? I currently have
my startpage set to
"javascript:resizeTo(800,600);moveTo(250,205);document.location.href='http:/
/mail.yahoo.com'". I do this because I try to make sure all of our web
pages will display fully in 800x600, so I force my browser to that size, as
well as forcing it to start in the center of my screen.

As my start page is a script that resizes and repositions my browser window,
it sounds like I might be out of luck... don't suppose there's any way to
get around this .. ?
</quote>

Now to be fair, I have slightly changed my homepage.. the moveTo function is
now set to "moveTo((window.width-800)/2,(window.height-600)/2);". However,
it seems I was correct in thinking that IE would block my attempts to resize
the window, so now I either cannot open IE at all because IE closes itself,
or, if I mess with things a bit, I receive a message in the notification bar
that tells me it won't run my script commands. At that time, I have to
click on the notification message, click Allow this behaviour (or
something), then click the OK button on a confirmation message asking if I
really want to allow the behaviour.

Please tell me there is a way I can set this particular string of javascript
or maybe a local .html file as trusted so I won't have to click 3 times just
to load my homepage everytime I open IE (which is a LOT as I use it for both
work and play)...
 
R

Richard

Some people said things, and then:-
Tony Talmage added


Check the thread "Security says javascript mouseovers are Dangerous?" I
think it answers your problem perfectly.

--
Richard

I posted this question a while back and never received an answer... now that
I've installed SP2, I see that my fears were correct.. my OP is as follows:

<quote>
I noticed on the page linked below [in reference to the URL
http://www.microsoft.com/windowsxp/sp2/ieoeoverview.mspx lower in quoted
text] that "Internet Explorer has put a stop to this behavior by prohibiting
Web sites from running scripts that resize or reposition your browser
windows." Will my default start page be affected by this? I currently have
my startpage set to
"javascript:resizeTo(800,600);moveTo(250,205);document.location.href='http:/
/mail.yahoo.com'". I do this because I try to make sure all of our web
pages will display fully in 800x600, so I force my browser to that size, as
well as forcing it to start in the center of my screen.

As my start page is a script that resizes and repositions my browser window,
it sounds like I might be out of luck... don't suppose there's any way to
get around this .. ?
</quote>

Now to be fair, I have slightly changed my homepage.. the moveTo function is
now set to "moveTo((window.width-800)/2,(window.height-600)/2);". However,
it seems I was correct in thinking that IE would block my attempts to resize
the window, so now I either cannot open IE at all because IE closes itself,
or, if I mess with things a bit, I receive a message in the notification bar
that tells me it won't run my script commands. At that time, I have to
click on the notification message, click Allow this behaviour (or
something), then click the OK button on a confirmation message asking if I
really want to allow the behaviour.

Please tell me there is a way I can set this particular string of javascript
or maybe a local .html file as trusted so I won't have to click 3 times just
to load my homepage everytime I open IE (which is a LOT as I use it for both
work and play)...

--
 
T

Tony Talmage

This seems like a great place to start - I'll try it out and post my results
later on today.

--
Tony Talmage


Richard said:
Some people said things, and then:-
Tony Talmage added


Check the thread "Security says javascript mouseovers are Dangerous?" I
think it answers your problem perfectly.

--
Richard

I posted this question a while back and never received an answer... now that
I've installed SP2, I see that my fears were correct.. my OP is as follows:

<quote>
I noticed on the page linked below [in reference to the URL
http://www.microsoft.com/windowsxp/sp2/ieoeoverview.mspx lower in quoted
text] that "Internet Explorer has put a stop to this behavior by prohibiting
Web sites from running scripts that resize or reposition your browser
windows." Will my default start page be affected by this? I currently have
my startpage set to
"javascript:resizeTo(800,600);moveTo(250,205);document.location.href='http:
/
/mail.yahoo.com'". I do this because I try to make sure all of our web
pages will display fully in 800x600, so I force my browser to that size, as
well as forcing it to start in the center of my screen.

As my start page is a script that resizes and repositions my browser window,
it sounds like I might be out of luck... don't suppose there's any way to
get around this .. ?
</quote>

Now to be fair, I have slightly changed my homepage.. the moveTo function is
now set to "moveTo((window.width-800)/2,(window.height-600)/2);". However,
it seems I was correct in thinking that IE would block my attempts to resize
the window, so now I either cannot open IE at all because IE closes itself,
or, if I mess with things a bit, I receive a message in the notification bar
that tells me it won't run my script commands. At that time, I have to
click on the notification message, click Allow this behaviour (or
something), then click the OK button on a confirmation message asking if I
really want to allow the behaviour.

Please tell me there is a way I can set this particular string of javascript
or maybe a local .html file as trusted so I won't have to click 3 times just
to load my homepage everytime I open IE (which is a LOT as I use it for both
work and play)...
 
R

Richard

Some people said things, and then:-
Tony Talmage added
This seems like a great place to start - I'll try it out and post my results
later on today.

You have Code-Curious Mom to thank for it if it works. It's her fix.
 
T

Tony Talmage

Well Richard, her fix worked famously. I never would have guessed to add
such a comment in my launch page =)
 
R

Richard

Some people said things, and then:-
Tony Talmage added
Well Richard, her fix worked famously. I never would have guessed to add
such a comment in my launch page =)

Nice to know.

Now your next task, Grasshopper, is to find Code Curious Mom and thank
her too...
 
C

Code-Curious Mom

Richard said:
Some people said things, and then:-
Tony Talmage added


Nice to know.

Now your next task, Grasshopper, is to find Code Curious Mom and thank her
too...

Actually, she found you, lol. And thanks Richard for passing the info on. I
never would have *guessed* either: I found the solution by seaching on the
RC2 forum, back before the final version of SP2 was out.
 
G

Guest

Tony, thanks for starting this thread (and thanks to Richard and Code-Curious
Mom as well) as I have the same problem you observed about using javascript
to locate and size my browser window (for my home page). However, I would
*really* appreciate it if you could go just one more step here and spell out
exactly what you did to fix this. I know this may all be obvious to more
learned folks here, but I'm quite slow at some of this ... I would like to
know just what I need to do to, effectively, execute the relocation/resizing
javascript in the SP2 IE 6 with Local Machine Lockdown. I'm sorry, I've
tried to figure it out but haven't done this before and can't make it work.

Thanks in advance for any further post you might be able to make addressing
this for my benefit (and perhaps for others).

Ken
 
T

Tony Talmage

Well, for starters, instead of having the Javascript string as the startpage
itself, I created a local html file with the same commands. Then, I changed
my startpage to the local HTML file - of course, you'll find it still won't
work at this time. So now you'll want to implement CCM's fix; I'm sure
you've seen it already, but it's an html comment in the form <!-- saved from
url=(0021)http://www.google.com -->. The website may be changed to anything
you'd like, but be sure to change the number in parentheses to the total
number of characters in the web address.

So, here is what I currently use:

<!-- saved from url=(0022)http://www.NoPlace.com -->
<html><head>
<title></title>
<script language="Javascript">
resizeTo(800,600);
moveTo((window.width-800)/2,(window.height-600)/2);
document.location.href = 'http://mail.yahoo.com';
</script>
</head>
<body>
</body></html>

Simply change the values to whatever you'd like, and hopefully this will
work for you as well.
 
T

Torgeir Bakken \(MVP\)

Tony said:
Well, for starters, instead of having the Javascript string as the startpage
itself, I created a local html file with the same commands. Then, I changed
my startpage to the local HTML file - of course, you'll find it still won't
work at this time. So now you'll want to implement CCM's fix; I'm sure
you've seen it already, but it's an html comment in the form <!-- saved from
url=(0021)http://www.google.com -->. The website may be changed to anything
you'd like, but be sure to change the number in parentheses to the total
number of characters in the web address.

So, here is what I currently use:

<!-- saved from url=(0022)http://www.NoPlace.com -->
<html><head>
<title></title>
<script language="Javascript">
resizeTo(800,600);
moveTo((window.width-800)/2,(window.height-600)/2);
document.location.href = 'http://mail.yahoo.com';
</script>
</head>
<body>
</body></html>

Simply change the values to whatever you'd like, and hopefully this will
work for you as well.
Hi

More about the 'Mark of the Web' method here:

Local Machine Zone Lockdown - Developer Implications
http://msdn.microsoft.com/security/productinfo/XPSP2/securebrowsing/lockdown_devimp.aspx


*Important*, 'Mark of the Web' is very picky about placement/spaces/
lengths:
http://groups.google.com/groups?selm=Oy0xT#[email protected]

Note this one as well:
http://groups.google.com/[email protected]


Mark of the Web is also described in the chapter "Internet Explorer
Local Machine Zone Lockdown" in document 05_CIF_Browsing.doc

05_CIF_Browsing.doc ("Changes to Functionality in Microsoft Windows XP
Service Pack 2, Part 5: Enhanced Browsing Security") can be downloaded
from here:
http://www.microsoft.com/downloads/...d7-b791-40b6-8364-685b84158c78&DisplayLang=en

and
How Windows XP Service Pack 2 affects web pages running locally
on your computer
http://www.phdcc.com/xpsp2.htm
 
C

Code-Curious Mom

*Important*, 'Mark of the Web' is very picky about placement/spaces/


Minor correction per above: Perhaps I should have made this more clear (in
my post you're linking to). It is picky about spaces and lengths, but not
placement. I only put it at the top because that's where IE puts it when it
saves a page from the net. I did not actually *find* any placement that did
not work, just figured the top was my best bet.
Your other links were interesting as well.
 
T

Thomas Osthege

Hi you all,

1st thank you to all of you! Your tips help to solve the 1st step of my
problem. But it goes a bit further and lets me desperate:

My font scaling (in the extended desktop settings) is set to 120 DPI
(125%). Until SP2 this worked great for me on my screen. Since
SP2 IE scales almost everything. Using the statement
'javascript:window.resizeTo(1024,768)' in fact resizes IE's window to
1024 ×
125%,768 × 125% which becomes a real size of 1280 × 960. What is even
worse, all images are resized to 125%. This is especially disturbing if
one creates websites and needs an exact scaling. And it looks uggly,
too.

Does anyone know a way to set this behaviour back to what it was before
SP2?

Have a great time!

Thomas
 

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

Top