diff --git a/nodejs-feature-extractor/package.json b/nodejs-feature-extractor/package.json index 15af945..22c13c6 100644 --- a/nodejs-feature-extractor/package.json +++ b/nodejs-feature-extractor/package.json @@ -1,6 +1,6 @@ { "name": "cookieblock-nodejs-feature-extractor", - "version": "0.3.0", + "version": "0.3.1", "description": "Command line feature extractor that uses the same functions as the CookieBlock browser extension. Includes predictor for validation purposes.", "main": "cli.js", "scripts": { diff --git a/src/LICENSE b/src/LICENSE index bbe25fd..8e1b34c 100644 --- a/src/LICENSE +++ b/src/LICENSE @@ -4,10 +4,14 @@ Copyright (c) 2021 Dino Bollinger With help from Karel Kubicek, Dr. Carlos Cotrini and Prof. Dr. David Basin. +Extension options HTML/CSS layout based on the Consent-O-Matic extension by Janus Bager Kristensen, Rolf Bagge, CAVI. + Logo design by Charmaine Coates. Developed under the Department of Computer Science at ETH Zürich, Information Security Group. +--------------------------------------------------------------------------------- + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/src/_locales/de/messages.json b/src/_locales/de/messages.json index 59d4cbe..e923571 100644 --- a/src/_locales/de/messages.json +++ b/src/_locales/de/messages.json @@ -2,10 +2,5 @@ "manifestDescription": { "message": "Blockiert Browser-Cookies deren Nutzung der Benutzer nicht zustimmt.", "description": "Description of the extension." - }, - - "settingsSubtitle": { - "message": "Einstellungen", - "description": "Subtitle of the settings page." } } \ No newline at end of file diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 4b71e7d..f58e30c 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -10,7 +10,7 @@ }, "firstTimeSubtitle": { - "message": "First Time Setup", + "message": "Initial Setup", "description": "Subtitle of the first time setup page." }, @@ -24,13 +24,33 @@ "description": "Greeting message on the first time setup." }, - "firstTimeDesc": { - "message": "CookieBlock attempts to automatically enforce your cookie consent preferences on all websites you visit. This is done through the user of a pre-trained machine learning classifier.", - "description": "Description seen on the first time setup page." + "optionsDescriptionPG1": { + "message": "CookieBlock allows you to automatically delete cookies that are used for purposes you do not consent towards. The categories you can choose from are listed below.", + "description": "Description paragraph 1 seen on the options page." + }, + + "optionsDescriptionPG2": { + "message": "Note that CookieBlock is still in early development, and the classifier may not be completely accurate. We would appreciate any feedback on the performance of the extension.", + "description": "Description paragraph 1 seen on the options page." + }, + + "firstTimeDescPG1": { + "message": "CookieBlock allows you to automatically delete cookies that are used for purposes you do not consent towards. The categories you can choose from are listed below.", + "description": "Description paragraph 1 seen on the first time setup page." + }, + + "firstTimeDescPG2": { + "message": "COOKIEBLOCK IS STILL IN EARLY DEVELOPMENT! It uses machine learning techniques to perform the classification, so the prediction may not always be accurate. If you notice that a website breaks, you can try to add an exception for that domain through the CookieBlock icon in the browser bar. This will prevent cookies originating from that website (but not third-parties) from being deleted. More fine-grained controls may be added in future versions.", + "description": "Description paragraph 2 seen on the first time setup page." + }, + + "firstTimeDescPG3": { + "message": "We would greatly appreciate feedback on the performance of the extension and whether there are any concrete cases of websites breaking.", + "description": "Description paragraph 3 seen on the first time setup page." }, "consentDescription" : { - "message" : "Select the types of cookies that you would like websites to be able to set.", + "message" : "Select the types of cookies that you consent towards:", "description" : "Description of the consent choices." }, @@ -55,22 +75,22 @@ }, "catNecessaryDesc": { - "message": "This category includes cookies that are typically required for essential services to operate. Deleting these may cause websites to break.", + "message": "Strictly necessary cookies are required for essential services of the website to operate. Examples are cookies used for keeping track of the login state, or cookies used to keep track of shopping cart contents. Rejecting these cookies would cause websites to break, hence they are always enabled.", "description": "Description of the 'Necessary' category." }, "catFunctionalityDesc": { - "message": "Functionality cookies serve to remember optional user preferences, such as language or website style, and to improve the user experience. They are not required for essential services to work.", + "message": "Functionality cookies serve to remember optional user preferences, such as language or website style. They are typically not required for essential services to work, but we recommend enabling them to improve the user experience.", "description": "Description of the 'Functionality' category." }, "catAnalyticsDesc" : { - "message": "Analytics cookies are used to collect statistical information about how visitors use a website. Normally the collected data should be anonymized and not be sensitive.", + "message": "Analytics cookies are used to collect statistical information about how visitors use a website. This data is used to improve the site, and in principle does not require personal information. However, some websites may still collect sensitive data with these cookies.", "description": "Description of the 'Analytics' category." }, "catAdvertisingDesc" : { - "message": "Advertising cookies track visitors across multiple websites and collect sensitive, personally identifiable information. This is commonly used to construct a user profile for targeted advertising.", + "message": "Advertising cookies track visitors across the web to display personalized advertisements. This also encompasses all cookies that are used to collect sensitive, personally identifiable information for the purpose of tracking and the sale of data. To protect the user's privacy, we recommend rejecting consent for these types of cookies.", "description": "Description of the 'Advertising' category." }, @@ -95,7 +115,7 @@ }, "debugDescription" : { - "message": "ONLY USE THIS WHEN TESTING! Debug mode will skip the removal of cookies such that the assigned category can be verified manually.", + "message": "ONLY USE THIS FOR TESTING! Debug mode will skip the removal of cookies, and output debug information to the log, such that the assigned category can be verified manually.", "description": "Debug Description." }, @@ -135,7 +155,12 @@ }, "currentCookieEnforceDescription" : { - "message" : "Run the policy enforcement on all cookies currently stored by the browser. This will remove all current cookies that the automatic classifier assigns to cookies you did not agree to.", + "message" : "Run the policy enforcement on all cookies currently stored by the browser. This will remove all cookies that the automatic classifier assigns to cookies you did not consent towards.", + "description" : "Description of the policy enforcement on current cookies." + }, + + "currentCookieEnforceDescriptionSetup" : { + "message" : "The button below will enforce the policy you selected above on all cookies currently stored in your browser. This will remove any cookies that the classifier assigns to categories you did not consent towards. You can also skip this step if you want to keep the current cookies.", "description" : "Description of the policy enforcement on current cookies." }, @@ -160,7 +185,7 @@ }, "globalExceptionsDescription" : { - "message" : "Cookies that originate from one of the domains in this list will always be permitted, regardless of the current consent policy.", + "message" : "Cookies that originate from the domains in this list will always be permitted, regardless of the current consent policy. Use this to add exceptions to domains you trust, or if website functionality breaks.", "description" : "Decription for the global website exceptions." }, diff --git a/src/background/cookieblock_background.js b/src/background/cookieblock_background.js index 88be26d..8666326 100644 --- a/src/background/cookieblock_background.js +++ b/src/background/cookieblock_background.js @@ -253,12 +253,12 @@ const enforcePolicy = async function (ckey, cookieDat){ if (globalExcepts.includes(ckDomain)) { console.debug(`Cookie found in domain whitelist: (${ckey})`); localStatsCounter[4] += 1; - //await setStatsCounter(localStatsCounter); + await setStatsCounter(localStatsCounter); } else { // classify the cookie let label = await classifyCookie(serializedCookie); localStatsCounter[label] += 1; - //await setStatsCounter(localStatsCounter); + await setStatsCounter(localStatsCounter); // make a decision let dstate = await getDebugState(); @@ -310,12 +310,12 @@ const cookieChangeListener = function(changeInfo) { if (globalExcepts.includes(ckDomain)) { console.debug(`Cookie found in domain whitelist: (${ckey})`); localStatsCounter[4] += 1; - //setStatsCounter(localStatsCounter); + await setStatsCounter(localStatsCounter); } else { // classify the cookie let label = await classifyCookie(serializedCookie); localStatsCounter[label] += 1; - //setStatsCounter(localStatsCounter); + await setStatsCounter(localStatsCounter); // make a decision let dstate = await getDebugState(); diff --git a/src/manifest.json b/src/manifest.json index f39e998..1965b84 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -4,7 +4,7 @@ "name": "__MSG_extensionName__", "author": "Dino Bollinger", "homepage_url": "https://github.com/dibollinger/CookieBlock", - "version": "0.3.0", + "version": "0.3.1", "incognito": "spanning", "default_locale": "en", @@ -52,7 +52,7 @@ "browser_specific_settings": { // Firefox "gecko": { - "id": "cookieblock@example.com" // intentionally not the real address + "id": "cookie.block.extension@gmail.com" } } } diff --git a/src/options/cookieblock_options.css b/src/options/cookieblock_options.css index 7d32482..7e184fe 100644 --- a/src/options/cookieblock_options.css +++ b/src/options/cookieblock_options.css @@ -140,7 +140,6 @@ fieldset { .disabled { opacity: 0.5; - filter: grayscale(100%); } .preference_form { diff --git a/src/options/cookieblock_options.js b/src/options/cookieblock_options.js index a6c0135..64d2fdb 100644 --- a/src/options/cookieblock_options.js +++ b/src/options/cookieblock_options.js @@ -80,6 +80,22 @@ const handleExceptionSubmit = async function(inputID, storageID, listID) { } } +/** + * Helper to enable the necessary checkbox + * @param {Boolean} debugState + */ + const enableNecessaryCheckbox = async function(debugState) { + document.getElementById("debug_checkbox").checked = debugState; + let nCB = document.getElementById("nec_checkbox"); + nCB.disabled = !debugState; + nCB.style.opacity = debugState ? "1.0" : "0.5"; + nCB.style.filter = debugState ? "grayscale(0%)" : "grayscale(100%)"; + if (!debugState) { + let policy = await getUserPolicy(); + policy[0] = true; + setUserPolicy(policy); + } +} /** * Function that contains most of the localization text assignments. @@ -168,6 +184,7 @@ const setupSettingsPage = async function() { let debugState = await getDebugState(); document.getElementById("debug_checkbox").checked = debugState; + enableNecessaryCheckbox(debugState); // Statistics let sending = browser.runtime.sendMessage({"get_stats": true}); @@ -180,6 +197,8 @@ const setupSettingsPage = async function() { setStaticLocaleText("num_uncat", "statsWhitelist", stats[4]); }); + + } @@ -239,7 +258,9 @@ const logStorageChange = function(changes, area) { } } else if (area === "local") { if (changedItems.includes("cblk_debug")){ - document.getElementById("nec_checkbox").checked = changes["cblk_debug"].newValue; + let debugState = changes["cblk_debug"].newValue; + enableNecessaryCheckbox(debugState); + } else if (changedItems.includes("cblk_counter")) { stats = changes["cblk_counter"].newValue; setStaticLocaleText("num_necessary", "statsNecessary", stats[0]); diff --git a/src/options/cookieblock_setup.html b/src/options/cookieblock_setup.html index 15e9784..9ab0b3c 100644 --- a/src/options/cookieblock_setup.html +++ b/src/options/cookieblock_setup.html @@ -18,7 +18,9 @@