基本上,这个脚本检查用户是否正在运行某个插件,如果是,它会显示一个警报......问题是在它显示警报之后 Firefox 的旋转轮一直在旋转,就像它在等待某些东西一样。如果我刷新页面,脚本不起作用......
这是代码:
<script language="javascript">
var isInstalled = false;
function run_if_true() {
isInstalled = true;
document.write("Your addon is installed\n<br>");alert("a");
}
function check_installed() {
if (isInstalled==false) {
document.write("Not installed"); // You can instead have an alert here
} else {
document.write("is installed");
}
}
</script>
</head>
<body onload="javascript:check_installed()">
testing!
<img src="chrome://fil/content/sd.gif"
width="0"
height="0"
onload="javascript: run_if_true()"
style="visibility:hidden">
</body>
</html>