Simulate limited bandwidth from within Chrome? - google-chrome

Is there a way I can simulate various connection speeds from within Chrome?
I need to be able to check http://localhost with varying speeds.
I know there are standalone applications that can do this, but I'd rather do this inside Chrome.

If you are running Linux, the following command is really useful for this:
trickle -s -d 50 -w 100 firefox
The -s tells the command to run standalone, the -d 50 tells it to limit bandwidth to 50 KB/s, the -w 100 set the peak detection window size to 100 KB. firefox tells the command to start firefox with all of this rate limiting applied to any sites it attempts to load.
Update
Chrome 38 is out now and includes throttling. To find it, bring up the Developer Tools: Ctrl+Shift+I does it on my machine, otherwise Menu->More Tools->Developer Tools will bring you there.
Then Toggle Device Mode by clicking the phone in the upper left of the Developer Tools Panel (see the tooltip below).
Then activate throttling like so.
If you find this a bit clunky, my suggestion above works for both Chrome and Firefox.

I'd recommend Charles Proxy - you can choose to slowdown individual sites, also has a whole bunch of HTTP inspection tools.
Edit:
As of June 2014, Chrome now has the ability to do this natively in DevTools - you'll need Chrome 38 though.
The option is accessible from the Network tab via a drop down at the end of the toolbar.

Starting with Chrome 38 you can do this without any plugins. Just click inspect element (or F12 hotkey), then click on toggle device mod (the phone button)
and you will see something like this:
Among many other features it allows you to simulate specific internet connection (3G, GPRS)

As of today you can throttle your connection natively in Google Chrome Canary 46.0.2489.0. Simply open up Dev Tools and head over to the Network tab:

As Michael said, the Chrome extension API doesn't offer a reliable way of doing this. On the other hand: there's a software I've been using myself for quite some time.
Try Sloppy, a Java application that simulates low bandwidth. It's browser independent, it's very easy to use and, best of all, it's free!

If you are on a Mac, the Chrome dev team recommend the 'Network Link Conditioner Tool'
Either:
Xcode > Open Developer Tool > More Developer Tools > Hardware IO Tools for Xcode
Or if you don't want to install Xcode:
Go to the Apple Download Center and search for Hardware IO Tools
https://developer.apple.com/downloads/index.action

Original article: https://helpdeskgeek.com/networking/simulate-slow-internet-connection-testing/
Simulate Slow Connection using Chrome
Go ahead and install Chrome if you don’t already have it installed on your system. Once you do, open a new tab and then press CTRL + SHIFT + I to open the developer tools window or click on the hamburger icon, then More tools and then Developer tools.
This will bring up the Developer Tools window, which will probably be docked on the right side of the screen. I prefer it docked at the bottom of the screen since you can see more data. To do this, click on the three vertical dots and then click on the middle dock position.
Now go ahead and click on the Network tab. On the right, you should see a label called No Throttling.
If you click on that, you’ll get a dropdown list of a pre-configured speed that you can use to simulate a slow connection.
The choices range from Offline to WiFi and the numbers are shown as Latency, Download, Upload. The slowest is GPRS followed by Regular 2G, then Good 2G, then Regular 3G, Good 3G, Regular 4G, DSL and then WiFi. Pick one of the options and then reload the page you are on or type in another URL in the address bar. Just make sure you are in the same tab where the developer tools are being displayed. The throttling only works for the tab you have it enabled for.
If you want to use your own specific values, you can click the Add button under Custom. Click on the Add Custom Profile button to add a new profile.
When using GPRS, it took www.google.com a whopping 16 seconds to load! Overall, this is a great tool that is built right into Chrome that you can use for testing your website load time on slower connections. If you have any questions, feel free to comment. Enjoy!

In Chrome Canary now you can limit the network throughput. This can be done in the "Network" options of the "Emulation" tab of the Console in the Dev Tools.
You might need to activate the Chrome flag "Enable Developer Tools experiments" (chrome://flags/#enable-devtools-experiments) (chrome://flags) to see this new feature. You can simulate some low bandwidth (GSM, GPRS, EDGE, 3G) for mobile connections.

if you're not familiar with Fiddler - please do. It's a great debugging tool for HTTP. You also have the option to limit the bandwidth.

I don't think what you ask can be done by chrome alone. The closest I could find was this, which isn't what you want. I getting a chrome plugin to do it would be Hard.
A web proxy running on your local machine could achieve the effect you want. A search for "throttling proxy" came up with this, for example.

As suggested on the Chrome Mobile Emulation page, you can use Clumsy on Windows, Network Link Conditioner on Mac OS X and dummynet on Linux.

If you are using OSX, you can use: Network Link Conditioner
Here you can select different profiles ie. 100% Loss, 3G, DSL etc.
Please find the below link to download Network Link Conditioner here

Related

where is the chrome dev tools "continuous page repainting" option?

There used to be an option in dev tools under Render right next to the FPS Meter that said "Enable continuous page repainting". Now it's not there. Where did it go?
Version 60.0.3112.113 (Official Build) (64-bit)
There used to be an option in dev tools under Render right next to the FPS Meter that said "Enable continuous page repainting". Now it's not there. Where did it go?
It's been removed. See Crbug issue #523040.
The broader question here is, what workflow can you use to replace Continuous Painting Mode (CPM)?
CPM was before my time, but it looks like it gave you a realtime estimate of painting cost for the entire page. There's nothing equivalent to that anymore, but Performance recordings can definitely help you gauge how much painting your page is doing. The general idea is to start recording, interact with your page, and then analyze the recording results to see how many paint events occurred, and how much time each one took. See Get Started With Analyzing Runtime Performance to get familiar with the Performance panel.
2 Nov 2017 Update
There's a new feature coming to DevTools in Chrome 64 (which is currently in Canary) that's close to CPM called the Performance Monitor. It shows a realtime view of FPS, Layouts Per Second, and Style Recalculations Per Second.
The "continuous page repainting" debugging option was removed from Chrome quite a few versions ago. However, you can still get to paint instrumentation in the Performance tab of the developer tools:
Developer tools -> Performance -> Settings -> Enable advanced paint instrumentation
This will not enable continuous repaint since as far as I can tell Chrome no longer does that, but will allow you to see a profile of how your page actually worked during recording, and can be very useful for tracking down performance problems. It is integrated with other performance profile data as well.
I personally have found this article: https://blog.algolia.com/performant-web-animations/ to be useful if you're working on animations, but I'm not going to summarize it here since it's quite long and I'm not sure you're specifically looking to improve animation performance anyway. (No association with the author; just useful info.)

How do I track site loading and tag latency over time using chrome on the server?

With an increasing mobile user base I would like to be able to gauge a baseline for site performance. Typically I can do this using chrome dev tools, checking when DOMContentLoaded finishes, and checking all my javascript tags to make sure they're in acceptable threshholds. How would I go about automating this so I can create performance dashboards?
Maybe phantomjs, selenium can do this? What headless chrome implementation could I use to achieve this.
You can use Lighthouse to capture a variety of performance metrics.
For real user metrics, you can instrument your app however you see fit with the User Timing API.

How to test mobile chrome's "save to homescreen" prompt

I'm resurrecting an old project of mine as a way to learn some new stuff.
I'm doing this code lab from IO Add Your Web App to a User's Home Screen.
Is there any way, other than connecting a phone and waiting a lot, to test if users will be shown the prompt below?
I've tested it with Lighthouse and all tests come back green, but I've never seen the prompt. It feels very random at the moment.
The answer to This question puts the stuggle into perspective:
The user has visited your site twice over two separate days during the course of two weeks
Does that mean I need to wait 2 days between changes to see if it worked?
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Increasing Engagement with Web App Install Banners
anshulix has correctly answered the question, but I thought I'd put in a more verbose answer.
To remove the waiting and other requirements for the save to homescreen prompt, then you need to enable a flag.
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Which comes from Increasing Engagement with Web App Install Banners
It's important to remember that you are setting this flag on the mobile browser, not on your desktop browser. For some reason this didn't occur to be for a while!
You also need to restart mobile Chrome for the flag to take effect. If you've got your tabs mixed in with your other apps, this can be tricky because you need to hunt down all the tabs and close them. (Or find a better way to close Chrome.)
I found it much easier to do this debugging in Chrome Dev, rather than regular chrome because a) I know it's got the latest fixes in it, and b) because I only have 1 tab open, so it's easy to restart the browser.
If you are doing remote inspection, there is an issue about the messages that come up in the console. In Chrome 50 you get:
App banner not shown: could not determine the best icon to use
This doesn't seem to be true; in more recent builds—e.g. mobile Chrome 52—save to desktop works just fine. It's a disconcerting but useless error.
As a bonus helpful thing, realfavicongenerator does an excellent job of generating all the icons and the manifest file that you need.

Chrome DevTools Network Throttling in Windows 7

From the documents of Chrome DevTool I have see this,
One key aspect for the responsiveness of a site is its network performance. Fear not, the DevTools offers network throttling. Now you can test your site against different network conditions and optimize for them.
Network conditioning does bandwidth throttling and latency manipulation. The bandwidth is how much speed the client has to talk to the server while latency is the delay in connection. A few presets are available in the network dropdown, as well as the ability to go completely offline. All changes only affect this tab's traffic; your other tabs are unaffected.
But I am unable to find this option Chrome with Windows 7.
From the Chrome DevTools page:
Note: Some of our documentation may be ahead of the stable version of Chrome. If you are unable to locate a feature listed, we recommend trying Chrome Canary which contains the latest version of the DevTools.

Minimize Chrome browser to tray?

How to minimize chrome browser to tray when I click on standard minimize button?
I don't want Chrome to appear in task bar.
Can we implement this by Chrome extension code?
As amer pointed out, there exists an extension solely purposed to do this functionality.
Luckily, the extension is open source and has a home here you can borrow it as long as your extension itself is kept open source (you should check the license for details).
Note, though, that since the chrome extension APIs don't provide this functionality (tray icons and hiding browser windows), the extension resorts to an NPAPI plugin (you can see in the source trunk that it bundles a .dll file, and that is open source (C++) too!).
It's not the best case scenario, Google discourages NAPAPI unless it's the only way (in this case, unfortunately, it is) due to security openings. The extension on the Chrome Web Store will ask for permission to "Access your data on your computer" which is seen negatively by wary users, especially and justifiably so if you don't take an effort to explain that general permission wording more clearly in your extension description.
Also the extension is targeted at Windows platforms, so you would have to look into specific NPAPI implementations for Linux and Mac if you need to support them.
Use the open source project RBTray on SourceForge. then you can minimize any window to the icon tray. Works on Windows 7.
Once you run it, you need to right-click on 'minimize' icon of any window (left-most one, the one that normally moves window to task bar). Window will be moved to system tray instead.
This extension exists:
https://chrome.google.com/extensions/detail/ajedaeoideoipodoijpbpabhhadnniac