Skip to content

Instantly share code, notes, and snippets.

@Gaubee
Last active December 21, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gaubee/6247299 to your computer and use it in GitHub Desktop.
Save Gaubee/6247299 to your computer and use it in GitHub Desktop.
firebug-lite搭建在本地,供虚拟机上的IE调试用

firebug-lite下载地址https://getfirebug.com/releases/lite/latest/firebug-lite.tar.tgz

下载完后直接搭建在本地80端口上,我的80端口是php服务器,支持文件夹路由,所以直接把压缩包解压到www文件夹下

IE6~8都是在虚拟机中调试,要连接Ubuntu上的端口不能用localhost,需要先获取本地IP地址:

$ ifconfig

找到wlan0的ip,比如说是: 192.168.0.109 。所以在虚拟机中的访问地址是 localtion.hastname + location.port + $fire_path

因此需要动态写入scrtpt的src:

(function(ie) {
	if (!ie) return;
	var b = document.createElement("script");
	b.setAttribute("type", "text/javascript");
	b.setAttribute("src", "http://" + location.hostname + "/firebug-lite/build/firebug-lite.js");
	document.getElementsByTagName("head")[0].appendChild(b)
}(!+"\v1"));

仅仅给IE调试使用,所以用 !+"\v1" 来判定是够是IE是最简单不过了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment