diff options
author | anekos | 2010-06-21 16:52:26 +0000 |
---|---|---|
committer | anekos | 2010-06-21 16:52:26 +0000 |
commit | 5a1870e3c8cb8bbd77d2e5776af0ba0e365a3ac4 (patch) | |
tree | 3bfd2e302b53ee9beb797038164dd05e0b2fe038 /maine_coon.js | |
parent | 74bbfb98ed34060680e38f96fc9bf61d835dce20 (diff) | |
download | vimperator-plugins-5a1870e3c8cb8bbd77d2e5776af0ba0e365a3ac4.tar.bz2 |
エラー処理?
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37853 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'maine_coon.js')
-rw-r--r-- | maine_coon.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/maine_coon.js b/maine_coon.js index d9e4f39..6bda3e7 100644 --- a/maine_coon.js +++ b/maine_coon.js @@ -291,16 +291,22 @@ let elemStyle = doc.body.appendChild(elem); let count = time; let handle = setInterval(function () { - if (count <= 0) { - if (remove) - remove(); - } else { - elem.style.MozOpacity = count / time; + try { + if (count <= 0) { + if (remove) + remove(); + } else { + elem.style.MozOpacity = count / time; + } + count--; + } catch (e) { // XXX ほんとは DOM 関連だけキャッチしたい + remove(true); + liberator.log(e); } - count--; }, 100); - remove = function () { - doc.body.removeChild(elem); + remove = function (noDOM) { + if (!noDOM) + doc.body.removeChild(elem); clearInterval(handle); remove = null; }; |