Is there a way to stop all javascript on the page? - Stack Overflow

I need to stop all the javascript running on the page, but I have a limitation:I cannot control theta

I need to stop all the javascript running on the page, but I have a limitation:

I cannot control the tags content, I am editing the page after it's being loaded.

Also, I need to remove all the variables defined by the old script that was running and stop all the intervals.

The solution I thought to stop intervals:

for(var i=0,s=setInterval(function(){},1e10);i<=s;++i)
    clearInterval(i);
for(var i=0,s=setTimeout(function(){},1e10);i<=s;++i)
    clearTimeout(i);

I need to stop all the javascript running on the page, but I have a limitation:

I cannot control the tags content, I am editing the page after it's being loaded.

Also, I need to remove all the variables defined by the old script that was running and stop all the intervals.

The solution I thought to stop intervals:

for(var i=0,s=setInterval(function(){},1e10);i<=s;++i)
    clearInterval(i);
for(var i=0,s=setTimeout(function(){},1e10);i<=s;++i)
    clearTimeout(i);
Share Improve this question edited May 24, 2010 at 17:41 asked May 24, 2010 at 17:34 user216441user216441 2
  • As a user or with some JS injected in the page? – jball Commented May 24, 2010 at 17:36
  • As js inserted in the page after it's loaded, I am using google chrome console to inject it. – user216441 Commented May 24, 2010 at 17:37
Add a ment  | 

2 Answers 2

Reset to default 2

Basing off of Matchu's suggestion. You could get a copy of Fiddler, modify the page locally to suit your needs, have Chrome proxy through Fiddler. Then you can tell fiddler that when it sees a request for the page of interest, serve the local file instead.

I've done something like this before to debug some Javascript piled into a .NET assembly, so I wouldn't have to repile for every script change, just refresh the page.

No, not really.

I mean, you could probably find a way to hack it together, but there's probably a better way. Override certain ponents manually, if need be, but erasing is likely not the way to go.

As per your ment, if you're just dealing with your own local copy, why not save a copy of the page and remove the script tags?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745250632a4618658.html

相关推荐

  • Is there a way to stop all javascript on the page? - Stack Overflow

    I need to stop all the javascript running on the page, but I have a limitation:I cannot control theta

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信