diff --git a/defaults/preferences/prefs.js b/defaults/preferences/prefs.js new file mode 100644 index 0000000000000000000000000000000000000000..ebb49865f09f4984fe15f6f2a3f155475afb1d85 --- /dev/null +++ b/defaults/preferences/prefs.js @@ -0,0 +1,4 @@ +pref('extensions.id1-BoFifL9Vbdl2zQ@jetpack.addNotice', true); +pref('extensions.id1-BoFifL9Vbdl2zQ@jetpack.blockMissing', false); +pref('extensions.id1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist', ''); +pref('extensions.id1-BoFifL9Vbdl2zQ@jetpack.amountInjected', 0); diff --git a/lib/interceptor.js b/lib/interceptor.js index 0a3c260ab3ba05487a9d1639d8e41dd775e8a3a5..4c019958bd3bb3e19265df9c89f37ef4355b4d68 100644 --- a/lib/interceptor.js +++ b/lib/interceptor.js @@ -84,7 +84,7 @@ var Interceptor = new Class({ httpChannel.redirectTo(redirectionURI); //noinspection JSUnresolvedVariable - require('sdk/simple-prefs').prefs.amountBlocked++; + require('sdk/simple-prefs').prefs.amountInjected++; }, handleMissingCandidate: function (httpChannel) { @@ -94,9 +94,6 @@ var Interceptor = new Class({ if (blockMissing) { httpChannel.cancel(Cr.NS_ERROR_NOT_AVAILABLE); - - //noinspection JSUnresolvedVariable - require('sdk/simple-prefs').prefs.amountBlocked++; } } }); diff --git a/options.xul b/options.xul new file mode 100644 index 0000000000000000000000000000000000000000..63fa9e1e1acb950d4f636760bf13fed573abaea1 --- /dev/null +++ b/options.xul @@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <setting data-jetpack-id="id1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.id1-BoFifL9Vbdl2zQ@jetpack.addNotice" pref-name="addNotice" title="Add comments to locally fetched files" type="bool">Automatically prepend a notice to retrieved documents to signal local delivery.</setting> + <setting data-jetpack-id="id1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.id1-BoFifL9Vbdl2zQ@jetpack.blockMissing" pref-name="blockMissing" title="Block requests for missing resources" type="bool">Cancel intercepted request if the required resource is not locally available.</setting> + <setting data-jetpack-id="id1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.id1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist" pref-name="domainWhitelist" title="Exclude domains from inspections" type="string">Enter domains to whitelist them. Separate multipe entries with semi-colons (;).</setting> + <setting data-jetpack-id="id1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.id1-BoFifL9Vbdl2zQ@jetpack.amountInjected" pref-name="amountInjected" title="Counter for locally injected resources" type="integer">Amount of local Content Delivery Network resource injections since installation.</setting> +</vbox> diff --git a/package.json b/package.json index 604688c0cb966fd12a4052f1b08790e83627dcc1..abb8185f207411bc490b76e3b55fd744bf5ea3ac 100644 --- a/package.json +++ b/package.json @@ -11,35 +11,5 @@ "engines": { "firefox": ">=21.0", "fennec": ">=21.0" - }, - "preferences": [ - { - "description": "Automatically prepend a notice to retrieved documents to signal local delivery.", - "type": "bool", - "name": "addNotice", - "value": true, - "title": "Add comments to locally fetched files" - }, - { - "description": "Cancel intercepted request if the required resource is not locally available.", - "type": "bool", - "name": "blockMissing", - "value": false, - "title": "Block requests for missing resources" - }, - { - "description": "Enter domains to whitelist them. Separate multipe entries with semi-colons (;).", - "type": "string", - "name": "domainWhitelist", - "value": "", - "title": "Exclude domains from inspections" - }, - { - "description": "Amount of requests to Content Delivery Networks blocked since installation.", - "type": "integer", - "name": "amountBlocked", - "value": 0, - "title": "Counter for intercepted requests" - } - ] + } }