├── LICENSE.txt ├── Makefile ├── Plugin ├── Makefile ├── chrome.manifest ├── chrome │ └── content │ │ ├── attribute.js │ │ ├── attribute.xul │ │ ├── browser.xul │ │ ├── canvasFingerprinting.xul │ │ ├── jquery-2.1.0.min.js │ │ ├── options.js │ │ ├── options.xul │ │ ├── overlay.js │ │ ├── thirdparties.js │ │ ├── thirdparties.xul │ │ ├── webidentities.css │ │ ├── webidentities.js │ │ └── webidentities.xul ├── defaults │ └── preferences │ │ └── defaults.js ├── icon.png ├── install.rdf ├── locale │ └── en-US │ │ └── translations.dtd ├── modules │ ├── detection.jsm │ ├── httpRequestObserver.jsm │ ├── preferencesObserver.jsm │ ├── profiles.jsm │ ├── randomFingerprintGenerator.jsm │ ├── responseListener.jsm │ └── webIdentity.jsm ├── profiles │ ├── chrome.json │ ├── firefox.json │ ├── opera.json │ └── safari.json └── skin │ ├── ajax-loader.gif │ ├── allow.png │ ├── block.png │ ├── cancel.png │ ├── collapsed.png │ ├── error.png │ ├── expanded.png │ ├── facebook-allowed.png │ ├── facebook-blocked.png │ ├── flash-allowed.png │ ├── flash-blocked.png │ ├── googleplus-allowed.png │ ├── googleplus-blocked.png │ ├── help.png │ ├── icon32-disabled.png │ ├── icon32.png │ ├── icon64-disabled.png │ ├── icon64.png │ ├── linkedin-allowed.png │ ├── linkedin-blocked.png │ ├── logo.png │ ├── other-allowed.png │ ├── other-blocked.png │ ├── pinterest-allowed.png │ ├── pinterest-blocked.png │ ├── private-browsing.png │ ├── quicktime-allowed.png │ ├── quicktime-blocked.png │ ├── settings.png │ ├── silverlight-allowed.png │ ├── silverlight-blocked.png │ ├── skin.css │ ├── spoof.png │ ├── toolbar-disabled.png │ ├── toolbar-icon.png │ ├── tumblr-allowed.png │ ├── tumblr-blocked.png │ ├── twitter-allowed.png │ ├── twitter-blocked.png │ ├── vlc-allowed.png │ └── vlc-blocked.png └── README.md /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | plugindir=Plugin 2 | 3 | all: ${plugindir}/* 4 | $(MAKE) -C $(plugindir) 5 | -------------------------------------------------------------------------------- /Plugin/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | zip -9r ../FP-Block.xpi * 3 | zip -d ../FP-Block.xpi Makefile README.txt *.DS_Store* 4 | -------------------------------------------------------------------------------- /Plugin/chrome.manifest: -------------------------------------------------------------------------------- 1 | content fpblock chrome/content/ 2 | content fpblock chrome/content/ contentaccessible=yes 3 | resource modules modules/ 4 | resource profiles profiles/ 5 | overlay chrome://browser/content/browser.xul chrome://fpblock/content/browser.xul 6 | 7 | locale fpblock en-US locale/en-US/ 8 | 9 | skin fpblock classic/1.0 skin/ 10 | style chrome://global/content/customizeToolbar.xul chrome://fpblock/skin/skin.css -------------------------------------------------------------------------------- /Plugin/chrome/content/attribute.js: -------------------------------------------------------------------------------- 1 | /****************************************************************/ 2 | /* -- FP-Block -- */ 3 | /* Author: Christof Ferreira Torres */ 4 | /* Date: 02.02.2015 */ 5 | /****************************************************************/ 6 | 7 | Components.utils.import("resource://modules/webIdentity.jsm"); 8 | Components.utils.import("resource://modules/detection.jsm"); 9 | Components.utils.import("resource://modules/randomFingerprintGenerator.jsm"); 10 | 11 | // Called once when the dialog displays 12 | function onLoad() { 13 | if (window.arguments != null) { 14 | // Get web identity 15 | var webID = webIdentity.getWebIdentity(window.arguments[0].url); 16 | // Get attribute 17 | var attribute = detection.getAttribute(window.arguments[0].url, window.arguments[0].name); 18 | // Set the domain name 19 | document.getElementById('domain-name').value = "Domain: "+webID.domain; 20 | // Set the attribute name 21 | document.getElementById('attribute-name').value = attribute.name; 22 | // Set the attribute action 23 | document.getElementById('attribute-action').value = attribute.action; 24 | 25 | document.getElementById('attribute-action').getItemAtIndex(1).hidden = false; 26 | document.getElementById('attribute-label-value').hidden = true; 27 | document.getElementById('attribute-value').hidden = true; 28 | 29 | if (attribute.name == 'App Code Name') { 30 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.appCodeName; 31 | document.getElementById('attribute-label-value').hidden = false; 32 | document.getElementById('attribute-value').hidden = false; 33 | } else 34 | if (attribute.name == 'App Name') { 35 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.appName; 36 | document.getElementById('attribute-label-value').hidden = false; 37 | document.getElementById('attribute-value').hidden = false; 38 | } else 39 | if (attribute.name == 'App Version') { 40 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.appVersion; 41 | document.getElementById('attribute-label-value').hidden = false; 42 | document.getElementById('attribute-value').hidden = false; 43 | } else 44 | if (attribute.name == 'Language') { 45 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.language; 46 | document.getElementById('attribute-label-value').hidden = false; 47 | document.getElementById('attribute-value').hidden = false; 48 | } else 49 | if (attribute.name == 'OS CPU') { 50 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.oscpu; 51 | document.getElementById('attribute-label-value').hidden = false; 52 | document.getElementById('attribute-value').hidden = false; 53 | } else 54 | if (attribute.name == 'Platform') { 55 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.platform; 56 | document.getElementById('attribute-label-value').hidden = false; 57 | document.getElementById('attribute-value').hidden = false; 58 | } else 59 | if (attribute.name == 'Product') { 60 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.product; 61 | document.getElementById('attribute-label-value').hidden = false; 62 | document.getElementById('attribute-value').hidden = false; 63 | } else 64 | if (attribute.name == 'User-Agent') { 65 | document.getElementById('attribute-value').value = webID.fingerprint.useragent; 66 | document.getElementById('attribute-label-value').hidden = false; 67 | document.getElementById('attribute-value').hidden = false; 68 | } else 69 | if (attribute.name == 'Vendor') { 70 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.vendor; 71 | document.getElementById('attribute-label-value').hidden = false; 72 | document.getElementById('attribute-value').hidden = false; 73 | } else 74 | if (attribute.name == 'CPU Class') { 75 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.cpuClass; 76 | document.getElementById('attribute-label-value').hidden = false; 77 | document.getElementById('attribute-value').hidden = false; 78 | } else 79 | if (attribute.name == 'System Language') { 80 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.systemLanguage; 81 | document.getElementById('attribute-label-value').hidden = false; 82 | document.getElementById('attribute-value').hidden = false; 83 | } else 84 | if (attribute.name == 'User Language') { 85 | document.getElementById('attribute-value').value = webID.fingerprint.navigator.userLanguage; 86 | document.getElementById('attribute-label-value').hidden = false; 87 | document.getElementById('attribute-value').hidden = false; 88 | } else 89 | if (attribute.name == 'Screen Height') { 90 | document.getElementById('attribute-value').value = webID.fingerprint.screen.height; 91 | document.getElementById('attribute-label-value').hidden = false; 92 | document.getElementById('attribute-value').hidden = false; 93 | } else 94 | if (attribute.name == 'Screen Width') { 95 | document.getElementById('attribute-value').value = webID.fingerprint.screen.width; 96 | document.getElementById('attribute-label-value').hidden = false; 97 | document.getElementById('attribute-value').hidden = false; 98 | } else 99 | if (attribute.name == 'Color Depth') { 100 | document.getElementById('attribute-value').value = webID.fingerprint.screen.colorDepth; 101 | document.getElementById('attribute-label-value').hidden = false; 102 | document.getElementById('attribute-value').hidden = false; 103 | } else 104 | if (attribute.name == 'Available Height') { 105 | document.getElementById('attribute-value').value = webID.fingerprint.screen.availHeight; 106 | document.getElementById('attribute-label-value').hidden = false; 107 | document.getElementById('attribute-value').hidden = false; 108 | } else 109 | if (attribute.name == 'Available Width') { 110 | document.getElementById('attribute-value').value = webID.fingerprint.screen.availWidth; 111 | document.getElementById('attribute-label-value').hidden = false; 112 | document.getElementById('attribute-value').hidden = false; 113 | } else 114 | if (attribute.name == 'Pixel Depth') { 115 | document.getElementById('attribute-value').value = webID.fingerprint.screen.pixelDepth; 116 | document.getElementById('attribute-label-value').hidden = false; 117 | document.getElementById('attribute-value').hidden = false; 118 | } else 119 | if (attribute.name == 'Timezone') { 120 | document.getElementById('attribute-value').value = webID.fingerprint.date.timezoneOffset; 121 | document.getElementById('attribute-label-value').hidden = false; 122 | document.getElementById('attribute-value').hidden = false; 123 | } else { 124 | document.getElementById('attribute-action').getItemAtIndex(1).hidden = true; 125 | } 126 | } 127 | } 128 | 129 | function actionSelected() { 130 | // Enable respectively disable the attribute value if the seleted action is 'spoof' 131 | if (document.getElementById('attribute-action').value == 'spoof') { 132 | document.getElementById('attribute-value').disabled = false; 133 | } else { 134 | document.getElementById('attribute-value').disabled = true; 135 | } 136 | } 137 | 138 | function acceptEdit() { 139 | // Display warning 140 | alert('Warning: Modifying the value of an attribute can break consistency!'); 141 | // Get web identity 142 | var webID = webIdentity.getWebIdentity(window.arguments[0].url); 143 | // Get attribute 144 | var attribute = detection.getAttribute(window.arguments[0].url, window.arguments[0].name); 145 | // Save the attribute action 146 | attribute.action = document.getElementById('attribute-action').value; 147 | // Save the edited attribute 148 | if (document.getElementById('attribute-action').value == 'spoof') { 149 | if (attribute.name == 'App Code Name') { 150 | webID.fingerprint.navigator.appCodeName = document.getElementById('attribute-value').value; 151 | } else 152 | if (attribute.name == 'App Name') { 153 | webID.fingerprint.navigator.appName = document.getElementById('attribute-value').value; 154 | } else 155 | if (attribute.name == 'App Version') { 156 | webID.fingerprint.navigator.appVersion = document.getElementById('attribute-value').value; 157 | } else 158 | if (attribute.name == 'Language') { 159 | webID.fingerprint.navigator.language = document.getElementById('attribute-value').value; 160 | } else 161 | if (attribute.name == 'OS CPU') { 162 | webID.fingerprint.navigator.oscpu = document.getElementById('attribute-value').value; 163 | } else 164 | if (attribute.name == 'Platform') { 165 | webID.fingerprint.navigator.platform = document.getElementById('attribute-value').value; 166 | } else 167 | if (attribute.name == 'Product') { 168 | webID.fingerprint.navigator.product = document.getElementById('attribute-value').value; 169 | } else 170 | if (attribute.name == 'User-Agent') { 171 | webID.fingerprint.useragent = document.getElementById('attribute-value').value; 172 | } else 173 | if (attribute.name == 'Vendor') { 174 | webID.fingerprint.navigator.vendor = document.getElementById('attribute-value').value; 175 | } else 176 | if (attribute.name == 'CPU Class') { 177 | webID.fingerprint.navigator.cpuClass = document.getElementById('attribute-value').value; 178 | } else 179 | if (attribute.name == 'System Language') { 180 | webID.fingerprint.navigator.systemLanguage = document.getElementById('attribute-value').value; 181 | } else 182 | if (attribute.name == 'User Language') { 183 | webID.fingerprint.navigator.userLanguage = document.getElementById('attribute-value').value; 184 | } else 185 | if (attribute.name == 'Screen Height') { 186 | webID.fingerprint.screen.height = document.getElementById('attribute-value').value; 187 | } else 188 | if (attribute.name == 'Screen Width') { 189 | webID.fingerprint.screen.width = document.getElementById('attribute-value').value; 190 | } else 191 | if (attribute.name == 'Color Depth') { 192 | webID.fingerprint.screen.colorDepth = document.getElementById('attribute-value').value; 193 | } else 194 | if (attribute.name == 'Available Height') { 195 | webID.fingerprint.screen.availHeight = document.getElementById('attribute-value').value; 196 | } else 197 | if (attribute.name == 'Available Width') { 198 | webID.fingerprint.screen.availWidth = document.getElementById('attribute-value').value; 199 | } else 200 | if (attribute.name == 'Pixel Depth') { 201 | webID.fingerprint.screen.pixelDepth = document.getElementById('attribute-value').value; 202 | } else 203 | if (attribute.name == 'Timezone') { 204 | webID.fingerprint.date.timezoneOffset = document.getElementById('attribute-value').value; 205 | } 206 | } 207 | // Save the new generated hash 208 | webID.hash = randomFingerprintGenerator.generateHash(webID.fingerprint); 209 | } 210 | -------------------------------------------------------------------------------- /Plugin/chrome/content/attribute.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Canvas fingerprinting detection 41 | This website attempted to 42 | access image data on a canvas. Since canvas image data can be 43 | used to discover information about your computer, FP-Block 44 | returned the original image data with some random noise added 45 | to it. 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Plugin/chrome/content/options.js: -------------------------------------------------------------------------------- 1 | /****************************************************************/ 2 | /* -- FP-Block -- */ 3 | /* Author: Christof Ferreira Torres */ 4 | /* Date: 26.08.2015 */ 5 | /****************************************************************/ 6 | 7 | window.onload = function() { 8 | getAddonNameVer(function(addon) { 9 | document.getElementById('version').value = addon.name + " " + addon.version; 10 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 11 | if (fpblockpreferences.getCharPref('latestfetch') == '') { 12 | document.getElementById('latest-fetch').value = "Last time fetched: never"; 13 | } else { 14 | var latestfetch = new Date(parseInt(fpblockpreferences.getCharPref('latestfetch'))); 15 | var day = (String(latestfetch.getDate()).length == 1) ? "0" + latestfetch.getDate() : latestfetch.getDate(); 16 | var month = (String(latestfetch.getMonth() + 1).length == 1) ? "0" + (latestfetch.getMonth() + 1) : latestfetch.getMonth() + 1; 17 | var year = latestfetch.getFullYear(); 18 | var hour = (String(latestfetch.getHours()).length == 1) ? "0" + latestfetch.getHours() : latestfetch.getHours(); 19 | var minutes = (String(latestfetch.getMinutes()).length == 1) ? "0" + latestfetch.getMinutes() : latestfetch.getMinutes(); 20 | var seconds = (String(latestfetch.getSeconds()).length == 1) ? "0" + latestfetch.getSeconds() : latestfetch.getSeconds(); 21 | document.getElementById('latest-fetch').value = "Last time fetched: " + day + "/" + month + "/" + year + " " + hour + ":" + minutes + ":" + seconds; 22 | } 23 | }); 24 | }; 25 | 26 | function getAddonNameVer(callback) { 27 | Components.utils.import("resource://gre/modules/AddonManager.jsm"); 28 | AddonManager.getAddonByID('fpblock@fingerprint.christoftorres.com', callback); 29 | } 30 | 31 | function blockThirdParties() { 32 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 33 | var cookieBehaviour = !fpblockpreferences.getBoolPref('blockthirdparties'); 34 | var firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.cookie.'); 35 | if (cookieBehaviour) { 36 | firefoxpreferences.setIntPref('cookieBehavior', 1); 37 | } else { 38 | firefoxpreferences.setIntPref('cookieBehavior', 0); 39 | } 40 | } 41 | 42 | function setDNTHeader() { 43 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 44 | var enabled = !fpblockpreferences.getBoolPref('dntheader'); 45 | var firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('privacy.donottrackheader.'); 46 | firefoxpreferences.setBoolPref('enabled', enabled); 47 | if (enabled) { 48 | firefoxpreferences.setIntPref('value', 1); 49 | } else { 50 | firefoxpreferences.setIntPref('value', 0); 51 | } 52 | } 53 | 54 | function blockAutomaticConnections() { 55 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 56 | var enabled = !fpblockpreferences.getBoolPref('autoblockconnections'); 57 | // Page preloading 58 | var firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.http.'); 59 | if (enabled) { 60 | firefoxpreferences.setIntPref('speculative-parallel-limit', 0); 61 | } else { 62 | firefoxpreferences.setIntPref('speculative-parallel-limit', 6); 63 | } 64 | // DNS prefetching 65 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.dns.'); 66 | if (enabled) { 67 | firefoxpreferences.setBoolPref('disablePrefetch', true); 68 | } else { 69 | firefoxpreferences.setBoolPref('disablePrefetch', false); 70 | } 71 | // Link prefetching 72 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.'); 73 | if (enabled) { 74 | firefoxpreferences.setBoolPref('prefetch-next', false); 75 | } else { 76 | firefoxpreferences.setBoolPref('prefetch-next', true); 77 | } 78 | } 79 | 80 | function resetDefaultSettings() { 81 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 82 | // General preferences 83 | fpblockpreferences.setBoolPref('notifydetections', true); 84 | // HTTP preferences 85 | fpblockpreferences.setBoolPref('blockthirdparties', true); 86 | //fpblockpreferences.setBoolPref('deletereferer', true); 87 | fpblockpreferences.setBoolPref('dntheader', true); 88 | fpblockpreferences.setBoolPref('deleteetags', true); 89 | // JavaScript preferences 90 | fpblockpreferences.setBoolPref('autoblocksocial', false); 91 | fpblockpreferences.setBoolPref('autoblockplugins', true); 92 | // Firefox automatic connections preferences 93 | fpblockpreferences.setBoolPref('autoblockconnections', true); 94 | // Debugging mode 95 | fpblockpreferences.setBoolPref('debuggingmode', false); 96 | 97 | var firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.cookie.'); 98 | firefoxpreferences.setIntPref('cookieBehavior', 1); 99 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('privacy.donottrackheader.'); 100 | firefoxpreferences.setBoolPref('enabled', true); 101 | firefoxpreferences.setIntPref('value', 1); 102 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.http.'); 103 | firefoxpreferences.setIntPref('speculative-parallel-limit', 0); 104 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.dns.'); 105 | firefoxpreferences.setBoolPref('disablePrefetch', true); 106 | firefoxpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('network.'); 107 | firefoxpreferences.setBoolPref('prefetch-next', false); 108 | } 109 | 110 | Components.utils.import("resource://modules/profiles.jsm"); 111 | 112 | function fetchLatestProfiles() { 113 | var loader = document.getElementById('ajax-loader'); 114 | loader.style.visibility = 'visible'; 115 | var path = "http://christoftorres.no-ip.org/Experiments/profiles/"; 116 | var files = ["chrome.json", "firefox.json", "opera.json", "safari.json"]; 117 | var xmlhttp = new XMLHttpRequest(); 118 | var index = 0; 119 | profiles = []; 120 | xmlhttp.onreadystatechange = function() { 121 | if (xmlhttp.readyState == 4) { 122 | if (xmlhttp.status == 200) { 123 | profiles.push(JSON.parse(xmlhttp.responseText)); 124 | index++; 125 | if (index != files.length) { 126 | xmlhttp.open("POST", path+files[index], true); 127 | xmlhttp.send(); 128 | } else { 129 | var fpblockpreferences = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.fpblock.'); 130 | fpblockpreferences.setCharPref('latestfetch', new Date().getTime()); 131 | var latestfetch = new Date(parseInt(fpblockpreferences.getCharPref('latestfetch'))); 132 | var day = (String(latestfetch.getDate()).length == 1) ? "0" + latestfetch.getDate() : latestfetch.getDate(); 133 | var month = (String(latestfetch.getMonth() + 1).length == 1) ? "0" + (latestfetch.getMonth() + 1) : latestfetch.getMonth() + 1; 134 | var year = latestfetch.getFullYear(); 135 | var hour = (String(latestfetch.getHours()).length == 1) ? "0" + latestfetch.getHours() : latestfetch.getHours(); 136 | var minutes = (String(latestfetch.getMinutes()).length == 1) ? "0" + latestfetch.getMinutes() : latestfetch.getMinutes(); 137 | var seconds = (String(latestfetch.getSeconds()).length == 1) ? "0" + latestfetch.getSeconds() : latestfetch.getSeconds(); 138 | document.getElementById('latest-fetch').value = "Last time fetched: " + day + "/" + month + "/" + year + " " + hour + ":" + minutes + ":" + seconds; 139 | loader.style.visibility = 'hidden'; 140 | } 141 | } 142 | } 143 | } 144 | xmlhttp.open("POST", path+files[index], true); 145 | xmlhttp.send(); 146 | } -------------------------------------------------------------------------------- /Plugin/chrome/content/options.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | .addon-version { 12 | font-weight: bold; 13 | margin: 15px; 14 | } 15 | 16 | .about-groupbox { 17 | padding-top: 15px; 18 | margin-bottom: 15px; 19 | max-width: 420px; 20 | min-height: 370px; 21 | } 22 | 23 | .about-info-left { 24 | float: left; 25 | padding: 35px 10px 10px 10px; 26 | min-width: 210px; 27 | max-width: 210px; 28 | text-align: center; 29 | } 30 | 31 | .about-info-right { 32 | float: right; 33 | padding: 10px; 34 | min-width: 210px; 35 | max-width: 210px; 36 | text-align: justify; 37 | } 38 | 39 | .author { 40 | margin-top: 20px; 41 | text-align: right; 42 | } 43 | 44 | .checkbox { 45 | width: 600px; 46 | } 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |