aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--maine_coon.js22
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;
};