Skip to content

Instantly share code, notes, and snippets.

@mala
Created March 8, 2013 04:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mala/5114296 to your computer and use it in GitHub Desktop.
Save mala/5114296 to your computer and use it in GitHub Desktop.
Firefoxのフィッシング/マルウェアブロックが有効かどうか検出するコード
<script>
var now = Date.now();
var phishing;
var malware;
var p_loaded = false;
var m_loaded = false;
</script>
<script src="http://www.mozilla.org/firefox/its-a-trap.html" onerror="phishing=Date.now()-now;p_loaded=true"></script>
<script src="http://www.mozilla.org/firefox/its-an-attack.html" onerror="malware=Date.now()-now;m_loaded=true"></script>
<script>
var timer = setInterval(function(){
if (Date.now() - now > 1000) {
document.write(" maybe phishing/malware protection is disabled");
document.close();
clearInterval(timer);
} else {
if(!p_loaded && !m_loaded) return;
p_loaded ? document.write("phishing:"+ phishing + "ms, phishing protection is enabled" + "<br>") : document.write("phishing protection is disabled<br>");
m_loaded ? document.write("malware:"+ malware + "ms, malware protection is enabled" + "<br>") : document.write("malware protection is disabled<br>");
document.close();
clearInterval(timer);
}
}, 100);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment