Skip to content

Instantly share code, notes, and snippets.

@froop
Created May 10, 2011 22:38
Show Gist options
  • Save froop/965530 to your computer and use it in GitHub Desktop.
Save froop/965530 to your computer and use it in GitHub Desktop.
[JavaScript] Firefox4+Greasemonkey のバグ。ページ表示タイミングでalertするとsetTimeoutやAjaxが無応答
// ==UserScript==
// @include http://www.google.co.jp/*
// ==/UserScript==
alert(1); setTimeout(function() { alert(2) }, 0);
@froop
Copy link
Author

froop commented May 12, 2011

回避策は、直接のalertをsetTimeoutで間接的な形に変える。
setTimeout(function() { alert(1) }, 0);
setTimeout(function() { alert(2) }, 0);

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