Possible to stop javascript execution on a page?

I just ran into a website that pretends to be a virus scanner scanning your machine.

No big deal, I hit 'back' to depart the page, and, as expected, a confirm box pops up saying "are you sure you want to leave? cancel/ok".

I click 'cancel', then the horrifying happens. An alert box pops up saying 'please install this', with just an ok button. Clicking 'ok' takes you back to the confirm 'cancel/ok' box.

Now both boxes are modal, so I can't do anything with safari while they're up, and the only way out is to click 'ok' on the 'cancel/ok' box (or kill safari, but I don't really want to do that since I have several tabs open across two windows).


So, I unplugged my ethernet, and clicked 'ok', but I'm wondering, is there anyway to kill a modal in safari and/or stop javascript from executing?

I think if I'd been using firefox, I may have been able to kill it through firebug, but I'm not 100% sure.

mac book pro, Mac OS X (10.5.8)

Posted on Sep 29, 2010 8:57 PM

Reply
2 replies

Sep 30, 2010 12:11 AM in response to Carolyn Samit

Ha!

Well, yes, that would do the trick (although is it really necessary to reboot the entire mac? I think restarting safari would be enough).

However, since much of the web today depends on javascript, I don't want to shut it off completely.

What I'm looking for is a way to kill execution of javascript on the current page in the event I get stuck in a modal loop such as the one described above without having to kill the browser.

Yet another problem of this modal loop is that most of the menu options in safari are grey'd out when a modal (in this case, confirm() and alert() ) is active.

Thank you for replying, though.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Possible to stop javascript execution on a page?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.