aboutsummaryrefslogtreecommitdiffstats
path: root/direct_bookmark.js
diff options
context:
space:
mode:
authormattn2008-06-04 09:49:58 +0000
committermattn2008-06-04 09:49:58 +0000
commit5ec727c96bbf74a74a83172761928a8029ffb1b8 (patch)
tree012715a53d08cc6565e9951a2eb44d2e9469a95a /direct_bookmark.js
parentab90ee56dcf403b6506e30c8c95d72551887cf28 (diff)
downloadvimperator-plugins-5ec727c96bbf74a74a83172761928a8029ffb1b8.tar.bz2
* Components.utils.evalInSandboxが使えるなら、そちらを使う様に修正
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@13217 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'direct_bookmark.js')
-rw-r--r--direct_bookmark.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/direct_bookmark.js b/direct_bookmark.js
index f1334f3..10e4a6a 100644
--- a/direct_bookmark.js
+++ b/direct_bookmark.js
@@ -1,6 +1,6 @@
// Vimperator plugin: 'Direct Post to Social Bookmarks'
-// Version: 0.08
-// Last Change: 03-Jun-2008. Jan 2008
+// Version: 0.09
+// Last Change: 04-Jun-2008. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
// Parts:
@@ -46,12 +46,22 @@
// ':bicon'
// Show Bookmark Count as Icon
(function(){
+ var evalFunc = window.eval;
+ try {
+ var sandbox = new Components.utils.Sandbox(window);
+ if (Components.utils.evalInSandbox("true", sandbox) === true) {
+ evalFunc = function(text) {
+ return Components.utils.evalInSandbox(text, sandbox);
+ }
+ }
+ } catch(e) { liberator.log('warning: wassr.js is working with unsafe sandbox.'); }
+
var useServicesByPost = liberator.globalVariables.direct_sbm_use_services_by_post || 'hdl';
var useServicesByTag = liberator.globalVariables.direct_sbm_use_services_by_tag || 'hdl';
var isNormalize = liberator.globalVariables.direct_sbm_is_normalize ?
- window.eval(liberator.globalVariables.direct_sbm_is_normalize) : true;
+ evalFunc(liberator.globalVariables.direct_sbm_is_normalize) : true;
var isUseMigemo = liberator.globalVariables.direct_sbm_is_use_migemo ?
- window.eval(liberator.globalVariables.direct_sbm_is_use_migemo) : true;
+ evalFunc(liberator.globalVariables.direct_sbm_is_use_migemo) : true;
var XMigemoCore;
try{
@@ -380,7 +390,7 @@
xhr.open("GET", feed_url + user + "?raw", false, user, password);
xhr.send(null);
- var tags = window.eval("(" + xhr.responseText + ")");
+ var tags = evalFunc("(" + xhr.responseText + ")");
for(var tag in tags)
returnValue.push(tag);
liberator.echo("del.icio.us: Tag parsing is finished. Taglist length: " + returnValue.length);