X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=dot-files%2F_vimperator%2Fplugin%2F_libly_js;h=1ff4600fac9a01aa5e2231c6d1b85769c5f663e4;hb=a807b4609220d6a60673008b962d2456d4ccebb7;hp=be989d7266f66a0a7ea9c5c42cb602f752e2aa78;hpb=64d8d84fc0220ed2081380d870ed4713b89e4803;p=sugar.git diff --git a/dot-files/_vimperator/plugin/_libly_js b/dot-files/_vimperator/plugin/_libly_js index be989d7..1ff4600 100644 --- a/dot-files/_vimperator/plugin/_libly_js +++ b/dot-files/_vimperator/plugin/_libly_js @@ -246,9 +246,10 @@ libly.$U = {//{{{ function getPluginPath () { let pluginPath; Error('hoge').stack.split(/\n/).some( - function (s) - let (m = s.match(/-> liberator:\/\/template\/chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/)) - (m && (pluginPath = m[1].replace(/\?.*$/, ''))) + function (s) { + let m = s.match(/@chrome:\/\/liberator\/content\/liberator\.js -> file:\/\/\/(.+):\d+$/); + (m && (pluginPath = m[1].replace(/\?.*$/, ''))); + } ); return pluginPath; } @@ -280,7 +281,7 @@ libly.$U = {//{{{ } original = obj[name]; let current = obj[name] = function () { - let self = this, args = arguments; + let self = this, args = Array.prototype.slice.call(arguments); return func.call(self, function (_args) original.apply(self, _args || args), args); }; libly.$U.extend(current, {original: original && original.original || original, restore: restore}); @@ -311,9 +312,8 @@ libly.$U = {//{{{ evalJson: function(str, toRemove) { var json; try { - json = Components.classes['@mozilla.org/dom/json;1'].getService(Components.interfaces.nsIJSON); if (toRemove) str = str.substring(1, str.length - 1); - return json.decode(str); + return JSON.parse(str); } catch (e) { return null; } }, dateFormat: function(dtm, fmt) {