Skip to Content

What is Loc on Chrome?

What is Loc on Chrome?

Loc is a tool in Google Chrome that allows web developers to test how their website looks and functions on mobile devices. It emulates different screen sizes, operating systems, and device features to provide an accurate mobile viewing experience directly in the Chrome browser.

What Does Loc Stand For?

Loc stands for “location.” It refers to emulating the location and features of a mobile device while browsing the web on a desktop computer.

How Does Loc Work?

Loc works by overriding the user agent string in Chrome. The user agent provides information to websites about the device and browser being used for access. When Loc is enabled, Chrome sends a mobile user agent string to websites instead of a desktop user agent string.

For example, with Loc enabled, Chrome may identify itself as an Apple iPhone or Samsung Galaxy smartphone. This tricks websites into serving the mobile version of their site as if it were being accessed on an actual mobile device.

Key Features of Loc

Here are some of the key features of Loc in Chrome:

  • Emulate popular mobile and tablet devices such as iPhone, iPad, and various Android phones and tablets.
  • Adjust screen size resolution presets for common device displays.
  • Rotate screen orientation between portrait and landscape modes.
  • Simulate touch events like tap, scroll, and zoom.
  • Override geolocation and GPS coordinates.
  • Throttle CPU and network speed to emulate slower mobile processors and data connections.
  • Clear storage and cookies to simulate a new device.

With these capabilities, Loc provides a fairly robust mobile simulation directly within the desktop Chrome browser. Web developers can see exactly how their site will look and handle across different mobile platforms.

How to Enable Loc in Chrome

Using Loc in Chrome is easy. Follow these steps:

  1. Open Google Chrome on your desktop computer.
  2. Click the 3-dot menu button in the top right and select More Tools > Developer Tools.
  3. Click the Toggle Device Toolbar button shaped like a phone/tablet. This opens the Loc toolbar.
  4. Select a device preset from the dropdown menu like iPhone X or iPad Pro.
  5. The browser viewport will adjust to match the selected device size. You can now browse the web as if on that device.
  6. Adjust additional options like orientation and touch simulation in the Loc toolbar as needed.

That’s all there is to it! Loc is enabled whenever the Device Toolbar is open. Close the toolbar or hit Escape to exit Loc mode and return to normal desktop browsing.

Popular Loc Device Presets

Loc comes preloaded with many common real-world device profiles. Some of the most popular include:

Device Screen Resolution
iPhone X 1125 x 2436 pixels
Samsung Galaxy S9 1440 x 2960 pixels
iPad Pro 1024 x 1366 pixels
Kindle Fire HDX 1200 x 1920 pixels

There are also generic options like Mobile Small, Mobile Medium, and Mobile Large without being tied to a specific device model. The resolutions can be customized as needed.

Key Benefits of Using Loc

Why should web developers use Loc for mobile testing? Here are some of the key benefits:

  • Convenient – Test mobile right from the desktop browser with no emulator required.
  • Realistic – Emulate actual device capabilities versus theoretical emulation.
  • Fast – Get quick feedback on mobile site issues during development.
  • Free – Loc comes built-in to Chrome at no extra cost.
  • Powerful – Supports a wide range of device profiles and settings.
  • Integrated – Works seamlessly with Chrome Developer Tools for debugging.

For these reasons, Loc can be an invaluable tool for web developers to test responsiveness and mobile compatibility during site creation.

Limitations of Loc

However, Loc does have some limitations to be aware of:

  • Does not emulate all mobile features perfectly such as HW acceleration.
  • Desktop mouse input differs from real touchscreen interaction.
  • Only impacts Chrome, so other mobile browsers still need testing.
  • Hardware specifics like CPU and memory are not simulated.
  • Relies on screen size which may differ from actual render size.

Due to these constraints, Loc should not be used as the only mobile testing technique. Real physical devices still provide the most accurate testing experience.

Using Loc for Accurate Mobile Testing

Here are some best practices for using Loc effectively:

  • Test on real mobile devices in addition to Loc emulation.
  • Use Loc early in development for quick iteration and feedback.
  • Verify key site interactions like taps, swipes, and pinches.
  • Check multiple device profiles instead of just one or two.
  • Throttle network and CPU to test performance impairments.
  • Combine with other tools like Chrome DevTools for robust testing.

Following these tips will help ensure Loc provides an accurate mobile simulation during site development.

Other Similar Tools

Loc is not the only option for mobile testing in desktop browsers. Some other tools to consider:

  • Responsive Design Mode in Firefox dev tools.
  • BrowserStack – Cross-browser testing with many device labs.
  • Sauce Labs – Manual and automated mobile testing.
  • LambdaTest – Real device testing in the cloud.
  • Emulators like Android Studio and Xcode.

However, Loc remains a top choice for its tight Chrome integration, ease of use, and ability to toggle quickly during development.

Conclusion

In summary, Loc is an invaluable tool for web developers to test responsiveness and mobile compatibility right within the Chrome browser. It provides a convenient and realistic way to emulate many different mobile devices during site creation.

However, Loc does have limitations versus testing on actual mobile hardware. It should be combined with real devices and other tools as part of a comprehensive mobile testing strategy.

When used properly, Loc empowers developers to build highly responsive cross-device experiences, ensuring their sites work flawlessly for all users no matter how they choose to access the web.