
LiveHosts
这个扩展以次优的方式解决了一个常见的开发者难题:在多个环境中快速切换主机名和IP地址。
更新日期:2022 年 3 月 29 日分类标签:开发者利器平台:没限制
57.78KiB 10000 人已下载
LiveHosts 插件安装教程:
扩展迷 | chrome插件下载与安装教程(图文讲解,全网最详细)
LiveHosts 插件简介:
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
LiveHosts 插件ID:
hdpoplemgeaioijkmoebnnjcilfjnjdi
LiveHosts 插件最新版本:
2.0.0