基本的に、このスクリプトは、ユーザーが特定のアドオンを実行しているかどうかを確認します。実行している場合は、アラートを表示します...問題は、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>