Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delay script/asset loading in Chrome Developer Tools

Is there any way to add a time delay to a script/asset loading in the Google Chrome Browser via the Chrome Developer Tools? Or to block a script loading entirely?

The reason I want to do this is to see how a site performs when a script/asset suffers from delayed loading or failed loading.

like image 423
James Avatar asked Sep 05 '16 23:09

James


4 Answers

In Chrome Developer Tools when you are in the Network you can add custom throttling. You can specify download and upload speed as well as request latency. But this will apply to all resources and not only to a specific one.

--- edit ---

For delay individual URLs on any page, you can use a chrome extension (since it can intercept browser requests). I use https://chrome.google.com/webstore/detail/url-throttler/kpkeghonflnkockcnaegmphgdldfnden

like image 87
Erik Avatar answered Oct 10 '22 12:10

Erik


If the asset is a third party or hosted on a different domain, there is a Chrome plugin that's designed to test what you are calling loading delays, that are also called SPOF (Single Point Of Failure). It might not be very intuitive at first use, but it's very helpful :

The plugin is called SPOF-O-Matic and can be found here: https://chrome.google.com/webstore/detail/spof-o-matic/plikhggfbplemddobondkeogomgoodeg

like image 36
Gaël Métais Avatar answered Oct 10 '22 12:10

Gaël Métais


Following solutions have nothing with Chrome Devtools but they work.

If you don't mind redirects then you can try Slowwly or deelay.me.

Other alternative for non-windows OS is Comcast.

like image 2
Martin Ždila Avatar answered Oct 10 '22 12:10

Martin Ždila


You can do it by combining multiple resources.

I use http://www.deelay.me/ to generate the delayed url.

I then combine it with requestly extension (https://requestly.io/) to create a host replace rule to target a specific resource

like image 1
Daniel Avatar answered Oct 10 '22 14:10

Daniel