aboutsummaryrefslogtreecommitdiffstats
path: root/delicious_search.js
diff options
context:
space:
mode:
authorzentooo2011-03-23 21:38:43 +0900
committerzentooo2011-03-23 21:38:43 +0900
commit3d5ddeb73ce8e506abebda51ab6ca4f3e9bf2704 (patch)
tree2a686d73009074c694fc3925561ff2baf7c7d4ef /delicious_search.js
parent163b04336aed764216d4a8231b1cb11af04a1e49 (diff)
downloadvimperator-plugins-3d5ddeb73ce8e506abebda51ab6ca4f3e9bf2704.tar.bz2
for Firefox4.0
Diffstat (limited to 'delicious_search.js')
-rw-r--r--delicious_search.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/delicious_search.js b/delicious_search.js
index a66aa7f..3f431ca 100644
--- a/delicious_search.js
+++ b/delicious_search.js
@@ -6,7 +6,7 @@ let PLUGIN_INFO =
<author mail="teramako@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/teramako/">teramako</author>
<version>0.3</version>
<minVersion>2.0pre</minVersion>
-<maxVersion>2.0</maxVersion>
+<maxVersion>4.0</maxVersion>
<detail><![CDATA[
== Command ==
:ds[earch] -tags tag, ...:
@@ -44,10 +44,16 @@ set go-=D
liberator.plugins.delicious = (function(){
let uuid = PLUGIN_INFO.require[0].@id.toString();
-if (Application.extensions.has(uuid) && Application.extensions.get(uuid).enabled){
- const ydls = Cc["@yahoo.com/nsYDelLocalStore;1"].getService(Ci.nsIYDelLocalStore);
-} else {
- return null;
+let ydls = null;
+if ( typeof Application.extensions === "object" && Application.extensions.has(uuid) && Application.extensions.get(uuid).enabled ){
+ ydls = Cc["@yahoo.com/nsYDelLocalStore;1"].getService(Ci.nsIYDelLocalStore);
+}
+else if ( typeof Application.getExtensions === "function" ) {
+ Application.getExtensions(function(extensions) {
+ if ( extensions.has(uuid) && extensions.get(uuid).enabled ) {
+ ydls = Cc["@yahoo.com/nsYDelLocalStore;1"].getService(Ci.nsIYDelLocalStore);
+ }
+ });
}
const ss = Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService);
@@ -170,6 +176,8 @@ function bookmarkSearch(tags, query){
tags: ydls.getTags(url, {})
});
}
+ } catch (e) {
+ liberator.echoerr(e);
} finally {
st.reset();
if (finalize) st.finalize();