Skip to content

Commit

Permalink
Version 0.7.0, making it ready for publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dibollinger committed Apr 28, 2021
1 parent 51d4787 commit b4c8638
Show file tree
Hide file tree
Showing 17 changed files with 136 additions and 39 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

Repository for the CookieBlock browser extension, which automatically enforces user privacy policy on browser cookies.

It is compatible with both Firefox and Chromium-based browsers.

## Description

__CookieBlock__ is an extension that allows the user to apply their cookie consent preferences to any website, no matter if the website has a cookie banner. The user specifies their consent options once when the extension is first installed, and then CookieBlock will try to remove any cookies that do not align with the user's policy.
__CookieBlock__ is an extension that allows the user to apply their cookie consent preferences to any website, no matter if the website has a cookie banner. The user specifies their consent options once when the extension is first installed, and then CookieBlock will try to remove any cookies that do not align with the user's policy as they are being created.

It offers the following features:
* Automatic classification of cookies into distinct purpose categories.
Expand All @@ -17,30 +19,35 @@ This is intended to ensure that the privacy of the user is preserved. One can re
* Analytical/Statistics Cookies
* Advertising/Tracking Cookies

Note that CookieBlock does not handle the cookie banner itself. In order to remove these annoying banners, we recommend using the Consent-O-Matic extension, or another similar tool:
Note that CookieBlock does not handle the cookie banner itself. In order to remove these annoying banners, we recommend using the Consent-O-Matic extension, or similar addons:

* https://github.com/cavi-au/Consent-O-Matic

## Repository Contents

* `nodejs-feature-extractor/`: Contains the NodeJS feature extractor. Used to extract features with the same JavaScript code as the extension.
- `/data/`: Contains the feature configuration, external resources used with the feature extraction, trained models for prediction, and training and validation data folders.
- `/modules/`: Contains code modules used to perform the feature extraction and prediction.
- `/modules/`: Contains code used to perform the feature extraction and prediction.
- `/outputs/`: Output directory for the feature extraction.
- `/training_data/`: Path for cookie data in json format, used for extracting features.
- `/validation_data/`: Path for cookie features in libsvm format, used for prediction and verifying model accuracy.
- `/cli.js`: Command-line script used to run the feature extraction.
* `logo/`: Contains the original CookieBlock logo image.
* `logo/`: Contains the original CookieBlock logo files.
* `src/`: Source code for the CookieBlock extension.
- `/_locales/`: JSON files with locale strings, for translation.
- `/_background/`: JavaScript code and HTML for the extension background process.
- `/ext_data/`: All external data required to perform the feature extraction and class label prediction.
- `/model/`: Extracted CART prediction tree forests, one for each class of cookies.
- `/resources/`: Resources used with the feature extraction.
- `/config.json`: Defines default values used in the extension.
- `/default_config.json`: Defines default storage values used in the extension.
- `/features.json`: Defines how the feature extraction operates, and which individual feature are enabled.
- `/known_cookies.json`: Defines default categorizations for some known cookies.
- `/icons/`: Browser extension icons.
- `/modules/`: External code modules, some of which are third-party.
- `/modules/`: Contains scripts that handle certain aspects of the feature extraction and prediction.
- `/third_party/`: Third party code libraries.
- `/options/`: Contains the options and first time setup page of the extension.
- `/popup/`: Contains code for the extension popup.
- `credits.txt`: Links to the third-party libraries and credits to the respective authors.
- `LICENSE`: License of the extension.

# Credits and License

Expand Down
8 changes: 4 additions & 4 deletions src/LICENSE
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
MIT License

Copyright (c) 2021 Dino Bollinger
Copyright (c) 2021 Dino Bollinger, Department of Computer Science at ETH Zürich, Information Security Group.

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.
---------------------------------------------------------------------------------
Includes HTML/CSS layout based on the Consent-O-Matic extension.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI

---------------------------------------------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions src/background/cookieblock_background.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<!-------------------------------------------------------------------------------
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
-------------------------------------------------------------------------------->
<!DOCTYPE html>
<html lang="en">
<head>
Expand Down
12 changes: 10 additions & 2 deletions src/background/cookieblock_background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


// for debugging
var httpRemovalCounter = 0;
Expand Down
6 changes: 6 additions & 0 deletions src/credits.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

1. Difflib source taken from: https://github.com/qiao/difflib.js/

> Link to file: https://github.com/qiao/difflib.js/blob/e11553ba3e303e2db206d04c95f8e51c5692ca28/dist/difflib-browser.js

Ported by Xueqiao Xu <[email protected]>

Licensed under: PSF LICENSE FOR PYTHON 2.7.2
Expand All @@ -19,6 +21,8 @@ PSF LICENSE AGREEMENT FOR PYTHON 2.7.2

2. Levenshtein script taken from: https://github.com/gf3/Levenshtein

> Link to file: https://github.com/gf3/Levenshtein/blob/4884046bb7c85f868de0e1524abe4f26d2cf6e7d/lib/levenshtein.js

Written by Gianni Chiappetta

The Levenshtein script is unlicensed: https://unlicense.org/
Expand All @@ -27,6 +31,8 @@ The Levenshtein script is unlicensed: https://unlicense.org/

3. LZ-String, taken from: https://github.com/pieroxy/lz-string/

> Link to file: https://github.com/pieroxy/lz-string/blob/b2e0b270a9f3cf330b778b777385fcba384a1a02/libs/lz-string.js

MIT License

Copyright (c) 2013 pieroxy
Expand Down
6 changes: 3 additions & 3 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "__MSG_extensionName__",
"author": "Information Security Group, ETH Zürich",
"homepage_url": "https://github.com/dibollinger/CookieBlock",
"version": "0.6.0",
"version": "0.7.0",
"incognito": "spanning",
"default_locale": "en",

Expand All @@ -24,7 +24,7 @@
"cookies", // required for cookie access
"storage", // required to store settings
"unlimitedStorage", // required to keep track of cookie updates
"tabs" // required to access current tab to add site exceptions
"activeTab" // required to access current tab to add site exceptions
],

"background": {
Expand All @@ -51,7 +51,7 @@

"browser_specific_settings": {
"gecko": {
"id": "cookieblock@example.com"
"id": "cookie.block.extension@gmail.com"
}
}
}
12 changes: 10 additions & 2 deletions src/modules/extractor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


// Loaded in from a JSON file, stores the configuration on which features to extract from a cookie
var feature_config;
Expand Down
12 changes: 10 additions & 2 deletions src/modules/globals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


const enableExtraOptions = false;

Expand Down
12 changes: 10 additions & 2 deletions src/modules/predictor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


// initialize the forests
var forests = [undefined, undefined, undefined, undefined];
Expand Down
6 changes: 4 additions & 2 deletions src/options/cookieblock_options.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
* Based on the CSS from Consent-O-Matic by Janus Bager Kristensen, Rolf Bagge, CAVI
* MIT License
This CSS is based on the Consent-O-Matic addon by, released under the MIT License.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI
Released under the MIT License, see included LICENSE file.
*/
body, html {
margin: 0;
Expand Down
10 changes: 8 additions & 2 deletions src/options/cookieblock_options.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<!-- HTML layout based on Consent-O-Matic options by Janus Bager Kristensen, Rolf Bagge, CAVI -->
<!-- MIT License -->
<!---------------------------------------------------------------------------------
This HTML layout is based on the Consent-O-Matic addon by, released under the MIT License.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI
Altered by Dino Bollinger, 2021
Released under the MIT License, see included LICENSE file.
--------------------------------------------------------------------------------->
<!DOCTYPE html>
<html>
<head>
Expand Down
12 changes: 10 additions & 2 deletions src/options/cookieblock_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


// HTML elements
const histCheckbox = document.getElementById("history-consent-checkbox");
Expand Down
10 changes: 8 additions & 2 deletions src/options/cookieblock_setup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<!-- HTML layout based on Consent-O-Matic options design by Janus Bager Kristensen, Rolf Bagge, CAVI -->
<!-- MIT License -->
<!---------------------------------------------------------------------------------
This HTML layout is based on the Consent-O-Matic addon by, released under the MIT License.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI
Altered by Dino Bollinger, 2021
Released under the MIT License, see included LICENSE file.
--------------------------------------------------------------------------------->
<!DOCTYPE html>
<html>
<head>
Expand Down
12 changes: 9 additions & 3 deletions src/options/cookieblock_setup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------

// Script that controls the first-time setup of the extension

/**
* Function that contains the localization text assignments.
Expand Down
7 changes: 5 additions & 2 deletions src/popup/cookieblock_popup.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* Based on the CSS from Consent-O-Matic by Janus Bager Kristensen, Rolf Bagge, CAVI
* MIT License
/*
This CSS is based on the Consent-O-Matic addon by, released under the MIT License.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI
Released under the MIT License, see included LICENSE file.
*/
body, html {
padding: 0;
Expand Down
10 changes: 8 additions & 2 deletions src/popup/cookieblock_popup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<!-- HTML layout based on Consent-O-Matic popup by Janus Bager Kristensen, Rolf Bagge, CAVI -->
<!-- MIT License -->
<!---------------------------------------------------------------------------------
This HTML layout is based on the Consent-O-Matic addon by, released under the MIT License.
Copyright (c) 2019 Janus Bager Kristensen, Rolf Bagge, CAVI
Altered by Dino Bollinger, 2021
Released under the MIT License, see included LICENSE file.
--------------------------------------------------------------------------------->
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
Expand Down
12 changes: 10 additions & 2 deletions src/popup/cookieblock_popup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Author: Dino Bollinger
// License: MIT
//-------------------------------------------------------------------------------
/*
Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group
This file is part of CookieBlock.
Released under the MIT License, see included LICENSE file.
*/
//-------------------------------------------------------------------------------


const addText = chrome.i18n.getMessage("popupButtonAdd");
const removeText = chrome.i18n.getMessage("popupButtonRemove");
Expand Down

0 comments on commit b4c8638

Please sign in to comment.