Compare commits
58 Commits
v1.3.0
...
v2.0.0beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bc807f7bb | ||
|
|
7899afe01f | ||
|
|
7246cc39c4 | ||
|
|
1a82d81fbb | ||
|
|
dfbe433f65 | ||
|
|
ff4bbeaf30 | ||
|
|
d6173249f4 | ||
|
|
b45df1f032 | ||
|
|
78e9a7c7ea | ||
|
|
7d21a1ed92 | ||
|
|
51d975f720 | ||
|
|
98a9516d3d | ||
|
|
682570cdea | ||
|
|
19cb2beacf | ||
|
|
f5f3cc9be4 | ||
|
|
e73ad04845 | ||
|
|
2f8733bd0a | ||
|
|
0d868e072f | ||
|
|
560b68932c | ||
|
|
0a664f7cd3 | ||
|
|
8124fe112c | ||
|
|
28b194b7f3 | ||
|
|
042853432e | ||
|
|
524981b841 | ||
|
|
9822093473 | ||
|
|
d04bb51a4d | ||
|
|
926d49d107 | ||
|
|
09a02eb5f3 | ||
|
|
286f7c7f66 | ||
|
|
021cac82dc | ||
|
|
e288d8195d | ||
|
|
20e3ec02b1 | ||
|
|
74fca95767 | ||
|
|
0c6325bb1f | ||
|
|
7f79e6999d | ||
|
|
082c9e78d0 | ||
|
|
b411d04b6f | ||
|
|
54c16775d2 | ||
|
|
f16a81c249 | ||
|
|
4396c1c9f0 | ||
|
|
c02257f184 | ||
|
|
c3f230f32d | ||
|
|
e595faa541 | ||
|
|
146a01c5ce | ||
|
|
b199936150 | ||
|
|
85dfd71920 | ||
|
|
8d137b801b | ||
|
|
07cfc9c251 | ||
|
|
d4d07a3d38 | ||
|
|
40e2681bfd | ||
|
|
33b8f50ddc | ||
|
|
774a91ad5b | ||
|
|
f3af8d5005 | ||
|
|
61b950fa3b | ||
|
|
38317a7a81 | ||
|
|
6938a619fc | ||
|
|
8855358381 | ||
|
|
1f90b36d47 |
6
.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
data/_audit/node_modules
|
||||
data/_audit/report.txt
|
||||
*.xpi
|
||||
.idea
|
||||
audit/node_modules
|
||||
audit/report.txt
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
data/_audit/node_modules
|
||||
data/_audit/report.txt
|
||||
.jpmignore
|
||||
.gitignore
|
||||
.idea
|
||||
*.xpi
|
||||
test
|
||||
.git
|
||||
37
README.md
@@ -1,47 +1,30 @@
|
||||
Decentraleyes
|
||||
=============
|
||||
|
||||
A [Firefox add-on](https://addons.mozilla.org/firefox/addon/decentraleyes) that emulates Content Delivery Networks (CDNs) locally by intercepting requests, finding the required resource and injecting it into the environment. This all happens instantaneously, automatically, and no prior configuration is required. Feel free to use this [testing utility](https://decentraleyes.org/test) to see if it's properly installed, enabled, and correctly configured.
|
||||
A [web browser extension](https://decentraleyes.org) that emulates Content Delivery Networks to improve your online privacy. It intercepts traffic, finds supported resources locally, and injects them into the environment. All of this happens automatically, so no prior configuration is required. Feel free to use the following [testing utility](https://decentraleyes.org/test) to find out if you are properly protected.
|
||||
|
||||
> **Note:** Decentraleyes is no silver bullet, but it does prevent a lot of websites from making you send these kinds of requests. Ultimately, you can make Decentraleyes block requests for any missing CDN resources, too.
|
||||
|
||||
## Roadmap
|
||||
## Contributing Code
|
||||
|
||||
Now that there's a solid, Mozilla approved, foundation, it's time to move forward. Mobility, extensibility (through support for community-powered resource packages), and usability, will be the main points of attention during this phase.
|
||||
Suggestions in the form of **Issues**, and contributions in the form of **Pull Requests**, are highly welcome. You can also use the public contact details and PGP key on the extension's [contact page](https://decentraleyes.org/contact) to get in touch.
|
||||
|
||||
#### Essential Next Steps
|
||||
#### Prerequisites
|
||||
|
||||
* Start work on a resource bundle standard, to allow users to create and import custom resources. With support for these bundles in place, Decentraleyes will still work out of the box, but can be extended if needed.
|
||||
* To keep this add-on from turning into bloatware, it's important to find out which versions of which libraries are most commonly used on websites, so that less popular resources can be removed from the default bundle.
|
||||
* Mozilla Firefox 56 *(or higher)*.
|
||||
|
||||
#### Planned Features
|
||||
> **Note:** If you want to contribute to the Firefox legacy extension, please check out the ```legacy``` branch. If you are looking for the Chromium-compatible codebase, please see the ```experimental``` branch.
|
||||
|
||||
* Advanced policy management for users who block requests for missing resources.
|
||||
* Smarter resource version interpretation for handling dynamic notations.
|
||||
* A minimalistic and non-essential graphical user interface.
|
||||
* Support for custom, importable, library repositories.
|
||||
#### Running the Code
|
||||
|
||||
> **Note:** These long-term goals are subjective to change, and can be discussed. That is, as long as the suggestions do not conflict with the ultimate goal of realizing a free and open standard for exchanging web resource bundles.
|
||||
Please read this [short guide](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension#Trying_it_out) for information on how to run this extension from source.
|
||||
|
||||
> **Important:** All commits since 26 October 2016 are signed with GPG. It's likely best to ignore unsigned commits, unless you really know what you're doing. Please send an email if you have any questions or security concerns.
|
||||
|
||||
## Submitting Translations
|
||||
|
||||
Do you master a non-supported language? Please help out by translating this add-on on [Crowdin](https://crowdin.com/project/decentraleyes).
|
||||
|
||||
## Contributing Code
|
||||
|
||||
Suggestions in the form of **Issues** and contributions in the form of **Pull Requests** are highly welcome. You can also use the contact details and PGP key on the add-on [download page](https://addons.mozilla.org/firefox/addon/decentraleyes) to get in touch.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
* Jetpack Manager [jpm](https://developer.mozilla.org/Add-ons/SDK/Tools/jpm#Installation) (a Node-based replacement for cfx).
|
||||
* Firefox version 38 or later. *If you need to work with earlier versions of Firefox, you'll need to use the old cfx tool. See instructions for [getting started with cfx](https://developer.mozilla.org/Add-ons/SDK/Tutorials/Getting_started).
|
||||
|
||||
#### Build Instructions (Unix)
|
||||
|
||||
git clone https://github.com/Synzvato/decentraleyes
|
||||
cd decentraleyes
|
||||
jpm xpi
|
||||
|
||||
## License
|
||||
|
||||
[MPL-2.0](https://www.mozilla.org/MPL/2.0).
|
||||
|
||||
46
_locales/bg/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Защитава ви от следене чрез свободна, централизирана доставка на съдържание.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Изключване на защитата за страницата",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Включване на защита",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Настройки",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Блокиране на заявки за липсващи ресурси",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Отмяна на прехванатата заявка, ако изисквания ресурс не е наличен на местно ниво.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Изключване на домейните от инспекции",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Въведете домейни, които да се добавят в белия списък. Отделете стойностите с точка и запетая.",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Брояч за местно вмъкнати ресурси",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Количество на местни вмъквания на ресурси от началото на инсталацията.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Подробности",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/da/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Beskytter dig imod sporing af \"gratis\", centraliserede indholdsleverandører.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Deaktiver beskyttelse for dette websted",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Aktiver beskyttelse",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Indstillinger",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Bloker anmodninger om manglende ressourcer",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Annullerer en anmodning hvis den forespurgte ressource ikke findes lokalt.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Udeluk disse domæner fra inspektion",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Tilføj domæner der ikke skal opfanges. Separer flere med semikolon (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Optælling af lokalt leverede ressourcer",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Antal injektioner af lokale ressourcer siden installation.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avanceret",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/de/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Schützt vor Tracking durch \"gratis\", zentralisiertes, Abliefern von Content.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Schutz für diese Seite deaktivieren",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Schutz aktivieren",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Einstellungen",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Blockiere Anfordern fehlender Inhalte",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Abgefangene Anforderung unterbinden, falls angeforderte Datei nicht lokal verfügbar ist.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Domains von Prüfung ausschließen",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Gebe zu ignorierende Domains an. Trenne mehrere Einträge durch Semikolons (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Zähler für lokal injizierte Ressourcen",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Anzahl der lokalen Injektionen von den CDN-Ressourcen seit der Installation.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Erweitert",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/el/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Προστατεύει από παρακολούθηση μέσω \"δωρεάν\" διανομής περιεχόμενου.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Απενεργοποίηση προστασίας για αυτή τη σελίδα",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Ενεργοποίηση προστασίας",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Επιλογές",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Μπλοκ αιτήσεων για ανύπαρκτους πόρους",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Ακύρωση απομακρυσμένης αίτησης, αν ο απαιτούμενος πόρος δεν είναι τοπικά διαθέσιμος.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Εξαίρεση διευθύνσεων από επιθεωρήσεις",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Εισαγωγή διευθύνσεων στις επιτρεπόμενες. Διαχωρίστε πολλαπλές καταχωρήσεις με ερωτηματικά (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Μετρητής εμβόλιμων τοπικών πόρων",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Ποσοστό εμβόλιμων τοπικών πόρων Δικτύων Παροχής Περιεχομένου από την στιγμή της εγκατάστασης.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Για προχωρημένους",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/en_GB/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protects you against tracking through \"free\", centralised, content delivery.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Disable protection for this site",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Enable protection",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Options",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Block requests for missing resources",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Cancel intercepted request if the required resource is not locally available.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Exclude domains from inspections",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Counter for locally injected resources",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Amount of local Content Delivery Network resource injections since installation.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Advanced",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/en_US/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protects you against tracking through \"free\", centralized, content delivery.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Disable protection for this site",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Enable protection",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Options",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Block requests for missing resources",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Cancel intercepted request if the required resource is not locally available.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Exclude domains from inspections",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Counter for locally injected resources",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Amount of local Content Delivery Network resource injections since installation.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Advanced",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/es/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protégete contra rastreo a través de entrega de contenido centralizado \"gratis\".",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Desactivar protección en este sitio",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Activar protección",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Opciones",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Bloquear peticiones de fuentes faltantes",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Cancelar peticiones detenidas si la fuente requerida no se encuentra localmente.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Excluir dominios de inspecciones",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Ingresar dominios a ser ignorados. Separar múltiples entradas con punto y coma (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Contador para fuentes inyectadas localmente",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Cifra de inyecciones de fuentes de Redes de Entrega de Contenido desde instalación.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avanzado",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/fi/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Suojaa sinua \"ilmaisten\" keskitettyjen sisällön jakeluverkkojen jäljitykseltä.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Poista suojaus tältä sivustolta",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Ota suojaus käyttöön",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Asetukset",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Estä pyynnöt puuttuviin resursseihin",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Estää pyynnöt jos paikallista sisältöä ei ole saatavilla.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Poissulje verkkotunnukset",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Lisää verkkotunnus jottei sitä korvata. Erota rivit puolipisteellä (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Korvatut pyynnöt",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Korvatut sisältöpyynnöt lisäosan asennuksen jälkeen.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Yksityiskohdat",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/fr/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protège du pistage lié à l'accès à des contenus \"gratuits\", centralisés.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Désactiver la protection pour ce site",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Activer la protection",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Options",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Bloquer les ressources manquantes",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Annuler une demande de ressource si elle est indisponible localement.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Ne pas inspecter certains domaines",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Indiquez les domaines à exclure. Séparer les noms par un point-virgule (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Compteur des ressources injectées",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Total des ressources des CDN injectées localement depuis l'installation.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avancé",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/id/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Melindungi dari pelacakan melalui distribusi konten yang bebas dan terpusat.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Nonaktifkan perlindungan untuk situs web ini",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Aktifkan perlindungan",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Opsi",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Blokir permintaan untuk sumber daya yang hilang",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Batalkan intersep permintaan jika sumber daya yang dibutuhkan tidak tersedia secara lokal.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Cegah inspeksi domain",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Masukkan domain ke daftar putih. Pisahkan entri dengan titik koma (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Sumber daya lokal yang disematkan",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Jumlah penyematan sumber daya Jaringan Distribusi Konten lokal sejak pemasangan.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Canggih",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/is/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Verndar þig gegn eftirliti frá \"ókeypis\" miðlægum efnisveitum.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Slökkva á vörn fyrir þetta vefsvæði",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Virkja vernd",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Valkostir",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Loka á beiðnir vegna tilfanga sem vantar",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Hætta við veiddar beiðnir ef umbeðið tilfang er ekki til staðar á tölvunni.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Undanskilja lén frá athugun",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Settu inn lén til að skrá þau á lista yfir leyfð lén. Aðgreindu færslur með semíkommum (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Fjöldi staðvært inspýttra tilfanga",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Fjöldi tilfanga frá miðlægum efnisveitum sem skipt hefur verið út síðan viðbótin var sett upp.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Ítarlegt",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/it/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protegge dal tracciamento tramite i CDN centralizzati \"gratuiti\".",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Disattiva protezione per questo sito",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Attiva protezione",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Opzioni",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Bloccare richieste di risorse mancanti",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Annulla la richiesta intercettata se la risorsa necessaria non è disponibile localmente.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Escludere domini dalle ispezioni",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Inserire domini nella whitelist per escluderli. Separare voci multiple con punti e virgola (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Contatore per risorse iniettate localmente",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Quantità di iniezioni di risorse dalla Rete di Distribuzione di Contenuti locale sin dall'installazione.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avanzate",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/ja/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "「無料」と称してあなたを追跡する大規模なCDNを迂回して、プライバシーを守ります。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "このサイトでは保護を無効にする",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "保護を有効にする",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "オプション",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "アドオンに含まれないリソースへのリクエストをブロックする",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "必要なリソースがローカルで利用できない場合、リクエストを取り消します。",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "保護から除外するドメイン",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "ホワイトリストに登録したいドメインを入力してください。エントリが複数ある場合、セミコロン (;) で区切ってください。",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "ローカルのリソースを使用した回数",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "インストール後にローカルのCDNリソースを使用した回数です。",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "エラー内容",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/nl/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Beschermt tegen tracking via het \"gratis\", gecentraliseerd, verzorgen van content.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Bescherming voor deze website uitschakelen",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Bescherming inschakelen",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Opties",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Stop verzoeken voor ontbrekende items",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Annuleer een onderschept verzoek wanneer het bestand niet lokaal beschikbaar is.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Sluit domeinen uit van inspecties",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Voer de te negeren domeinen in. Scheid de waarden met puntkomma's (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Teller voor lokaal geïnjecteerde bestanden",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Aantal lokale Content Delivery Network-bestandsinjecties sinds installatie.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Geavanceerd",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/pl/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Chroni przed śledzeniem przez ośrodki CDN.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Wyłącz ochronę dla tej witryny",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Włącz ochronę",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Ustawienia",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Blokuj żądania brakujących zasobów",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Anuluj przechwycone żądania jeśli wymagany zasób nie jest dostępny lokalnie.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Wyklucz domeny z analizy",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Podaj domeny aby dodać je do białej listy. Oddziel wpisy średnikami (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Licznik zasobów podanych lokalnie",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Ilość wstrzyknięć z lokalnego Content Delivery Network od czasu instalacji.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Zaawansowane",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/pt_PT/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protege contra monitorização através de entrega de conteúdo centralizado.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Desativar proteção para este site",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Ativar proteção",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Opções",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Bloquear pedidos por falta de recursos",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Cancelar pedido intercetado se o recurso necessário não estiver disponível localmente.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Excluir domínios de inspeções",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Insira domínios para os colocar na lista branca. Separe múltiplas entradas com pontos e vírgulas (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Contador para recursos injetados localmente",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Quantidade de injeções de recurso Content Delivery Network locais desde a instalação.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avançado",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/ru/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Защищает Вас от отслеживания через «бесплатные», централизованные CDN.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Отключить защиту для этого сайта",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Включить защиту",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Настройки",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Блокировать запросы недостающих ресурсов",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Отменить перехваченный запрос, если требуемый ресурс не доступен локально (может «ломать» сайты).",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Исключить домены из проверки",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "«Белый список» доменов. Контент, расположенный на них не будет фильтроваться. Записи (при количестве более одной) разделяются точкой с запятой (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Счётчик файлов «доставленных» локально",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Количество местных инъекций ресурсов сети доставки контента с момента установки.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Дополнительно",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/sv/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Skyddar dig mot att spåras av \"gratis\", centraliserat, innehållsleverans.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "Inaktivera skydd för den här sidan",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "Aktivera skydd",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "Inställningar",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "Blockera förfrågningar när resurs saknas",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "Avbryt uppsnappning om resurs inte finns lokalt.",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "Utelämna domäner från uppsnappningar",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "Ange domäner för vitlistning. Spearera domänerna med semikolon (;).",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "Räknare för lokalt insatta resurser",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "Antalet insatta Content Delivery Network-resurser sedan installationen.",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "Avancerad",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/zh_CN/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "保护您免受集中式的内容交付网络(CDN)的跟踪。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "在此网站上禁用保护",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "启用保护",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "选项",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "阻止缺失资源的请求",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "取消被拦截的请求,如果请求的资源在本地不可用。",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "排除要检查的域名",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "输入白名单的域名。用分号 (;) 分隔多项。",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "本地发送资源的计数器",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "自安装以来,从本地的“内容交付网络”发送的资源总量。",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "高级",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
46
_locales/zh_TW/messages.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "保護您不受「免費」、中心化的內容傳遞網路(CDN)的追蹤。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"disableProtectionTitle": {
|
||||
"message": "為此網站停用保護",
|
||||
"description": "Disable protection title."
|
||||
},
|
||||
"enableProtectionTitle": {
|
||||
"message": "啟用保護",
|
||||
"description": "Enable protection title."
|
||||
},
|
||||
"optionsTitle": {
|
||||
"message": "選項",
|
||||
"description": "Options title."
|
||||
},
|
||||
"blockMissingTitle": {
|
||||
"message": "封鎖缺少資源時的連線請求",
|
||||
"description": "Block requests for missing resources title."
|
||||
},
|
||||
"blockMissingDescription": {
|
||||
"message": "若本機沒有所請求的資源,就取消該請求。",
|
||||
"description": "Block requests for missing resources description."
|
||||
},
|
||||
"domainWhitelistTitle": {
|
||||
"message": "要排除檢查的網域",
|
||||
"description": "Domain whitelist title."
|
||||
},
|
||||
"domainWhitelistDescription": {
|
||||
"message": "輸入網域即可將其加入白名單。使用分號(;)分隔多個網域。",
|
||||
"description": "Domain whitelist description."
|
||||
},
|
||||
"amountInjectedTitle": {
|
||||
"message": "由本機提供的資源計數器",
|
||||
"description": "Amount injected title."
|
||||
},
|
||||
"amountInjectedDescription": {
|
||||
"message": "安裝以來,由本機檔案所取代的 CDN 資源數量。",
|
||||
"description": "Amount injected description."
|
||||
},
|
||||
"advancedLabel": {
|
||||
"message": "進階",
|
||||
"description": "Advanced label."
|
||||
}
|
||||
}
|
||||
18
audit/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This audit script allows any user and extension reviewer to verify the integrity of the bundled resources. It automatically, and transparently, compares all bundled libraries to their original sources.
|
||||
|
||||
|
||||
Usage Instructions (Unix)
|
||||
------------------
|
||||
|
||||
1. Make sure you have Node.js installed on your machine.
|
||||
|
||||
2. Open up a terminal and ```cd``` into this directory.
|
||||
|
||||
3. Execute ```npm install``` to fetch any dependencies.
|
||||
|
||||
4. Run the audit script by executing ```node run```.
|
||||
|
||||
**Note:** If you'd like to save the report, run ```node run > report.txt```.
|
||||
13
audit/package-lock.json
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "decentraleyes-audit",
|
||||
"version": "1.5.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"source-map-url": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
|
||||
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "decentraleyes-audit",
|
||||
"version": "1.3.0",
|
||||
"version": "1.5.0",
|
||||
"author": "Thomas Rientjes",
|
||||
"license": "MPL-2.0",
|
||||
"description": "Library audit tool for Decentraleyes.",
|
||||
@@ -31,6 +31,7 @@ sourceMappingURL = require('source-map-url');
|
||||
var localResourceLocation = '../resources';
|
||||
var localResourceLocationLength = localResourceLocation.length;
|
||||
var localResourcePaths = [];
|
||||
var comparedResourceAmount = 0;
|
||||
var resourceAmount = 0;
|
||||
|
||||
/**
|
||||
@@ -41,10 +42,6 @@ function _fetchLocalResourcePaths(folderPath) {
|
||||
|
||||
fileSystem.readdirSync(folderPath).forEach(function (resourceName) {
|
||||
|
||||
if (resourceName === '_audit') {
|
||||
return localResourcePaths;
|
||||
}
|
||||
|
||||
var resourcePath = folderPath + '/' + resourceName;
|
||||
var resourceStatistics = fileSystem.statSync(resourcePath);
|
||||
|
||||
@@ -75,7 +72,7 @@ function _getLocalResourceContents(fileLocation, callback) {
|
||||
|
||||
var localFileContents = buffer.toString('utf8', 0, buffer.length);
|
||||
|
||||
fileSystem.close(fileDescriptor);
|
||||
fileSystem.close(fileDescriptor, function () {});
|
||||
callback(localFileContents);
|
||||
});
|
||||
});
|
||||
@@ -137,7 +134,7 @@ function _hashFileContents(fileContents) {
|
||||
|
||||
var hash;
|
||||
|
||||
hash = crypto.createHash('md5');
|
||||
hash = crypto.createHash('sha512');
|
||||
|
||||
hash.setEncoding('hex');
|
||||
hash.write(fileContents);
|
||||
@@ -148,20 +145,19 @@ function _hashFileContents(fileContents) {
|
||||
|
||||
function _compareResources(localResourceContents, remoteResourceContents, URL) {
|
||||
|
||||
var hadSourceMappingURL = sourceMappingURL.existsIn(remoteResourceContents);
|
||||
remoteResourceContents = sourceMappingURL.removeFrom(remoteResourceContents);
|
||||
|
||||
var hasSourceMappingURL = sourceMappingURL.existsIn(remoteResourceContents);
|
||||
var sourceMappingNotice = '[ ] REMOTE RESOURCE HAD SOURCE MAPPING URL';
|
||||
|
||||
if (hadSourceMappingURL) {
|
||||
if (hasSourceMappingURL) {
|
||||
remoteResourceContents = sourceMappingURL.removeFrom(remoteResourceContents);
|
||||
sourceMappingNotice = '[X] REMOTE RESOURCE HAD SOURCE MAPPING URL';
|
||||
}
|
||||
|
||||
var localResourceHash = _hashFileContents(localResourceContents);
|
||||
var remoteResourceHash = _hashFileContents(remoteResourceContents);
|
||||
|
||||
console.log(localResourceHash);
|
||||
console.log(remoteResourceHash);
|
||||
console.log('RESOURCE HASH (SHA512): ' + localResourceHash);
|
||||
console.log('RESOURCE HASH (SHA512): ' + remoteResourceHash);
|
||||
|
||||
var fileHashesMatch = (localResourceHash === remoteResourceHash);
|
||||
|
||||
@@ -172,9 +168,10 @@ function _compareResources(localResourceContents, remoteResourceContents, URL) {
|
||||
}
|
||||
|
||||
console.log();
|
||||
console.log(sourceMappingNotice);
|
||||
console.log('[X] LOCAL AND REMOTE RESOURCE HASHES MATCH');
|
||||
console.log(sourceMappingNotice);
|
||||
|
||||
_incrementComparedResourceAmount();
|
||||
}
|
||||
|
||||
function _showCompletedMessage() {
|
||||
@@ -185,6 +182,18 @@ function _showCompletedMessage() {
|
||||
console.log();
|
||||
}
|
||||
|
||||
function _incrementComparedResourceAmount() {
|
||||
|
||||
comparedResourceAmount++;
|
||||
|
||||
if (comparedResourceAmount === resourceAmount) {
|
||||
|
||||
setTimeout(function () {
|
||||
_showCompletedMessage();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
@@ -214,13 +223,6 @@ localResourcePaths.forEach(function (resourcePath, index) {
|
||||
|
||||
console.log();
|
||||
console.log('------------------------------------------');
|
||||
|
||||
if (index === resourceAmount - 1) {
|
||||
|
||||
setTimeout(function () {
|
||||
_showCompletedMessage();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
locale decentraleyes bg locale/bg/
|
||||
locale decentraleyes de locale/de/
|
||||
locale decentraleyes en-GB locale/en-GB/
|
||||
locale decentraleyes en-US locale/en-US/
|
||||
locale decentraleyes es locale/es/
|
||||
locale decentraleyes fi locale/fi/
|
||||
locale decentraleyes fr locale/fr/
|
||||
locale decentraleyes id locale/id/
|
||||
locale decentraleyes it locale/it/
|
||||
locale decentraleyes ja locale/ja/
|
||||
locale decentraleyes nl locale/nl/
|
||||
locale decentraleyes pl locale/pl/
|
||||
locale decentraleyes pt-PT locale/pt-PT/
|
||||
locale decentraleyes zh-CN locale/zh-CN/
|
||||
@@ -127,6 +127,11 @@ var files = {
|
||||
'resources/jquery/1.11.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.11.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.11.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.12.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.12.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.12.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.12.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.12.4/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.0.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.0.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.0.2/jquery.min.js.dec': true,
|
||||
@@ -255,9 +260,3 @@ var files = {
|
||||
'resources/webfont/1.5.10/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.18/webfont.js.dec': true
|
||||
};
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = files;
|
||||
119
core/interceptor.js
Normal file
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
* Interceptor
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-04-06
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Interceptor
|
||||
*/
|
||||
|
||||
var interceptor = {};
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const HTTP_EXPRESSION = /^http?:\/\//;
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||
|
||||
let validCandidate, targetDetails, targetPath;
|
||||
|
||||
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
||||
|
||||
if (!validCandidate) {
|
||||
|
||||
return {
|
||||
'cancel': false
|
||||
};
|
||||
}
|
||||
|
||||
targetDetails = requestAnalyzer.getLocalTarget(requestDetails);
|
||||
targetPath = targetDetails.path;
|
||||
|
||||
if (!targetPath) {
|
||||
return interceptor._handleMissingCandidate(requestDetails.url);
|
||||
}
|
||||
|
||||
if (!files[targetPath]) {
|
||||
return interceptor._handleMissingCandidate(requestDetails.url);
|
||||
}
|
||||
|
||||
stateManager.requests[requestDetails.requestId] = {
|
||||
'tabIdentifier': tabIdentifier,
|
||||
'targetDetails': targetDetails
|
||||
};
|
||||
|
||||
return {
|
||||
'redirectUrl': chrome.extension.getURL(targetPath)
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
interceptor._handleMissingCandidate = function (requestUrl) {
|
||||
|
||||
if (interceptor.blockMissing === true) {
|
||||
|
||||
return {
|
||||
'cancel': true
|
||||
};
|
||||
}
|
||||
|
||||
if (requestUrl.match(HTTP_EXPRESSION)) {
|
||||
|
||||
requestUrl = requestUrl.replace(HTTP_EXPRESSION, 'https://');
|
||||
|
||||
return {
|
||||
'redirectUrl': requestUrl
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
return {
|
||||
'cancel': false
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
interceptor._handleStorageChanged = function (changes) {
|
||||
|
||||
if ('blockMissing' in changes) {
|
||||
interceptor.blockMissing = changes.blockMissing.newValue;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
interceptor.amountInjected = 0;
|
||||
interceptor.blockMissing = false;
|
||||
|
||||
chrome.storage.local.get(['amountInjected', 'blockMissing'], function (items) {
|
||||
|
||||
interceptor.amountInjected = items.amountInjected || 0;
|
||||
interceptor.blockMissing = items.blockMissing || false;
|
||||
});
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
*/
|
||||
|
||||
chrome.storage.onChanged.addListener(interceptor._handleStorageChanged);
|
||||
48
core/main.js
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Entry Point
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-04-04
|
||||
* @license MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
|
||||
var main = {};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
chrome.runtime.getPlatformInfo(function (information) {
|
||||
main.operatingSystem = information.os;
|
||||
});
|
||||
|
||||
if (typeof chrome.browserAction.setBadgeBackgroundColor !== 'function') {
|
||||
|
||||
chrome.browserAction.setBadgeBackgroundColor = function () {};
|
||||
chrome.browserAction.setBadgeText = function () {};
|
||||
|
||||
chrome.browserAction.onClicked.addListener(function () {
|
||||
|
||||
chrome.tabs.create({
|
||||
'url': chrome.extension.getURL('pages/popup/popup.html'),
|
||||
'active': false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chrome.privacy.network.networkPredictionEnabled.set({'value': false});
|
||||
|
||||
chrome.browserAction.setBadgeBackgroundColor({
|
||||
'color': [74, 130, 108, 255]
|
||||
});
|
||||
@@ -13,12 +13,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
var resources = require('./resources');
|
||||
|
||||
/**
|
||||
* Mappings
|
||||
*/
|
||||
@@ -83,7 +77,6 @@ var mappings = {
|
||||
// Microsoft Ajax CDN
|
||||
'ajax.aspnetcdn.com': {
|
||||
'/ajax/': {
|
||||
'jQuery/jquery-{version}.': resources.jQuery,
|
||||
'jquery/jquery-{version}.': resources.jQuery,
|
||||
'modernizr/modernizr-{version}.': resources.modernizr
|
||||
}
|
||||
@@ -91,7 +84,6 @@ var mappings = {
|
||||
// Microsoft Ajax CDN [Deprecated]
|
||||
'ajax.microsoft.com': {
|
||||
'/ajax/': {
|
||||
'jQuery/jquery-{version}.': resources.jQuery,
|
||||
'jquery/jquery-{version}.': resources.jQuery,
|
||||
'modernizr/modernizr-{version}.': resources.modernizr
|
||||
}
|
||||
@@ -285,9 +277,3 @@ var mappings = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = mappings;
|
||||
159
core/request-analyzer.js
Normal file
@@ -0,0 +1,159 @@
|
||||
/**
|
||||
* Request Analyzer
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-04-11
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Request Analyzer
|
||||
*/
|
||||
|
||||
var requestAnalyzer = {};
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const MAPPING_FILE_EXPRESSION = new RegExp('\.map$', 'i');
|
||||
const VERSION_EXPRESSION = /(?:\d{1,2}\.){1,3}\d{1,2}/;
|
||||
const VERSION_PLACEHOLDER = '{version}';
|
||||
const WEB_DOMAIN_EXPRESSION = /:\/\/(.[^\/]+)(.*)/;
|
||||
const WEB_PREFIX_VALUE = 'www.';
|
||||
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
|
||||
|
||||
let initiatorHost;
|
||||
|
||||
try {
|
||||
initiatorHost = tabDetails.url.match(WEB_DOMAIN_EXPRESSION)[1];
|
||||
} catch (exception) {
|
||||
initiatorHost = 'example.org';
|
||||
}
|
||||
|
||||
if (initiatorHost && requestAnalyzer.whitelistedDomains[requestAnalyzer._normalizeDomain(initiatorHost)]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only requests of type GET can be valid candidates.
|
||||
return requestDetails.method === 'GET';
|
||||
};
|
||||
|
||||
requestAnalyzer.getLocalTarget = function (requestDetails) {
|
||||
|
||||
let destinationHost, destinationPath, hostMappings, basePath, resourceMappings;
|
||||
|
||||
destinationHost = requestDetails.url.match(WEB_DOMAIN_EXPRESSION)[1];
|
||||
destinationPath = requestDetails.url.match(WEB_DOMAIN_EXPRESSION)[2];
|
||||
|
||||
// Use the proper mappings for the targeted host.
|
||||
hostMappings = mappings[destinationHost];
|
||||
|
||||
// Resource mapping files are never locally available.
|
||||
if (MAPPING_FILE_EXPRESSION.test(destinationPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
basePath = requestAnalyzer._matchBasePath(hostMappings, destinationPath);
|
||||
resourceMappings = hostMappings[basePath];
|
||||
|
||||
if (!resourceMappings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return either the local target's path or false.
|
||||
return requestAnalyzer._findLocalTarget(resourceMappings, basePath, destinationHost, destinationPath);
|
||||
};
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
requestAnalyzer._matchBasePath = function (hostMappings, channelPath) {
|
||||
|
||||
for (let basePath of Object.keys(hostMappings)) {
|
||||
|
||||
if (channelPath.startsWith(basePath)) {
|
||||
return basePath;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channelHost, channelPath) {
|
||||
|
||||
var resourcePath, versionNumber, resourcePattern;
|
||||
|
||||
resourcePath = channelPath.replace(basePath, '');
|
||||
|
||||
versionNumber = resourcePath.match(VERSION_EXPRESSION);
|
||||
resourcePattern = resourcePath.replace(versionNumber, VERSION_PLACEHOLDER);
|
||||
|
||||
for (let resourceMold of Object.keys(resourceMappings)) {
|
||||
|
||||
if (resourcePattern.startsWith(resourceMold)) {
|
||||
|
||||
let targetPath, version;
|
||||
|
||||
targetPath = resourceMappings[resourceMold].path;
|
||||
targetPath = targetPath.replace(VERSION_PLACEHOLDER, versionNumber);
|
||||
|
||||
version = versionNumber && versionNumber[0] || targetPath.match(VERSION_EXPRESSION);
|
||||
|
||||
// Prepare and return a local target.
|
||||
return {
|
||||
source: channelHost,
|
||||
version: version,
|
||||
path: targetPath
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
requestAnalyzer._applyWhitelistedDomains = function () {
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
chrome.storage.local.get('whitelistedDomains', function (items) {
|
||||
requestAnalyzer.whitelistedDomains = items.whitelistedDomains || {};
|
||||
});
|
||||
};
|
||||
|
||||
requestAnalyzer._normalizeDomain = function (domain) {
|
||||
|
||||
domain = domain.toLowerCase().trim();
|
||||
|
||||
if (domain.startsWith(WEB_PREFIX_VALUE)) {
|
||||
domain = domain.slice(WEB_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
return domain;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
requestAnalyzer.whitelistedDomains = {};
|
||||
requestAnalyzer._applyWhitelistedDomains();
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
*/
|
||||
|
||||
chrome.storage.onChanged.addListener(requestAnalyzer._applyWhitelistedDomains);
|
||||
@@ -90,9 +90,3 @@ var resources = {
|
||||
type: 'application/javascript'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = resources;
|
||||
234
core/state-manager.js
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* State Manager
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2017-03-10
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* State Manager
|
||||
*/
|
||||
|
||||
var stateManager = {};
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const BLOCKING_ACTION = 'blocking';
|
||||
const HOST_PREFIX = '*://';
|
||||
const HOST_SUFFIX = '/*';
|
||||
const JAVASCRIPT_REQUEST_TYPE = 'script';
|
||||
const REQUEST_HEADERS = 'requestHeaders';
|
||||
const XML_HTTP_REQUEST_TYPE = 'xmlhttprequest';
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
stateManager.registerInjection = function (tabIdentifier, injection) {
|
||||
|
||||
let injectionIdentifier, registeredTab, injectionCount;
|
||||
|
||||
injectionIdentifier = injection.source + injection.path + injection.version;
|
||||
registeredTab = stateManager.tabs[tabIdentifier];
|
||||
|
||||
registeredTab.injections[injectionIdentifier] = injection;
|
||||
injectionCount = Object.keys(registeredTab.injections).length || 0;
|
||||
|
||||
if (injectionCount > 0) {
|
||||
|
||||
chrome.browserAction.setBadgeText({
|
||||
tabId: tabIdentifier,
|
||||
text: injectionCount.toString()
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
chrome.browserAction.setBadgeText({
|
||||
tabId: tabIdentifier,
|
||||
text: ''
|
||||
});
|
||||
}
|
||||
|
||||
if (isNaN(interceptor.amountInjected)) {
|
||||
|
||||
chrome.storage.local.get('amountInjected', function (items) {
|
||||
|
||||
interceptor.amountInjected = items.amountInjected;
|
||||
|
||||
chrome.storage.local.set({
|
||||
'amountInjected': ++interceptor.amountInjected
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
chrome.storage.local.set({
|
||||
'amountInjected': ++interceptor.amountInjected
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
stateManager.addDomainToWhitelist = function (domain) {
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
||||
let whitelistedDomains = requestAnalyzer.whitelistedDomains;
|
||||
whitelistedDomains[domain] = true;
|
||||
|
||||
chrome.storage.local.set({whitelistedDomains}, resolve);
|
||||
});
|
||||
};
|
||||
|
||||
stateManager.deleteDomainFromWhitelist = function (domain) {
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
||||
let whitelistedDomains = requestAnalyzer.whitelistedDomains;
|
||||
delete whitelistedDomains[domain];
|
||||
|
||||
chrome.storage.local.set({whitelistedDomains}, resolve);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
stateManager._createTab = function (tab) {
|
||||
|
||||
let tabIdentifier, requestFilters;
|
||||
|
||||
tabIdentifier = tab.id;
|
||||
|
||||
stateManager.tabs[tabIdentifier] = {
|
||||
'injections': {}
|
||||
};
|
||||
|
||||
requestFilters = {
|
||||
|
||||
'tabId': tabIdentifier,
|
||||
'types': stateManager.validTypes,
|
||||
'urls': stateManager.validHosts
|
||||
};
|
||||
|
||||
chrome.webRequest.onBeforeRequest.addListener(function (requestDetails) {
|
||||
|
||||
return new Promise((resolve) => {
|
||||
|
||||
browser.tabs.get(tabIdentifier).then(function (tab) {
|
||||
resolve(interceptor.handleRequest(requestDetails, tabIdentifier, tab));
|
||||
});
|
||||
});
|
||||
|
||||
}, requestFilters, [BLOCKING_ACTION]);
|
||||
};
|
||||
|
||||
stateManager._removeTab = function (tabIdentifier) {
|
||||
delete stateManager.tabs[tabIdentifier];
|
||||
};
|
||||
|
||||
stateManager._updateTab = function (details) {
|
||||
|
||||
let tabIdentifier, frameIdentifier;
|
||||
|
||||
tabIdentifier = details.tabId;
|
||||
frameIdentifier = details.frameId;
|
||||
|
||||
if (tabIdentifier === -1 || frameIdentifier !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
chrome.browserAction.setBadgeText({
|
||||
tabId: tabIdentifier,
|
||||
text: ''
|
||||
});
|
||||
|
||||
if (stateManager.tabs[tabIdentifier]) {
|
||||
stateManager.tabs[tabIdentifier].injections = {};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
stateManager.requests = {};
|
||||
stateManager.tabs = {};
|
||||
|
||||
stateManager.validTypes = [
|
||||
|
||||
JAVASCRIPT_REQUEST_TYPE,
|
||||
XML_HTTP_REQUEST_TYPE
|
||||
];
|
||||
|
||||
stateManager.validHosts = [];
|
||||
|
||||
for (let mapping in mappings) {
|
||||
|
||||
if (!mappings.hasOwnProperty(mapping)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let supportedHost = HOST_PREFIX + mapping + HOST_SUFFIX;
|
||||
stateManager.validHosts.push(supportedHost);
|
||||
}
|
||||
|
||||
chrome.tabs.query({}, function (tabs) {
|
||||
tabs.forEach(stateManager._createTab);
|
||||
});
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
*/
|
||||
|
||||
chrome.tabs.onCreated.addListener(stateManager._createTab);
|
||||
chrome.tabs.onRemoved.addListener(stateManager._removeTab);
|
||||
|
||||
chrome.webNavigation.onCommitted.addListener(stateManager._updateTab, {
|
||||
url: [{urlContains: ':'}]
|
||||
});
|
||||
|
||||
chrome.webRequest.onErrorOccurred.addListener(function (requestDetails) {
|
||||
|
||||
if (stateManager.requests[requestDetails.requestId]) {
|
||||
delete stateManager.requests[requestDetails.requestId];
|
||||
}
|
||||
|
||||
}, {'urls': ['*://*/*']});
|
||||
|
||||
chrome.webRequest.onBeforeRedirect.addListener(function (requestDetails) {
|
||||
|
||||
let knownRequest = stateManager.requests[requestDetails.requestId];
|
||||
|
||||
if (knownRequest) {
|
||||
|
||||
stateManager.registerInjection(knownRequest.tabIdentifier, knownRequest.targetDetails);
|
||||
delete stateManager.requests[requestDetails.requestId];
|
||||
}
|
||||
|
||||
}, {'urls': ['*://*/*']});
|
||||
|
||||
chrome.webRequest.onBeforeSendHeaders.addListener(function (requestDetails) {
|
||||
|
||||
for (let i = 0; i < requestDetails.requestHeaders.length; ++i) {
|
||||
|
||||
if (requestDetails.requestHeaders[i].name === 'Origin') {
|
||||
requestDetails.requestHeaders.splice(i, 1);
|
||||
} else if (requestDetails.requestHeaders[i].name === 'Referer') {
|
||||
requestDetails.requestHeaders.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return {requestHeaders: requestDetails.requestHeaders};
|
||||
|
||||
}, {urls: stateManager.validHosts}, [BLOCKING_ACTION, REQUEST_HEADERS]);
|
||||
@@ -1,29 +0,0 @@
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
This script (first introduced in Decentraleyes v1.1.5) should make reviewing this extension a lot easier than it used to be. It's open source and open for scrutiny, and it automatically compares the bundled libraries (resources) to their original sources (after removing any source mapping URLs).
|
||||
|
||||
|
||||
FOR NON-LINUX USERS
|
||||
-------------------
|
||||
|
||||
This usage guide is tailored to Linux based operating systems. If you're on a different type of system, the easiest direct solution might be to launch a free Linux box with Node.js pre-installed on Red Hat OpenShift. You can then SSH into it (after adding your own machine's public key to your account).
|
||||
|
||||
Having said that, every terminal command in the usage guide below comes with a description, so it should not be too hard to get this done on practically any type of configuration.
|
||||
|
||||
|
||||
USAGE INSTRUCTIONS
|
||||
------------------
|
||||
|
||||
1. Make sure you have Node.js installed on your machine (or install it).
|
||||
|
||||
2. Open up a terminal and 'cd' into this directory.
|
||||
Description: Navigate to this directory.
|
||||
|
||||
3. Execute 'npm install' to fetch any dependencies.
|
||||
|
||||
4. Run the audit script by executing 'node run'.
|
||||
Description: Run the script through Node.js and view the output.
|
||||
|
||||
Note: If you'd like to store the report, run 'node run > report.txt'.
|
||||
Note description: It's possible to write the console output to a file.
|
||||
@@ -1,5 +0,0 @@
|
||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.addNotice', true);
|
||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing', false);
|
||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist', '');
|
||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected', 0);
|
||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.showReleaseNotes', true);
|
||||
BIN
icon64.png
|
Before Width: | Height: | Size: 19 KiB |
BIN
icons/action/icon18.png
Normal file
|
After Width: | Height: | Size: 925 B |
BIN
icons/action/icon19.png
Normal file
|
After Width: | Height: | Size: 1001 B |
BIN
icons/action/icon32.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
icons/action/icon36.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
icons/action/icon38.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
icons/action/icon64.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
icons/icon128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
icons/icon16.png
Normal file
|
After Width: | Height: | Size: 859 B |
BIN
icons/icon48.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
icons/icon96.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
@@ -1,98 +0,0 @@
|
||||
/**
|
||||
* Data Handler
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-05-30
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
var { Cc, Ci } = require('chrome');
|
||||
var self = require('sdk/self');
|
||||
|
||||
//noinspection JSUnresolvedFunction
|
||||
var ioService = Cc['@mozilla.org/network/io-service;1']
|
||||
.getService(Ci.nsIIOService);
|
||||
|
||||
/**
|
||||
* Absolute resource file paths.
|
||||
* @var {object} files
|
||||
*/
|
||||
var files = require('./files');
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const DELIVERY_NOTICE = '/**\n * Local delivery by Decentraleyes (' + self.version + ').\n */\n\n';
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
var resourceData = self.data;
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
function getRedirectionURI(targetPath, characterSet, type) {
|
||||
|
||||
var data, dataURI, redirectionURI;
|
||||
|
||||
data = _loadResource(targetPath);
|
||||
dataURI = _buildDataURI(type, characterSet, data);
|
||||
redirectionURI = ioService.newURI(dataURI, null, null);
|
||||
|
||||
return redirectionURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
exports.getRedirectionURI = getRedirectionURI;
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
function _loadResource(targetPath) {
|
||||
|
||||
var resource;
|
||||
|
||||
// Find the result inside a static path index.
|
||||
if (!files[targetPath]) {
|
||||
throw new Error('The requested resource is missing.');
|
||||
}
|
||||
|
||||
// Attempt to load resource contents.
|
||||
return resource = resourceData.load(targetPath);
|
||||
}
|
||||
|
||||
function _buildDataURI(type, characterSet, data) {
|
||||
|
||||
var addNotice, dataURI;
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
addNotice = require('sdk/simple-prefs').prefs.addNotice;
|
||||
dataURI = 'data:' + type + ';charset=' + characterSet + ',';
|
||||
|
||||
if (!addNotice) {
|
||||
dataURI = dataURI + encodeURIComponent(data);
|
||||
} else {
|
||||
dataURI = dataURI + encodeURIComponent(DELIVERY_NOTICE + data);
|
||||
}
|
||||
|
||||
return dataURI;
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
/**
|
||||
* Interceptor
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-05-30
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
var { Class } = require('sdk/core/heritage');
|
||||
var { Unknown } = require('sdk/platform/xpcom');
|
||||
var { Cc, Ci, Cr } = require('chrome');
|
||||
|
||||
/**
|
||||
* Gets and sets add-on specific preferences.
|
||||
* @var {object} simplePreferences
|
||||
*/
|
||||
var simplePreferences = require('sdk/simple-prefs');
|
||||
|
||||
/**
|
||||
* Retains data across application restarts.
|
||||
* @var {object} simpleStorage
|
||||
*/
|
||||
var simpleStorage = require('sdk/simple-storage');
|
||||
|
||||
//noinspection JSUnresolvedFunction
|
||||
var observerService = Cc['@mozilla.org/observer-service;1']
|
||||
.getService(Ci.nsIObserverService);
|
||||
|
||||
var requestAnalyzer = require('./request-analyzer');
|
||||
var dataHandler = require('./data-handler');
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
var preferences = simplePreferences.prefs;
|
||||
var storage = simpleStorage.storage;
|
||||
|
||||
/**
|
||||
* Interceptor Class
|
||||
*/
|
||||
|
||||
var Interceptor = new Class({
|
||||
|
||||
extends: Unknown,
|
||||
interfaces: ['nsIObserver'],
|
||||
topic: 'http-on-modify-request',
|
||||
|
||||
register: function () {
|
||||
observerService.addObserver(this, this.topic, false);
|
||||
},
|
||||
|
||||
unregister: function () {
|
||||
observerService.removeObserver(this, this.topic);
|
||||
},
|
||||
|
||||
/**
|
||||
* Called whenever an HTTP request is made.
|
||||
* @param httpChannel
|
||||
*/
|
||||
observe: function (httpChannel) {
|
||||
|
||||
var validCandidate, target, characterSet, redirectionURI;
|
||||
|
||||
// Enable runtime discovery.
|
||||
httpChannel.QueryInterface(Ci.nsIHttpChannel);
|
||||
|
||||
// Determine the validity of the candidate.
|
||||
validCandidate = requestAnalyzer.isValidCandidate(httpChannel);
|
||||
|
||||
if (!validCandidate) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove referer header from request.
|
||||
httpChannel.setRequestHeader('Referer', null, false);
|
||||
|
||||
// Convert the original request URI to a local target.
|
||||
target = requestAnalyzer.getLocalTarget(httpChannel.URI.host, httpChannel.URI.path);
|
||||
|
||||
if (!target) {
|
||||
return this.handleMissingCandidate(httpChannel);
|
||||
}
|
||||
|
||||
characterSet = httpChannel.URI.originCharset;
|
||||
|
||||
// Fetch local data and create a redirection URI.
|
||||
try {
|
||||
redirectionURI = dataHandler.getRedirectionURI(target.path, characterSet, target.type);
|
||||
} catch (exception) {
|
||||
return this.handleMissingCandidate(httpChannel);
|
||||
}
|
||||
|
||||
// Fix for reported edge-case issues with specific websites.
|
||||
var initiatorDomain =
|
||||
httpChannel.loadInfo && httpChannel.loadInfo.loadingDocument && httpChannel.loadInfo.loadingDocument.domain ||
|
||||
httpChannel.referrer && httpChannel.referrer.host;
|
||||
|
||||
if (storage.taintedDomains[initiatorDomain]) {
|
||||
return this.handleMissingCandidate(httpChannel);
|
||||
}
|
||||
|
||||
// Redirect the HTTP channel to the the local destination.
|
||||
httpChannel.redirectTo(redirectionURI);
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
preferences.amountInjected++;
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when a valid candidate cannot be injected.
|
||||
* @param httpChannel
|
||||
*/
|
||||
handleMissingCandidate: function (httpChannel) {
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
if (preferences.blockMissing) {
|
||||
httpChannel.cancel(Cr.NS_ERROR_NOT_AVAILABLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = Interceptor;
|
||||
@@ -1,152 +0,0 @@
|
||||
/**
|
||||
* Load Watcher
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-02-04
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
var { Class } = require('sdk/core/heritage');
|
||||
var { Unknown, Factory } = require('sdk/platform/xpcom');
|
||||
var { Cc, Ci, Cu } = require('chrome');
|
||||
|
||||
var xpcom = require('sdk/platform/xpcom');
|
||||
|
||||
/**
|
||||
* Resource version mappings.
|
||||
* @var {object} mappings
|
||||
*/
|
||||
var mappings = require('./mappings');
|
||||
|
||||
/**
|
||||
* Retains data across application restarts.
|
||||
* @var {object} simpleStorage
|
||||
*/
|
||||
var simpleStorage = require('sdk/simple-storage');
|
||||
|
||||
//noinspection JSUnresolvedFunction
|
||||
var categoryManager = Cc['@mozilla.org/categorymanager;1']
|
||||
.getService(Ci.nsICategoryManager);
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const CONTRACT_ID = '@decentraleyes.org/load-watcher;1';
|
||||
const SCRIPT_CONTENT_TYPE = Ci.nsIContentPolicy.TYPE_SCRIPT;
|
||||
const SCRIPT_ELEMENT = Ci.nsIDOMHTMLScriptElement;
|
||||
const REQUEST_ACCEPTATION = Ci.nsIContentPolicy.ACCEPT;
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
var storage = simpleStorage.storage;
|
||||
|
||||
/**
|
||||
* Tainted domains that are not automatically detectable.
|
||||
* @var {object} undetectableTaintedDomains
|
||||
*/
|
||||
var undetectableTaintedDomains = {
|
||||
|
||||
'passport.twitch.tv': true,
|
||||
'minigames.mail.ru': true
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
storage.taintedDomains = storage.taintedDomains || undetectableTaintedDomains;
|
||||
|
||||
/**
|
||||
* Load Watcher Class
|
||||
*/
|
||||
|
||||
var LoadWatcher = new Class({
|
||||
|
||||
extends: Unknown,
|
||||
interfaces: ['nsIContentPolicy'],
|
||||
get wrappedJSObject() {
|
||||
return this
|
||||
},
|
||||
|
||||
register: function () {
|
||||
|
||||
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
|
||||
categoryManager.addCategoryEntry('content-policy', CONTRACT_ID, CONTRACT_ID, false, true);
|
||||
},
|
||||
|
||||
shouldLoad: function (contentType, contentLocation, requestOrigin, node) {
|
||||
|
||||
if (contentType == SCRIPT_CONTENT_TYPE && mappings[contentLocation.host]) {
|
||||
|
||||
if (node instanceof SCRIPT_ELEMENT) {
|
||||
|
||||
if (node.hasAttribute('crossorigin') || node.hasAttribute('integrity')) {
|
||||
|
||||
// Add corresponding origin domain to the list of tainted domains.
|
||||
storage.taintedDomains[requestOrigin.host] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Accept the resource load request.
|
||||
return REQUEST_ACCEPTATION;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Load Watcher Factory
|
||||
*/
|
||||
|
||||
var factory = Factory({
|
||||
|
||||
contract: CONTRACT_ID,
|
||||
Component: LoadWatcher,
|
||||
unregister: false
|
||||
});
|
||||
|
||||
/**
|
||||
* Unregister
|
||||
*/
|
||||
|
||||
var unload = require('sdk/system/unload');
|
||||
|
||||
unload.when(function () {
|
||||
|
||||
function trueUnregister() {
|
||||
|
||||
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
|
||||
|
||||
try {
|
||||
xpcom.unregister(factory);
|
||||
} catch (exception) {
|
||||
Cu.reportError(exception);
|
||||
}
|
||||
}
|
||||
|
||||
if ('dispatch' in Cu) {
|
||||
Cu.dispatch(trueUnregister, trueUnregister);
|
||||
} else {
|
||||
Cu.import('resource://gre/modules/Services.jsm');
|
||||
Services.tm.mainThread.dispatch(trueUnregister, 0);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = LoadWatcher;
|
||||
53
lib/main.js
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* Entry Point
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-05-30
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
var Interceptor = require('./interceptor');
|
||||
var LoadWatcher = require('./load-watcher');
|
||||
|
||||
var preferences = require('sdk/simple-prefs').prefs;
|
||||
var tabs = require("sdk/tabs");
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
|
||||
var interceptor = new Interceptor();
|
||||
var loadWatcher = new LoadWatcher();
|
||||
|
||||
// Executed as soon as the add-on is loaded.
|
||||
exports.main = function (options) {
|
||||
|
||||
// Initialize add-on state.
|
||||
interceptor.register();
|
||||
loadWatcher.register();
|
||||
|
||||
if (preferences.showReleaseNotes && (options.loadReason === 'install' || options.loadReason === 'upgrade')) {
|
||||
|
||||
if (preferences['sdk.baseURI']) {
|
||||
tabs.open(preferences['sdk.baseURI'] + 'static/release-notes.html');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Executed as soon as the add-on is unloaded.
|
||||
exports.onUnload = function () {
|
||||
|
||||
// Clean up add-on state.
|
||||
interceptor.unregister()
|
||||
};
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* Request Analyzer
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-05-30
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resource version mappings.
|
||||
* @var {object} mappings
|
||||
*/
|
||||
var mappings = require('./mappings');
|
||||
|
||||
/**
|
||||
* Gets and sets add-on specific preferences.
|
||||
* @var {object} simplePreferences
|
||||
*/
|
||||
var simplePreferences = require('sdk/simple-prefs');
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const MAPPING_FILE_EXPRESSION = new RegExp('.map$', 'i');
|
||||
const VERSION_EXPRESSION = /(?:\d{1,2}\.){1,3}\d{1,2}/;
|
||||
const VERSION_PLACEHOLDER = '{version}';
|
||||
const WEB_PREFIX_VALUE = 'www.';
|
||||
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
|
||||
const VALUE_SEPARATOR = ';';
|
||||
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
var preferences = simplePreferences.prefs;
|
||||
var whitelistedDomains = {};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
_applyWhitelistPreference();
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
*/
|
||||
|
||||
simplePreferences.on('domainWhitelist', _applyWhitelistPreference);
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
exports.isValidCandidate = function (httpChannel) {
|
||||
|
||||
// See if the request is targeted at a Content Delivery Network.
|
||||
if (mappings[httpChannel.URI.host] === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attempt to determine the domain of the request initiator.
|
||||
var initiatorDomain =
|
||||
httpChannel.loadInfo && httpChannel.loadInfo.loadingDocument && httpChannel.loadInfo.loadingDocument.domain ||
|
||||
httpChannel.referrer && httpChannel.referrer.host;
|
||||
|
||||
// If the request initiator could be determined and is whitelisted.
|
||||
if (initiatorDomain && whitelistedDomains[_normalizeDomain(initiatorDomain)]) {
|
||||
|
||||
// Remove referer header from request.
|
||||
httpChannel.setRequestHeader('Referer', null, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only requests of type GET can be valid candidates.
|
||||
return httpChannel.requestMethod === 'GET';
|
||||
};
|
||||
|
||||
exports.getLocalTarget = function (channelHost, channelPath) {
|
||||
|
||||
var hostMappings, basePath, resourceMappings;
|
||||
|
||||
// Use the proper mappings for the targeted host.
|
||||
hostMappings = mappings[channelHost];
|
||||
|
||||
// Resource mapping files are never locally available.
|
||||
if (MAPPING_FILE_EXPRESSION.test(channelPath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
basePath = _matchBasePath(hostMappings, channelPath);
|
||||
resourceMappings = hostMappings[basePath];
|
||||
|
||||
if (!resourceMappings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return either the local target's path or false.
|
||||
return _findLocalTarget(resourceMappings, basePath, channelPath);
|
||||
};
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
function _matchBasePath(hostMappings, channelPath) {
|
||||
|
||||
for (let basePath of Object.keys(hostMappings)) {
|
||||
|
||||
if (channelPath.startsWith(basePath)) {
|
||||
return basePath;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _findLocalTarget(resourceMappings, basePath, channelPath) {
|
||||
|
||||
var resourcePath, versionNumber, resourcePattern;
|
||||
|
||||
resourcePath = channelPath.replace(basePath, '');
|
||||
|
||||
versionNumber = resourcePath.match(VERSION_EXPRESSION);
|
||||
resourcePattern = resourcePath.replace(versionNumber, VERSION_PLACEHOLDER);
|
||||
|
||||
// Determine if the resource path has a static mapping.
|
||||
if (resourceMappings[resourcePath]) {
|
||||
|
||||
// Prepare and return a local target.
|
||||
return {
|
||||
path: resourceMappings[resourcePath].path,
|
||||
type: resourceMappings[resourcePath].type
|
||||
};
|
||||
}
|
||||
|
||||
// Determine if the resource path fits into a resource mold.
|
||||
for (let resourceMold of Object.keys(resourceMappings)) {
|
||||
|
||||
if (resourcePattern.startsWith(resourceMold)) {
|
||||
|
||||
// Prepare and return a local target.
|
||||
return {
|
||||
path: resourceMappings[resourceMold].path.replace(VERSION_PLACEHOLDER, versionNumber),
|
||||
type: resourceMappings[resourceMold].type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function _normalizeDomain(domain) {
|
||||
|
||||
domain = domain.toLowerCase().trim();
|
||||
|
||||
if (domain.startsWith(WEB_PREFIX_VALUE)) {
|
||||
domain = domain.slice(WEB_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
||||
function _applyWhitelistPreference() {
|
||||
|
||||
whitelistedDomains = {};
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
preferences.domainWhitelist.split(VALUE_SEPARATOR).forEach(function (domain) {
|
||||
whitelistedDomains[_normalizeDomain(domain)] = true;
|
||||
});
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Добавяне на коментари към местно извлечени файлове">
|
||||
<!ENTITY options.addNotice.description "Автоматично вмъкване на известие към извлечените документи, за да се сигнализира местна доставка.">
|
||||
<!ENTITY options.blockMissing.title "Блокиране на заявки за липсващи ресурси">
|
||||
<!ENTITY options.blockMissing.description "Отмяна на прехванатата заявка, ако изисквания ресурс не е наличен на местно ниво.">
|
||||
<!ENTITY options.domainWhitelist.title "Изключване на домейните от инспекции">
|
||||
<!ENTITY options.domainWhitelist.description "Въведете домейни, които да се добавят в белия списък. Отделете стойностите с точка и запетая.">
|
||||
<!ENTITY options.amountInjected.title "Брояч за местно вмъкнати ресурси">
|
||||
<!ENTITY options.amountInjected.description "Количество на местни вмъквания на ресурси от началото на инсталацията.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Kennzeichne lokal abgerufene Dateien">
|
||||
<!ENTITY options.addNotice.description "Füge automatisch Kommentare an lokal ausgelieferte Bibliotheken hinzu.">
|
||||
<!ENTITY options.blockMissing.title "Blockiere Anfordern fehlende Inhalte">
|
||||
<!ENTITY options.blockMissing.description "Abgefangene Anforderung unterbinden, falls angeforderte Datei nicht lokal verfügbar ist.">
|
||||
<!ENTITY options.domainWhitelist.title "Domains von Prüfung ausschließen">
|
||||
<!ENTITY options.domainWhitelist.description "Gebe zu ignorierende Domains an. Trenne mehrere Einträge durch Semikolons (;).">
|
||||
<!ENTITY options.amountInjected.title "Zähler für lokal injizierte Ressourcen">
|
||||
<!ENTITY options.amountInjected.description "Anzahl der lokalen Injektionen von den CDN-Ressourcen seit der Installation.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Add comments to locally fetched files">
|
||||
<!ENTITY options.addNotice.description "Automatically prepend a notice to retrieved documents to signal local delivery.">
|
||||
<!ENTITY options.blockMissing.title "Block requests for missing resources">
|
||||
<!ENTITY options.blockMissing.description "Cancel intercepted request if the required resource is not locally available.">
|
||||
<!ENTITY options.domainWhitelist.title "Exclude domains from inspections">
|
||||
<!ENTITY options.domainWhitelist.description "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).">
|
||||
<!ENTITY options.amountInjected.title "Counter for locally injected resources">
|
||||
<!ENTITY options.amountInjected.description "Amount of local Content Delivery Network resource injections since installation.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Add comments to locally fetched files">
|
||||
<!ENTITY options.addNotice.description "Automatically prepend a notice to retrieved documents to signal local delivery.">
|
||||
<!ENTITY options.blockMissing.title "Block requests for missing resources">
|
||||
<!ENTITY options.blockMissing.description "Cancel intercepted request if the required resource is not locally available.">
|
||||
<!ENTITY options.domainWhitelist.title "Exclude domains from inspections">
|
||||
<!ENTITY options.domainWhitelist.description "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).">
|
||||
<!ENTITY options.amountInjected.title "Counter for locally injected resources">
|
||||
<!ENTITY options.amountInjected.description "Amount of local Content Delivery Network resource injections since installation.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Añadir notas a archivos obtenidos localmente">
|
||||
<!ENTITY options.addNotice.description "Anteponer un aviso a documentos obtenidos para señalar entrega local.">
|
||||
<!ENTITY options.blockMissing.title "Bloquear peticiones de fuentes faltantes">
|
||||
<!ENTITY options.blockMissing.description "Cancelar peticiones detenidas si la fuente requerida no se encuentra localmente.">
|
||||
<!ENTITY options.domainWhitelist.title "Excluir dominios de inspecciones">
|
||||
<!ENTITY options.domainWhitelist.description "Ingresar dominios a ser ignorados. Separar múltiples entradas con punto y coma (;).">
|
||||
<!ENTITY options.amountInjected.title "Contador para fuentes inyectadas localmente">
|
||||
<!ENTITY options.amountInjected.description "Cifra de inyecciones de fuentes de Redes de Entrega de Contenido desde instalación.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Merkitse korvatut tiedostot">
|
||||
<!ENTITY options.addNotice.description "Lisää alkuun ilmoituksen paikallisesti noudetuille tiedostoille.">
|
||||
<!ENTITY options.blockMissing.title "Estä pyynnöt puuttuviin resursseihin">
|
||||
<!ENTITY options.blockMissing.description "Estää pyynnöt jos paikallista sisältöä ei ole saatavilla.">
|
||||
<!ENTITY options.domainWhitelist.title "Poissulje verkkotunnukset">
|
||||
<!ENTITY options.domainWhitelist.description "Lisää verkkotunnus jottei sitä korvata. Erota rivit puolipisteellä (;).">
|
||||
<!ENTITY options.amountInjected.title "Korvatut pyynnöt">
|
||||
<!ENTITY options.amountInjected.description "Korvatut sisältöpyynnöt lisäosan asennuksen jälkeen.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Pointer les documents joints localement">
|
||||
<!ENTITY options.addNotice.description "Accoler une notice aux documents récupérés pour en signaler l'origine locale.">
|
||||
<!ENTITY options.blockMissing.title "Bloquer les ressources manquantes">
|
||||
<!ENTITY options.blockMissing.description "Annuler une demande de ressource si elle est indisponible localement.">
|
||||
<!ENTITY options.domainWhitelist.title "Ne pas inspecter certains domaines">
|
||||
<!ENTITY options.domainWhitelist.description "Indiquez les domaines à exclure. Séparer les noms par un point-virgule (;).">
|
||||
<!ENTITY options.amountInjected.title "Compteur des ressources injectées">
|
||||
<!ENTITY options.amountInjected.description "Total des ressources des CDN injectées localement depuis l'installation.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Tambahkan komentar ke berkas lokal yang disimpan">
|
||||
<!ENTITY options.addNotice.description "Secara otomatis menambahkan pemberitahuan untuk mengambil dokumen untuk sinyal pengiriman lokal.">
|
||||
<!ENTITY options.blockMissing.title "Blokir permintaan untuk sumber daya yang hilang">
|
||||
<!ENTITY options.blockMissing.description "Batalkan intersep permintaan jika sumber daya yang dibutuhkan tidak tersedia secara lokal.">
|
||||
<!ENTITY options.domainWhitelist.title "Cegah inspeksi domain">
|
||||
<!ENTITY options.domainWhitelist.description "Masukkan domain ke daftar putih. Pisahkan entri dengan titik koma (;).">
|
||||
<!ENTITY options.amountInjected.title "Sumber daya lokal yang disematkan">
|
||||
<!ENTITY options.amountInjected.description "Jumlah penyematan sumber daya Jaringan Distribusi Konten lokal sejak pemasangan.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Aggiungere commenti a file raccolti localmente">
|
||||
<!ENTITY options.addNotice.description "Antepone automaticamente un avviso ai documenti recuperati per segnalare la distribuzione locale.">
|
||||
<!ENTITY options.blockMissing.title "Bloccare richieste di risorse mancanti">
|
||||
<!ENTITY options.blockMissing.description "Annullare la richiesta intercettata se la risorsa necessaria non è disponibile localmente.">
|
||||
<!ENTITY options.domainWhitelist.title "Escludere domini dalle ispezioni">
|
||||
<!ENTITY options.domainWhitelist.description "Inserire domini nella whitelist per escluderli. Separare voci multiple con punti e virgola (;).">
|
||||
<!ENTITY options.amountInjected.title "Contatore per risorse iniettate localmente">
|
||||
<!ENTITY options.amountInjected.description "Quantità di iniezioni di risorse dalla Rete di Distribuzione di Contenuti locale sin dall'installazione.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "ローカルからのファイルにコメントを追加する">
|
||||
<!ENTITY options.addNotice.description "ローカルCDNから取得したドキュメントにその旨を記載する。">
|
||||
<!ENTITY options.blockMissing.title "存在しないリソースへの要求をブロック">
|
||||
<!ENTITY options.blockMissing.description "必要なリソースがローカルで利用できない場合、リクエストを取り消す。">
|
||||
<!ENTITY options.domainWhitelist.title "保護から除外するドメイン">
|
||||
<!ENTITY options.domainWhitelist.description "ホワイト リストにドメインを入力します。複数のエントリをセミコロン (;) で区切ります。">
|
||||
<!ENTITY options.amountInjected.title "ローカルから挿入されたリソースの数">
|
||||
<!ENTITY options.amountInjected.description "インストールから起算した、ローカルCDNのリソース使用数。">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Notities aan lokale bestanden toevoegen">
|
||||
<!ENTITY options.addNotice.description "Voorzie alle door deze add-on opgehaalde bestanden automatisch van een notitie.">
|
||||
<!ENTITY options.blockMissing.title "Stop verzoeken voor ontbrekende items">
|
||||
<!ENTITY options.blockMissing.description "Annuleer een onderschept verzoek wanneer het bestand niet lokaal beschikbaar is.">
|
||||
<!ENTITY options.domainWhitelist.title "Sluit domeinen uit van inspecties">
|
||||
<!ENTITY options.domainWhitelist.description "Voer de te negeren domeinen in. Scheid de waarden met puntkomma's (;).">
|
||||
<!ENTITY options.amountInjected.title "Teller voor lokaal geïnjecteerde bestanden">
|
||||
<!ENTITY options.amountInjected.description "Aantal lokale Content Delivery Network bestandsinjecties sinds installatie.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Dodaj komentarz do plików przechowywanych lokalnie">
|
||||
<!ENTITY options.addNotice.description "Automatycznie dodawaj powiadomienie do pobranych dokumentów aby zasygnalizować lokalne dostarczanie.">
|
||||
<!ENTITY options.blockMissing.title "Blokuj żądania brakujących zasobów">
|
||||
<!ENTITY options.blockMissing.description "Anuluj przechwycone żądania jeśli wymagany zasób nie jest dostępny lokalnie.">
|
||||
<!ENTITY options.domainWhitelist.title "Wyklucz domeny z analizy">
|
||||
<!ENTITY options.domainWhitelist.description "Podaj domeny aby dodać je do białej listy. Oddziel wpisy średnikami (;).">
|
||||
<!ENTITY options.amountInjected.title "Licznik zasobów podanych lokalnie">
|
||||
<!ENTITY options.amountInjected.description "Ilość wstrzyknięć z lokalnego Content Delivery Network od czasu instalacji.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "Adicionar comentários aos ficheiros obtidos localmente">
|
||||
<!ENTITY options.addNotice.description "Preceder automaticamente um aviso aos documentos readquiridos para sinalizar a entrega local.">
|
||||
<!ENTITY options.blockMissing.title "Bloquear pedidos por falta de recursos">
|
||||
<!ENTITY options.blockMissing.description "Cancelar pedido intercetado se o recurso necessário não estiver disponível localmente.">
|
||||
<!ENTITY options.domainWhitelist.title "Excluir domínios de inspeções">
|
||||
<!ENTITY options.domainWhitelist.description "Insira domínios para os colocar na lista branca. Separe múltiplas entradas com pontos e vírgulas (;).">
|
||||
<!ENTITY options.amountInjected.title "Contador para recursos injetados localmente">
|
||||
<!ENTITY options.amountInjected.description "Quantidade de injeções de recurso Content Delivery Network locais desde a instalação.">
|
||||
@@ -1,8 +0,0 @@
|
||||
<!ENTITY options.addNotice.title "添加注释到从本地获取的文件">
|
||||
<!ENTITY options.addNotice.description "自动预置一个通知到获取的文档以标记从本地交付。">
|
||||
<!ENTITY options.blockMissing.title "阻止缺失资源的请求">
|
||||
<!ENTITY options.blockMissing.description "取消被拦截的请求,如果请求的资源在本地不可用。">
|
||||
<!ENTITY options.domainWhitelist.title "排除要检查的域名">
|
||||
<!ENTITY options.domainWhitelist.description "输入白名单的域名。用分号 (;) 分隔多项。">
|
||||
<!ENTITY options.amountInjected.title "本地发送资源的计数器">
|
||||
<!ENTITY options.amountInjected.description "自安装以来,从本地的“内容交付网络”发送的资源总量。">
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"locales": []
|
||||
}
|
||||
61
manifest.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Decentraleyes",
|
||||
"version": "2.0.0beta2",
|
||||
|
||||
"author": "Thomas Rientjes",
|
||||
|
||||
"default_locale": "en_US",
|
||||
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
"48": "icons/icon48.png",
|
||||
"96": "icons/icon96.png",
|
||||
"128": "icons/icon128.png"
|
||||
},
|
||||
|
||||
"permissions": [
|
||||
"*://*/*",
|
||||
"privacy",
|
||||
"storage",
|
||||
"tabs",
|
||||
"webNavigation",
|
||||
"webRequest",
|
||||
"webRequestBlocking"
|
||||
],
|
||||
|
||||
"background": {
|
||||
"page": "pages/background/background.html"
|
||||
},
|
||||
|
||||
"browser_action": {
|
||||
"default_icon": {
|
||||
"18": "icons/action/icon18.png",
|
||||
"19": "icons/action/icon19.png",
|
||||
"32": "icons/action/icon32.png",
|
||||
"36": "icons/action/icon36.png",
|
||||
"38": "icons/action/icon38.png",
|
||||
"64": "icons/action/icon64.png"
|
||||
},
|
||||
"default_popup": "pages/popup/popup.html",
|
||||
"browser_style": false
|
||||
},
|
||||
|
||||
"options_ui": {
|
||||
"page": "pages/options/options.html",
|
||||
"browser_style": true,
|
||||
"chrome_style": true
|
||||
},
|
||||
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "jid1-BoFifL9Vbdl2zQ@jetpack",
|
||||
"strict_min_version": "56.0a1"
|
||||
}
|
||||
},
|
||||
|
||||
"web_accessible_resources": [
|
||||
"resources/*"
|
||||
]
|
||||
}
|
||||
1
modules/fontawesome/fontawesome.js
Normal file
1
modules/fontawesome/packs/solid.js
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";function c(c){if(null===c||void 0===c)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function l(c){"function"==typeof V.hooks.addPack?V.hooks.addPack(c,h):V.packs[c]=a({},V.packs[c]||{},h)}var h={cog:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"],"power-off":[512,512,[],"f011","M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"],globe:[512,512,[],"f0ac","M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"],"shield-alt":[512,512,[],"f3ca","M496 128c0 221.282-135.934 344.645-221.539 380.308a48 48 0 0 1-36.923 0C130.495 463.713 16 326.487 16 128a48 48 0 0 1 29.539-44.308l192-80a48 48 0 0 1 36.923 0l192 80A48 48 0 0 1 496 128zM256 446.313l.066.034c93.735-46.689 172.497-156.308 175.817-307.729L256 65.333v380.98z"]},v=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,a=function(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de","5"===Object.getOwnPropertyNames(c)[0])return!1;for(var l={},h=0;h<10;h++)l["_"+String.fromCharCode(h)]=h;if("0123456789"!==Object.getOwnPropertyNames(l).map(function(c){return l[c]}).join(""))return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(c){v[c]=c}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},v)).join("")}catch(c){return!1}}()?Object.assign:function(l,h){for(var a,M,V=c(l),f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var e in a)z.call(a,e)&&(V[e]=a[e]);if(v){M=v(a);for(var m=0;m<M.length;m++)H.call(a,M[m])&&(V[M[m]]=a[M[m]])}}return V},M=a({},{namespace:"___FONT_AWESOME___",familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoA11y:!0,observeMutations:!0,keepOriginalSource:!0,measurePerformance:!1},window.FontAwesomeConfig||{});M.autoReplaceSvg||(M.observeMutations=!1),window[M.namespace]||(window[M.namespace]={}),window[M.namespace].packs||(window[M.namespace].packs={}),window[M.namespace].hooks||(window[M.namespace].hooks={}),window[M.namespace].shims||(window[M.namespace].shims=[]);var V=window[M.namespace];l("fas"),l("fa")}();
|
||||
0
modules/internal/.gitkeep
Normal file
BIN
modules/noto-sans/noto-sans-bold.woff2
Normal file
BIN
modules/noto-sans/noto-sans-italic.woff2
Normal file
BIN
modules/noto-sans/noto-sans.woff2
Normal file
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE vbox SYSTEM "chrome://decentraleyes/locale/options.dtd">
|
||||
<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.addNotice" pref-name="addNotice" title="&options.addNotice.title;" type="bool">&options.addNotice.description;</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing" pref-name="blockMissing" title="&options.blockMissing.title;" type="bool">&options.blockMissing.description;</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist" pref-name="domainWhitelist" title="&options.domainWhitelist.title;" type="string">&options.domainWhitelist.description;</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected" pref-name="amountInjected" title="&options.amountInjected.title;" type="integer">&options.amountInjected.description;</setting>
|
||||
</vbox>
|
||||
16
package.json
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"description": "Local emulation of Content Delivery Networks.",
|
||||
"author": "Thomas Rientjes",
|
||||
"license": "MPL-2.0",
|
||||
"title": "Decentraleyes",
|
||||
"version": "1.3.0",
|
||||
"main": "lib/main.js",
|
||||
"homepage": "https://addons.mozilla.org/firefox/addon/decentraleyes",
|
||||
"name": "decentraleyes",
|
||||
"id": "jid1-BoFifL9Vbdl2zQ@jetpack",
|
||||
"engines": {
|
||||
"firefox": ">=38.0a1",
|
||||
"fennec": ">=38.0a1",
|
||||
"seamonkey": ">=2.0a1 <=2.46"
|
||||
}
|
||||
}
|
||||
22
pages/background/background.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>Decentraleyes Background</title>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="../../core/files.js"></script>
|
||||
<script src="../../core/resources.js"></script>
|
||||
<script src="../../core/mappings.js"></script>
|
||||
<script src="../../core/state-manager.js"></script>
|
||||
<script src="../../core/request-analyzer.js"></script>
|
||||
<script src="../../core/interceptor.js"></script>
|
||||
<script src="../../core/main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
83
pages/options/options.css
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Sections
|
||||
*/
|
||||
|
||||
body {
|
||||
color: #555;
|
||||
font-family: 'Noto Sans', Arial, sans-serif !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonts
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('../../modules/noto-sans/noto-sans.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: url('../../modules/noto-sans/noto-sans-bold.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url('../../modules/noto-sans/noto-sans-italic.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
/**
|
||||
* Titles
|
||||
*/
|
||||
|
||||
.title-option {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls
|
||||
*/
|
||||
|
||||
.input-checkbox {
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
||||
.input-text {
|
||||
margin-left: 29px !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* Miscellaneous
|
||||
*/
|
||||
|
||||
.description-option {
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
margin-bottom: 18px;
|
||||
padding-left: 29px;
|
||||
}
|
||||
|
||||
.label {
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
font-size: 8px;
|
||||
margin-left: 6px;
|
||||
padding: 3px 5px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.label-warning {
|
||||
background-color: #ffa500;
|
||||
}
|
||||
44
pages/options/options.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title>Decentraleyes Options</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="options.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="options.js"></script>
|
||||
|
||||
<section>
|
||||
|
||||
<label class="title-option">
|
||||
|
||||
<input class="input-checkbox" data-option="blockMissing" type="checkbox">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
<span class="label label-warning" data-i18n-content="advancedLabel"></span>
|
||||
|
||||
</label>
|
||||
|
||||
<div class="description-option" data-i18n-content="blockMissingDescription"></div>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="title-option" data-i18n-content="domainWhitelistTitle"></div>
|
||||
<input class="input-text" data-option="domainWhitelist" type="text">
|
||||
<div class="description-option" data-i18n-content="domainWhitelistDescription"></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
90
pages/options/options.js
Normal file
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Main Options Page
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-08-09
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const WEB_PREFIX_VALUE = 'www.';
|
||||
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
|
||||
const VALUE_SEPARATOR = ';';
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
let i18nElements, blockMissingElement, domainWhitelistElement;
|
||||
|
||||
i18nElements = document.querySelectorAll('[data-i18n-content]');
|
||||
|
||||
i18nElements.forEach(function (i18nElement) {
|
||||
|
||||
let i18nMessageName = i18nElement.getAttribute('data-i18n-content');
|
||||
i18nElement.innerText = chrome.i18n.getMessage(i18nMessageName);
|
||||
});
|
||||
|
||||
blockMissingElement = document.querySelector('[data-option=blockMissing]');
|
||||
domainWhitelistElement = document.querySelector('[data-option=domainWhitelist]');
|
||||
|
||||
chrome.storage.local.get(['blockMissing', 'whitelistedDomains'], function (items) {
|
||||
|
||||
let whitelistedDomains = items.whitelistedDomains || {};
|
||||
let domainWhitelist = '';
|
||||
|
||||
Object.keys(whitelistedDomains).forEach(function (domain) {
|
||||
domainWhitelist = domainWhitelist + domain + ';';
|
||||
});
|
||||
|
||||
domainWhitelist = domainWhitelist.slice(0, -1);
|
||||
|
||||
blockMissingElement.checked = items.blockMissing || false;
|
||||
domainWhitelistElement.value = domainWhitelist || '';
|
||||
});
|
||||
|
||||
let optionChangedHandler = function () {
|
||||
|
||||
let whitelistedDomains = {};
|
||||
|
||||
domainWhitelistElement.value.split(VALUE_SEPARATOR).forEach(function (domain) {
|
||||
whitelistedDomains[_normalizeDomain(domain)] = true;
|
||||
});
|
||||
|
||||
chrome.storage.local.set({
|
||||
|
||||
'blockMissing': blockMissingElement.checked,
|
||||
'whitelistedDomains': whitelistedDomains
|
||||
});
|
||||
};
|
||||
|
||||
blockMissingElement.addEventListener('change', optionChangedHandler);
|
||||
domainWhitelistElement.addEventListener('keyup', optionChangedHandler);
|
||||
});
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
function _normalizeDomain(domain) {
|
||||
|
||||
domain = domain.toLowerCase().trim();
|
||||
|
||||
if (domain.startsWith(WEB_PREFIX_VALUE)) {
|
||||
domain = domain.slice(WEB_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
return domain;
|
||||
}
|
||||
8
pages/popup/icon.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="7.1673mm" width="7.2061mm" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 25.5334 25.395792">
|
||||
<g transform="translate(177.77 -519.66)">
|
||||
<path d="m-165 519.66c-2.6196 0-4.9735 0.71508-7.2323 2.1971-0.9279 0.60864-2.7283 2.4092-3.337 3.337-1.4712 2.2424-2.1972 4.6154-2.1972 7.1819 0 2.5788 0.7141 4.9223 2.1797 7.1552 0.6309 0.96123 2.4192 2.7501 3.3802 3.3808 1.4791 0.97083 3.2841 1.71 4.9268 2.0176 1.0838 0.20297 3.9457 0.15209 5.0159-0.0894 2.4596-0.55481 4.4742-1.6723 6.29-3.4887 2.4847-2.4856 3.7408-5.4989 3.7408-8.9756 0-3.4682-1.2629-6.498-3.7405-8.9756-2.4919-2.4919-5.5045-3.7404-9.0264-3.7404z" fill="#7db69f"/>
|
||||
<path d="m-165.02 528.24c-0.8699 0-1.6514 0.23746-2.4016 0.72959-0.3081 0.20212-0.9061 0.80004-1.1081 1.1081-0.4886 0.74466-0.7298 1.5326-0.7298 2.3849 0 0.85636 0.2371 1.6346 0.724 2.3761 0.2094 0.3192 0.8033 0.91326 1.1224 1.1227 0.4911 0.32239 1.0906 0.56785 1.6361 0.67001 0.3598 0.0673 1.3102 0.0504 1.6658-0.0297 0.8167-0.18424 1.4856-0.55532 2.0886-1.1585 0.8251-0.8254 1.2423-1.826 1.2423-2.9806 0-1.1517-0.4195-2.1578-1.2421-2.9806-0.8277-0.82751-1.8279-1.2421-2.9976-1.2421z" fill="#4a826c"/>
|
||||
<path d="m-2404.4 671.18c-3.2399-0.0194-6.3107 1.2365-8.6289 3.5547 0 0.002 0 0.004-0.01 0.006-1.9541 1.9569-3.1473 4.4242-3.4687 7.1758-0.1336 1.143-0.1324 1.8177 0.2265 2.3984 0.3941 0.63745 0.9181 0.94336 1.6758 0.94336 0.2981 0 0.6535-0.10695 0.916-0.24414 0.2434-0.12713 0.6126-0.46272 0.7539-0.69141 0.065-0.10555 0.202-0.39493 0.2403-0.56641 0.053-0.23546 0.061-0.41065 0.084-0.74218 0.088-1.2626 0.2865-2.0912 0.7089-3.0312 0.4385-0.97557 0.9254-1.6871 1.6778-2.4395 1.2078-1.2078 2.6659-1.965 4.3828-2.2754 0.3293-0.0595 0.7416-0.0624 1.2617-0.0684s1.0247-0.004 1.3828 0.0469c0.3661 0.0518 0.6053 0.0832 0.9219 0.0391 0.2645-0.0368 0.6003-0.19398 0.791-0.32031 0.8224-0.54467 1.1248-1.5151 0.707-2.4219a0.6513 0.6513 0 0 1 0 -0.002c-0.1439-0.31257-0.5075-0.75154-0.8496-0.92969-0.4136-0.21541-0.8031-0.27857-1.3769-0.3457-0.4667-0.0546-0.9332-0.0832-1.3985-0.0859zm9.3692 6.3516c-1.074-0.004-1.9883 0.87522-1.9883 1.957 0 1.3647 1.5564 2.3925 2.7988 1.8066 0.3338-0.1574 0.8593-0.69555 0.9922-1.0137 0.5288-1.2658-0.423-2.7422-1.8008-2.75zm-1.291 9.6602c-0.5015 0.009-1.1313 0.39448-1.4707 0.78906-0.7801 0.90716-0.9293 1.0694-1.2911 1.3887-1.0664 0.94113-2.4514 1.6118-3.957 1.9062-0.394 0.0771-0.8958 0.072-1.4824 0.0664-0.5866-0.006-1.0998-0.0118-1.4941-0.0957l0.1328 0.0137a0.6513 0.6513 0 0 1 -0.1328 -0.0137c-1.5797-0.33594-2.8091-0.96601-4.0195-2.0606-0.3529-0.31903-0.5674-0.50965-0.8692-0.67969-0.2288-0.12895-0.689-0.22851-0.8945-0.22851-1.03 0-1.951 0.94359-1.9551 1.9688v0.002a0.6513 0.6513 0 0 1 0 0.002c0 0.26313 0.1216 0.80286 0.3028 1.0781 0.2346 0.35637 0.5009 0.59192 0.957 0.99805 1.8218 1.622 4.2177 2.6942 6.6543 2.9746 0.7641 0.0879 1.9155 0.0871 2.6895 0.002 2.1894-0.23969 4.2945-1.0791 6.0489-2.4082 0.7055-0.53445 1.6855-1.491 2.2129-2.1816 0.2682-0.35126 0.4557-0.64063 0.5664-1.0176 0.098-0.33319 0.076-0.788-0.01-1.0938-0.1165-0.42605-0.279-0.59899-0.5546-0.85157-0.2646-0.24237-0.4858-0.39738-0.8809-0.49218-0.1798-0.0432-0.3602-0.0694-0.5527-0.0664z" fill-rule="evenodd" transform="matrix(.82404 0 0 .82404 1816.1 -30.489)" fill="#f1f7f5"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
249
pages/popup/popup.css
Normal file
@@ -0,0 +1,249 @@
|
||||
/**
|
||||
* Sections
|
||||
*/
|
||||
|
||||
body {
|
||||
background-color: #f0f0f0;
|
||||
color: #555;
|
||||
cursor: default;
|
||||
font-family: 'Noto Sans', Arial, sans-serif !important;
|
||||
font-size: 75%;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
width: 348px;
|
||||
}
|
||||
|
||||
header {
|
||||
align-items: center;
|
||||
border-bottom: solid #d3d3d3 1px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.panel {
|
||||
overflow: hidden;
|
||||
padding: 10px 8px;
|
||||
}
|
||||
|
||||
.panel:not(:last-child) {
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
}
|
||||
|
||||
.subpanel {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
footer {
|
||||
overflow: hidden;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonts
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('../../modules/noto-sans/noto-sans.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: url('../../modules/noto-sans/noto-sans-bold.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url('../../modules/noto-sans/noto-sans-italic.woff2')
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
/**
|
||||
* Headings
|
||||
*/
|
||||
|
||||
.heading {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.subheading {
|
||||
font-weight: 600;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists
|
||||
*/
|
||||
|
||||
.list {
|
||||
margin: 0;
|
||||
padding: 8px 0 0;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
background-color: #f7f7f7;
|
||||
border: 1px solid #e4e4e4;
|
||||
color: #737373;
|
||||
font-weight: 600;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.sublist {
|
||||
align-items: center;
|
||||
background-color: #ececec;
|
||||
border: 1px solid #e0e0e0;
|
||||
box-shadow: inset 0px 2px 10px #e2e2e2;
|
||||
list-style: none;
|
||||
padding-left: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sublist:last-child {
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.sublist-item {
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
color: #737373;
|
||||
font-weight: 600;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.sublist-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
|
||||
.icon {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.icon-logo {
|
||||
height: 26px;
|
||||
padding: 14px 6px 14px 8px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Buttons
|
||||
*/
|
||||
|
||||
.button {
|
||||
-moz-user-select: none;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #cfcfcf;
|
||||
color: #5f5f5f;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
padding: 5px 22px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: #dedede;
|
||||
}
|
||||
|
||||
.button-toggle {
|
||||
border-color: #d8d8d8;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.button-toggle.active {
|
||||
border-color: #cfcfcf;
|
||||
color: #339a6f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links
|
||||
*/
|
||||
|
||||
.link-text {
|
||||
color: #bdbdbd;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
padding-left: 4px;
|
||||
padding-top: 5px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.link-text:hover {
|
||||
color: #777;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Miscellaneous
|
||||
*/
|
||||
|
||||
.badge {
|
||||
background-color: #6bb798;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
margin-right: 8px;
|
||||
padding: 3px 15px;
|
||||
}
|
||||
|
||||
.counter {
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
margin-top: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
margin: 0 6px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.label-beta {
|
||||
color: #6aac91;
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.label-domain {
|
||||
color: #bbb;
|
||||
display: flex;
|
||||
font-style: italic;
|
||||
overflow: hidden;
|
||||
padding: 6px 0 0 4px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.side-note {
|
||||
color: #a5a5a5;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
72
pages/popup/popup.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title>Decentraleyes Popup</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="popup.css">
|
||||
|
||||
<script defer src="../../modules/fontawesome/packs/solid.js"></script>
|
||||
<script defer src="../../modules/fontawesome/fontawesome.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src="popup.js"></script>
|
||||
|
||||
<header>
|
||||
|
||||
<img class="icon-logo" src="icon.svg" alt="Extension Icon">
|
||||
<div class="heading">Decentraleyes <sup class="label-beta">BETA</sup></div>
|
||||
|
||||
</header>
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div id="website-context" class="panel hidden">
|
||||
|
||||
<div class="subpanel">
|
||||
|
||||
<div id="protection-toggle-button" class="button button-toggle active">
|
||||
<i class="fas fa-power-off" data-fa-transform="grow-2"></i>
|
||||
</div>
|
||||
|
||||
<div class="label-domain">
|
||||
<i class="icon fas fa-globe fa-lg" data-fa-transform="down-1"></i>
|
||||
<span id="domain-indicator"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="extension-context" class="panel">
|
||||
|
||||
<div id="injection-counter" class="counter">0</div>
|
||||
|
||||
<div class="subheading" data-i18n-content="amountInjectedTitle"></div>
|
||||
<div class="description" data-i18n-content="amountInjectedDescription"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
|
||||
<span id="testing-utility-link" class="link-text">decentraleyes.org/test</span>
|
||||
|
||||
<div id="options-button" class="button">
|
||||
<i class="fas fa-cog" data-fa-transform="grow-2"></i>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
342
pages/popup/popup.js
Normal file
@@ -0,0 +1,342 @@
|
||||
/**
|
||||
* Main Popup Page
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2016-08-09
|
||||
* @license MPL 2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Popup
|
||||
*/
|
||||
|
||||
var popup = {};
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
const WEB_DOMAIN_EXPRESSION = /:\/\/(.[^\/]+)(.*)/;
|
||||
const WEB_PREFIX_VALUE = 'www.';
|
||||
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
let optionsButtonElement, i18nElements;
|
||||
|
||||
optionsButtonElement = document.getElementById('options-button');
|
||||
|
||||
let optionsTitle = chrome.i18n.getMessage('optionsTitle');
|
||||
optionsButtonElement.setAttribute('title', optionsTitle);
|
||||
|
||||
i18nElements = document.querySelectorAll('[data-i18n-content]');
|
||||
|
||||
i18nElements.forEach(function (i18nElement) {
|
||||
|
||||
let i18nMessageName = i18nElement.getAttribute('data-i18n-content');
|
||||
i18nElement.innerText = chrome.i18n.getMessage(i18nMessageName);
|
||||
});
|
||||
|
||||
chrome.storage.local.get('amountInjected', function (items) {
|
||||
|
||||
let amountInjected = items.amountInjected || 0;
|
||||
document.getElementById('injection-counter').innerText = amountInjected;
|
||||
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
|
||||
|
||||
browser.runtime.getBackgroundPage().then(function (backgroundPage) {
|
||||
|
||||
if (backgroundPage === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
popup.backgroundPage = backgroundPage;
|
||||
|
||||
if (backgroundPage.main.operatingSystem === 'android') {
|
||||
|
||||
browser.tabs.getCurrent().then(function (tab) {
|
||||
|
||||
browser.tabs.update(tab.id, {
|
||||
'active': true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
let injections, injectionOverview, domain;
|
||||
|
||||
injections = backgroundPage.stateManager.tabs[tabs[0].id].injections;
|
||||
injectionOverview = {};
|
||||
|
||||
try {
|
||||
domain = tabs[0].url.match(WEB_DOMAIN_EXPRESSION)[1];
|
||||
} catch (exception) {
|
||||
domain = null;
|
||||
}
|
||||
|
||||
if (domain !== null) {
|
||||
|
||||
let websiteContextElement, protectionToggleElement, domainIndicatorElement;
|
||||
|
||||
websiteContextElement = document.getElementById('website-context');
|
||||
protectionToggleElement = document.getElementById('protection-toggle-button');
|
||||
domainIndicatorElement = document.getElementById('domain-indicator');
|
||||
|
||||
if (domain.startsWith(WEB_PREFIX_VALUE)) {
|
||||
domain = domain.slice(WEB_PREFIX_LENGTH);
|
||||
}
|
||||
|
||||
domainIndicatorElement.innerText = domain;
|
||||
|
||||
if (!backgroundPage.requestAnalyzer.whitelistedDomains[domain]) {
|
||||
|
||||
protectionToggleElement.setAttribute('class', 'button button-toggle active');
|
||||
|
||||
let disableProtectionTitle = chrome.i18n.getMessage('disableProtectionTitle');
|
||||
protectionToggleElement.setAttribute('title', disableProtectionTitle);
|
||||
|
||||
protectionToggleElement.addEventListener('click', function () {
|
||||
|
||||
backgroundPage.stateManager.addDomainToWhitelist(domain).then(function () {
|
||||
|
||||
chrome.tabs.reload(tabs[0].id);
|
||||
|
||||
if (backgroundPage.main.operatingSystem === 'android') {
|
||||
|
||||
return browser.tabs.getCurrent().then(function (tab) {
|
||||
browser.tabs.remove(tab.id);
|
||||
});
|
||||
}
|
||||
|
||||
return window.close();
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
protectionToggleElement.setAttribute('class', 'button button-toggle');
|
||||
|
||||
let enableProtectionTitle = chrome.i18n.getMessage('enableProtectionTitle');
|
||||
protectionToggleElement.setAttribute('title', enableProtectionTitle);
|
||||
|
||||
protectionToggleElement.addEventListener('click', function () {
|
||||
|
||||
backgroundPage.stateManager.deleteDomainFromWhitelist(domain).then(function () {
|
||||
|
||||
chrome.tabs.reload(tabs[0].id);
|
||||
|
||||
if (backgroundPage.main.operatingSystem === 'android') {
|
||||
|
||||
return browser.tabs.getCurrent().then(function (tab) {
|
||||
browser.tabs.remove(tab.id);
|
||||
});
|
||||
}
|
||||
|
||||
return window.close();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
websiteContextElement.setAttribute('class', 'panel');
|
||||
}
|
||||
|
||||
for (let injection in injections) {
|
||||
|
||||
injection = injections[injection];
|
||||
|
||||
let injectionSource = injection.source;
|
||||
injectionOverview[injectionSource] = injectionOverview[injectionSource] || [];
|
||||
|
||||
injectionOverview[injectionSource].push({
|
||||
'path': injection.path,
|
||||
'version': injection.version,
|
||||
'source': injection.source
|
||||
});
|
||||
}
|
||||
|
||||
let listElement = document.createElement('ul');
|
||||
listElement.setAttribute('class', 'list');
|
||||
|
||||
for (let injectionSource in injectionOverview) {
|
||||
|
||||
let cdn, listItemElement, badgeElement, badgeTextNode, cdnName, cdnNameTextNode, subListElement;
|
||||
|
||||
cdn = injectionOverview[injectionSource];
|
||||
|
||||
listItemElement = document.createElement('li');
|
||||
listItemElement.setAttribute('class', 'list-item');
|
||||
|
||||
badgeElement = document.createElement('span');
|
||||
badgeElement.setAttribute('class', 'badge');
|
||||
|
||||
badgeTextNode = document.createTextNode(cdn.length);
|
||||
badgeElement.appendChild(badgeTextNode);
|
||||
|
||||
switch (injectionSource) {
|
||||
|
||||
case 'ajax.googleapis.com':
|
||||
cdnName = 'Google Hosted Libraries';
|
||||
break;
|
||||
case 'ajax.aspnetcdn.com':
|
||||
cdnName = 'Microsoft Ajax CDN';
|
||||
break;
|
||||
case 'ajax.microsoft.com':
|
||||
cdnName = 'Microsoft Ajax CDN [Deprecated]';
|
||||
break;
|
||||
case 'cdnjs.cloudflare.com':
|
||||
cdnName = 'CDNJS (Cloudflare)';
|
||||
break;
|
||||
case 'code.jquery.com':
|
||||
cdnName = 'jQuery CDN (MaxCDN)';
|
||||
break;
|
||||
case 'cdn.jsdelivr.net':
|
||||
cdnName = 'jsDelivr (MaxCDN)';
|
||||
break;
|
||||
case 'yastatic.net':
|
||||
cdnName = 'Yandex CDN';
|
||||
break;
|
||||
case 'yandex.st':
|
||||
cdnName = 'Yandex CDN [Deprecated]';
|
||||
break;
|
||||
case 'libs.baidu.com':
|
||||
cdnName = 'Baidu CDN';
|
||||
break;
|
||||
case 'lib.sinaapp.com':
|
||||
cdnName = 'Sina Public Resources';
|
||||
break;
|
||||
case 'upcdn.b0.upaiyun.com':
|
||||
cdnName = 'UpYun Library';
|
||||
break;
|
||||
}
|
||||
|
||||
cdnNameTextNode = document.createTextNode(cdnName);
|
||||
|
||||
listItemElement.appendChild(badgeElement);
|
||||
listItemElement.appendChild(cdnNameTextNode);
|
||||
|
||||
listElement.appendChild(listItemElement);
|
||||
|
||||
subListElement = document.createElement('ul');
|
||||
subListElement.setAttribute('class', 'sublist');
|
||||
|
||||
listElement.appendChild(subListElement);
|
||||
|
||||
for (let injection of cdn) {
|
||||
|
||||
let subListItemElement, resourcePathDetails, resourceFilename, resourceName,
|
||||
resourceNameTextNode, sideNoteElement, sideNoteTextNode;
|
||||
|
||||
subListItemElement = document.createElement('li');
|
||||
subListItemElement.setAttribute('class', 'sublist-item');
|
||||
|
||||
resourcePathDetails = injection.path.split('/');
|
||||
resourceFilename = resourcePathDetails[resourcePathDetails.length - 1];
|
||||
|
||||
switch (resourceFilename) {
|
||||
|
||||
case 'angular.min.js.dec':
|
||||
resourceName = 'AngularJS';
|
||||
break;
|
||||
case 'backbone-min.js.dec':
|
||||
resourceName = 'Backbone.js';
|
||||
break;
|
||||
case 'dojo.js.dec':
|
||||
resourceName = 'Dojo';
|
||||
break;
|
||||
case 'ember.min.js.dec':
|
||||
resourceName = 'Ember.js';
|
||||
break;
|
||||
case 'ext-core.js.dec':
|
||||
resourceName = 'Ext Core';
|
||||
break;
|
||||
case 'jquery.min.js.dec':
|
||||
resourceName = 'jQuery';
|
||||
break;
|
||||
case 'jquery-ui.min.js.dec':
|
||||
resourceName = 'jQuery UI';
|
||||
break;
|
||||
case 'modernizr.min.js.dec':
|
||||
resourceName = 'Modernizr';
|
||||
break;
|
||||
case 'mootools-yui-compressed.js.dec':
|
||||
resourceName = 'MooTools';
|
||||
break;
|
||||
case 'prototype.js.dec':
|
||||
resourceName = 'Prototype';
|
||||
break;
|
||||
case 'scriptaculous.js.dec':
|
||||
resourceName = 'Scriptaculous';
|
||||
break;
|
||||
case 'swfobject.js.dec':
|
||||
resourceName = 'SWFObject';
|
||||
break;
|
||||
case 'underscore-min.js.dec':
|
||||
resourceName = 'Underscore.js';
|
||||
break;
|
||||
case 'webfont.js.dec':
|
||||
resourceName = 'Web Font Loader';
|
||||
break;
|
||||
}
|
||||
|
||||
resourceNameTextNode = document.createTextNode('- ' + resourceName);
|
||||
subListItemElement.appendChild(resourceNameTextNode);
|
||||
|
||||
sideNoteElement = document.createElement('span');
|
||||
sideNoteElement.setAttribute('class', 'side-note');
|
||||
|
||||
sideNoteTextNode = document.createTextNode(' v' + injection.version);
|
||||
|
||||
sideNoteElement.appendChild(sideNoteTextNode);
|
||||
subListItemElement.appendChild(sideNoteElement);
|
||||
|
||||
subListElement.appendChild(subListItemElement);
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(injectionOverview).length > 0) {
|
||||
|
||||
let websiteContextElement = document.getElementById('website-context');
|
||||
websiteContextElement.append(listElement);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
optionsButtonElement.addEventListener('mouseup', function () {
|
||||
|
||||
if (popup.backgroundPage.main.operatingSystem === 'android') {
|
||||
|
||||
return chrome.tabs.create({
|
||||
'url': chrome.extension.getURL('pages/options/options.html')
|
||||
});
|
||||
}
|
||||
|
||||
chrome.runtime.openOptionsPage();
|
||||
return window.close();
|
||||
});
|
||||
|
||||
document.getElementById('testing-utility-link').addEventListener('mouseup', function (event) {
|
||||
|
||||
if (event.button === 0 || event.button === 1) {
|
||||
|
||||
browser.tabs.create({
|
||||
'url': 'https://decentraleyes.org/test',
|
||||
'active': (event.button === 0)
|
||||
});
|
||||
}
|
||||
|
||||
if (event.button === 0) {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
});
|
||||