From f6da6ffdc38824ac9ba5df3f13741808ed6df58a Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 9 Dec 2008 01:12:36 +0000 Subject: ignore error that greasemonkey was disabled. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26157 d0d07461-0603-4401-acd4-de1884942a52 --- ldrize_cooperation.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'ldrize_cooperation.js') diff --git a/ldrize_cooperation.js b/ldrize_cooperation.js index a15cabe..664ed21 100644 --- a/ldrize_cooperation.js +++ b/ldrize_cooperation.js @@ -1,6 +1,6 @@ // Vimperator plugin: 'Cooperation LDRize Mappings' // Version: 0.23 -// Last Change: 06-Dec-2008. Jan 2008 +// Last Change: 09-Dec-2008. Jan 2008 // License: Creative Commons // Maintainer: Trapezoid - http://unsigned.g.hatena.ne.jp/Trapezoid // @@ -168,20 +168,24 @@ return LDRizeCooperationPanel; }, hookGreasemonkey: function(){ - var self = this; - var GreasemonkeyService = Cc["@greasemonkey.mozdev.org/greasemonkey-service;1"].getService().wrappedJSObject; - this.addAfter(GreasemonkeyService,'evalInSandbox',function(code,codebase,sandbox){ - if(sandbox.window.LDRize != undefined && sandbox.window.Minibuffer != undefined){ - sandbox.window.addEventListener("focus",function(){ - self.LDRize = sandbox.LDRize; - self.Minibuffer = sandbox.Minibuffer.command; - },false); - if(window.content.wrappedJSObject == sandbox.unsafeWindow){ - self.LDRize = sandbox.LDRize; - self.Minibuffer = sandbox.Minibuffer.command; + try{ + var self = this; + var GreasemonkeyService = Cc["@greasemonkey.mozdev.org/greasemonkey-service;1"].getService().wrappedJSObject; + this.addAfter(GreasemonkeyService,'evalInSandbox',function(code,codebase,sandbox){ + if(sandbox.window.LDRize != undefined && sandbox.window.Minibuffer != undefined){ + sandbox.window.addEventListener("focus",function(){ + self.LDRize = sandbox.LDRize; + self.Minibuffer = sandbox.Minibuffer.command; + },false); + if(window.content.wrappedJSObject == sandbox.unsafeWindow){ + self.LDRize = sandbox.LDRize; + self.Minibuffer = sandbox.Minibuffer.command; + } } - } - }); + }); + }catch(e){ + liberator.log(e); + } }, initLDRizeCaptureKeys: function(keys){ var self = this; @@ -355,7 +359,7 @@ if(Math.abs(p.top - (scrollY + innerHeight/2)) > limit) return true; // scroll else return false; // bind }catch(e){ - log(e); + liberator.log(e); } }, -- cgit v1.2.3