diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/formfiller | 36 | ||||
-rw-r--r-- | extensions/perdomainsettings | 3 | ||||
-rw-r--r-- | extensions/requestpolicy | 5 | ||||
-rw-r--r-- | extensions/unique_tabs | 5 | ||||
-rw-r--r-- | extensions/userscripts | 6 |
5 files changed, 29 insertions, 26 deletions
diff --git a/extensions/formfiller b/extensions/formfiller index 4196d198..a0c611c2 100644 --- a/extensions/formfiller +++ b/extensions/formfiller @@ -144,7 +144,6 @@ keepFormdata : false var config = {}; var passWord = null; var formData = null; -var exports = { }; var injectGetForm = function () //{{{ { @@ -285,10 +284,10 @@ function getFormData(callback) //{{{ var data; if (config.useGPG) { - if (data !== null) - return data; - if ((formData = exports.onRead())) - return JSON.parse(formData.replace(/\\"/g, '"')); + if (formData !== null) + return formData; + if ((data = formfiller.exports.onRead())) + return JSON.parse(data.replace(/\\"/g, '"')); if (!config.GPGAgent) getPassWord(); @@ -319,7 +318,7 @@ function getFormData(callback) //{{{ { try { - if ((data = onRead())) + if ((data = formfiller.exports.onRead())) return JSON.parse(data); else return JSON.parse(io.read(config.formData)); @@ -342,11 +341,10 @@ function onWrite() { return false; } function writeFormData(object) //{{{ { var written = true, ret; - io.print("foo"); if (config.useGPG) { var data = JSON.stringify(object).replace(/"/g, "\\\""); - if (exports.onWrite(data)) + if (formfiller.exports.onWrite(data)) return true; if (!(config.GPGAgent || config.GPGKeyID)) { @@ -371,7 +369,7 @@ function writeFormData(object) //{{{ } else { - if (exports.onWrite(config.formData)) + if (formfiller.exports.onWrite(config.formData)) return true; written = io.write(config.formData, "w", JSON.stringify(object, null, 2)); } @@ -476,19 +474,19 @@ function fillForm() //{{{ io.notify("Executed formfiller"); }//}}} -// init {{{ -return { +var formfiller = { defaultConfig : defaultConfig, - exports : exports, + exports : { + onRead : onRead, + onWrite : onWrite, + getForm : getForm, + fillForm : fillForm + }, init : function (c) { config = c; bind(config.scGetForm, getForm, "formfillerGet"); bind(config.scFillForm, fillForm, "formfillerFill"); - exports.config = config; - exports.onRead = onRead; - exports.onWrite = onWrite; - exports.getForm = getForm; - exports.fillForm = fillForm; + this.exports.config = config; return true; }, end : function () { @@ -496,6 +494,8 @@ return { unbind("formfillerFill"); return true; } -}//}}} +}; + +return formfiller; // vim: set ft=javascript: diff --git a/extensions/perdomainsettings b/extensions/perdomainsettings index 5f0b5ab8..91b7e4cc 100644 --- a/extensions/perdomainsettings +++ b/extensions/perdomainsettings @@ -227,7 +227,7 @@ function getDefaultValue(object) } } -return { +var perdomainsettings = { exports : exports, init : function (config) { @@ -251,5 +251,6 @@ return { signals.disconnect(onNavigation); } }; +return perdomainsettings; // vim: set ft=javascript: diff --git a/extensions/requestpolicy b/extensions/requestpolicy index 62e1d81e..4d0a66f3 100644 --- a/extensions/requestpolicy +++ b/extensions/requestpolicy @@ -84,8 +84,6 @@ Block requests from thirdparty domains permanently or just for a session, whitelisting support INFO>*/ -var me = "requestpolicy"; - var defaultConfig = { //<DEFAULT_CONFIG // path to a whitelist @@ -431,7 +429,7 @@ function disconnect() } }); }//}}} -return { +var requestpolicy = { defaultConfig : defaultConfig, init : function(c) { @@ -464,4 +462,5 @@ return { unbind("requestpolicyUnblockAll"); } }; +return requestpolicy; // vim: set ft=javascript: diff --git a/extensions/unique_tabs b/extensions/unique_tabs index cd52c659..3496a1c3 100644 --- a/extensions/unique_tabs +++ b/extensions/unique_tabs @@ -98,7 +98,7 @@ var toggleAutoFocus = function() } }; -return { +var uniqueTabs = { defaultConfig : defaultConfig, init : function(c) { if (c.shortcutRemoveDuplicates || c.commandRemoveDuplicates) @@ -120,6 +120,7 @@ return { disconnectAutoFocus(); return true; } -} +}; +return uniqueTabs; // vim:set ft=javascript: diff --git a/extensions/userscripts b/extensions/userscripts index 689b07de..76709ec3 100644 --- a/extensions/userscripts +++ b/extensions/userscripts @@ -202,7 +202,7 @@ function matchIncludeExclude(frame, items) //{{{ } catch(e) { - extensions.error(me, e); + script.debug(e); } } return false; @@ -535,7 +535,7 @@ function parseScripts(scripts) //{{{ return userscriptsStart(); }//}}} -return { +var userscripts = { init : function (c) { return parseScripts(c ? c.scripts || [] : []); }, @@ -552,4 +552,6 @@ return { } }; +return userscripts; + // vim: set ft=javascript: |