Compare Chrome extensions: LiveHosts vs Domain Switcher

Stats LiveHosts LiveHosts Domain Switcher Domain Switcher
User count 10,000+ 2,000+
Average rating 3.47 4.59
Rating count 36 29
Last updated 2022-03-29 2016-05-24
Size 59.17K 1.10M
Version 2.0.0 0.6.1
Short description
Switch your host/IP mappings in real time without editing your hosts file Simplify web development by easily switching domains between specified URL groups.
Full summary

LiveHosts is a Chrome extension that aims at providing a working (even if sub-obtimal) solution to a common nuisance that many web developers have to deal with every day. If you have multiple versions of your websites sharing the same host names on multiple environments, you often need to switch the assignments in your OS hosts file.

Other extensions (like the life-saving HostAdmin) can help with the cumbersomeness, but changes to the hosts file usually take an inconvenient amount of time to actually affect the browser.

Unfortunately, there is no way to make Chrome direct requests for a hostname to a specific IP without a standard redirect - you could set up a smart HTTP proxy, but it's often not possible or not convenient.

This extension settles for a sub-obtimal approach: requests to the indicated hostnames are redirected to the chosen IPs with an additional Host header. The browser's address bar reflects this behaviour showing the hostname right after the IP (e.g. http://127.0.0.1/www.example.com/). The extension also tries to take care of all requests to either the IP or the hostname in a consistent way.

Issues

After the redirect, the user is effectively in a different domain that the one they expected. They may notice some functional differences:

  • depending on the server, parts of a web page referring to the site URL (like href and src attributes) could be different from the original
  • window.location has a different value that can potentially throw off JavaScript snippets
  • most Cross-Origin request won't work

As a developer, it can be a hassle to switch between various environments (e.g. dev, uat, prod). This extension is designed to allow the developer to quickly swap environments when they are on a page while keeping their path intact.

Domain Switcher allows you to organize the environments for the various projects you work on. Simply create a "project" on the options page and enter the associated domains for the various environments for the project. We'll do the rest, and you'll be able to simply switch between environments by clicking the arrow icon in your address bar when you are on a page that matches one of your project environments.

For example, if you are working on a project about "coffee", you could enter environments: "localhost:3000", "test.coffee.com", "coffee.com". Then, when you are on any of these domains, you will have an icon in your URL bar that will allow you to switch to the other environments. The path of the page you are on is preserved in the URL.

This extension is open-source and hosted on GitHub. If you find an issue, help out by posting it there as an issue or submit a pull request. https://github.com/stevehanson/domain-switcher-chrome