Compare commits
92 Commits
v1.2.0
...
v2.0.0beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
92f81f06bc | ||
|
|
b23a484b4c | ||
|
|
445d663d39 | ||
|
|
ff6244a311 | ||
|
|
1a53d2a39a | ||
|
|
54e293f2b9 | ||
|
|
301546619d | ||
|
|
6b510089e9 | ||
|
|
8617873115 | ||
|
|
c95a327363 | ||
|
|
bbd9c39a78 | ||
|
|
d93155844a | ||
|
|
16b887ff2e | ||
|
|
96b957bb09 | ||
|
|
2a6a744156 | ||
|
|
a77cd7f638 | ||
|
|
feb5b19e2c | ||
|
|
d89c22fc26 | ||
|
|
ffed66c813 | ||
|
|
488fb1fa83 | ||
|
|
64a2aefd25 | ||
|
|
9ee499620e | ||
|
|
ac65964995 | ||
|
|
14799d2814 | ||
|
|
1399bb40fd | ||
|
|
e695023bd1 | ||
|
|
685e108905 | ||
|
|
00c253d7cb | ||
|
|
c87a756533 | ||
|
|
216c205532 | ||
|
|
bbe5201e6e | ||
|
|
35a1563a69 | ||
|
|
f5f0154cfd | ||
|
|
7d8eee8607 | ||
|
|
d0277c0348 | ||
|
|
7a76fec2a8 | ||
|
|
2559457d0b | ||
|
|
f15778550c | ||
|
|
7a5e154575 | ||
|
|
4023d7c8d8 | ||
|
|
c595dca085 | ||
|
|
28845c0951 |
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
|
||||
43
README.md
@@ -1,43 +1,30 @@
|
||||
Decentraleyes
|
||||
=============
|
||||
|
||||
A [Firefox add-on](https://addons.mozilla.org/en-US/firefox/addon/decentraleyes) that emulates Content Delivery Networks 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.
|
||||
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.
|
||||
|
||||
#### Essential Next Steps
|
||||
|
||||
* 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.
|
||||
|
||||
#### Planned Features
|
||||
|
||||
* 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.
|
||||
|
||||
> **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.
|
||||
|
||||
## Contributing
|
||||
|
||||
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/en-US/firefox/addon/decentraleyes) to get in touch.
|
||||
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.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
* Jetpack Manager [jpm](https://developer.mozilla.org/en-US/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/en-US/Add-ons/SDK/Tutorials/Getting_started).
|
||||
* Mozilla Firefox 56 *(or higher)*.
|
||||
|
||||
#### Build Instructions (Unix)
|
||||
> **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.
|
||||
|
||||
git clone https://github.com/Synzvato/decentraleyes
|
||||
cd decentraleyes
|
||||
jpm xpi
|
||||
#### Running the Code
|
||||
|
||||
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).
|
||||
|
||||
## License
|
||||
|
||||
[MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0).
|
||||
[MPL-2.0](https://www.mozilla.org/MPL/2.0).
|
||||
|
||||
30
_locales/bg/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Защитава ви от следене чрез свободна, централизирана доставка на съдържание.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/da/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Beskytter dig imod sporing af \"gratis\", centraliserede indholdsleverandører.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/de/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Schützt vor Tracking durch \"gratis\", zentralisiertes, Abliefern von Content.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/el/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Προστατεύει από παρακολούθηση μέσω \"δωρεάν\" διανομής περιεχόμενου.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/en_GB/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protects you against tracking through \"free\", centralised, content delivery.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/en_US/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protects you against tracking through \"free\", centralized, content delivery.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/es/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protégete contra rastreo a través de entrega de contenido centralizado \"gratis\".",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/fi/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Suojaa sinua \"ilmaisten\" keskitettyjen sisällön jakeluverkkojen jäljitykseltä.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/fr/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protège du pistage lié à l'accès à des contenus \"gratuits\", centralisés.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/id/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Melindungi dari pelacakan melalui distribusi konten yang bebas dan terpusat.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/it/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protegge dal tracciamento tramite i CDN centralizzati \"gratuiti\".",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/ja/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "「無料」と称してあなたを追跡する大規模なCDNを迂回して、プライバシーを守ります。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/nl/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Beschermt tegen tracking via het \"gratis\", gecentraliseerd, verzorgen van content.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/pl/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Chroni przed śledzeniem przez ośrodki CDN.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/pt_PT/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Protege contra monitorização através de entrega de conteúdo centralizado.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/ru/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Защищает Вас от отслеживания через «бесплатные», централизованные CDN.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/sv/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "Skyddar dig mot att spåras av \"gratis\", centraliserat, innehållsleverans.",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/zh_CN/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "保护您免受集中式的内容交付网络(CDN)的跟踪。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
30
_locales/zh_TW/messages.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"extensionDescription": {
|
||||
"message": "保護您不受「免費」、中心化的內容傳遞網路(CDN)的追蹤。",
|
||||
"description": "Extension description."
|
||||
},
|
||||
"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."
|
||||
}
|
||||
}
|
||||
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,10 +1,10 @@
|
||||
{
|
||||
"name": "decentraleyes-audit",
|
||||
"version": "1.3.0",
|
||||
"version": "1.5.0",
|
||||
"author": "Thomas Rientjes",
|
||||
"license": "MPL 2.0",
|
||||
"license": "MPL-2.0",
|
||||
"description": "Library audit tool for Decentraleyes.",
|
||||
"repository": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/",
|
||||
"repository": "https://addons.mozilla.org/firefox/addon/decentraleyes",
|
||||
"keywords": [
|
||||
"decentraleyes",
|
||||
"audit"
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
262
core/files.js
Normal file
@@ -0,0 +1,262 @@
|
||||
/**
|
||||
* Files
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-07-24
|
||||
* @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';
|
||||
|
||||
/**
|
||||
* Files
|
||||
*/
|
||||
|
||||
var files = {
|
||||
|
||||
// AngularJS
|
||||
'resources/angularjs/1.0.1/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.2/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.3/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.4/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.5/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.6/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.0.8/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.0/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.1/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.10/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.15/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.16/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.20/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.23/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.26/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.28/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.2.29/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.0/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.3/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.8/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.10/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.11/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.14/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.3.15/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.4.0/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.4.2/angular.min.js.dec': true,
|
||||
'resources/angularjs/1.4.8/angular.min.js.dec': true,
|
||||
|
||||
// Backbone.js
|
||||
'resources/backbone.js/0.9.0/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/0.9.1/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/0.9.2/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/0.9.9/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/0.9.10/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.0.0/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.1.0/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.1.1/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.1.2/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.2.0/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.2.1/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.2.2/backbone-min.js.dec': true,
|
||||
'resources/backbone.js/1.2.3/backbone-min.js.dec': true,
|
||||
|
||||
// Dojo
|
||||
'resources/dojo/1.4.1/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.4.5/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.5.0/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.6.1/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.7.5/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.8.3/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.8.7/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.8.9/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.9.1/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.9.3/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.9.7/dojo/dojo.js.dec': true,
|
||||
'resources/dojo/1.10.4/dojo/dojo.js.dec': true,
|
||||
|
||||
// Ember.js
|
||||
'resources/ember.js/1.0.1/ember.min.js.dec': true,
|
||||
'resources/ember.js/1.1.3/ember.min.js.dec': true,
|
||||
'resources/ember.js/1.2.2/ember.min.js.dec': true,
|
||||
'resources/ember.js/1.3.2/ember.min.js.dec': true,
|
||||
'resources/ember.js/1.4.0/ember.min.js.dec': true,
|
||||
'resources/ember.js/1.5.1/ember.min.js.dec': true,
|
||||
'resources/ember.js/2.0.0/ember.min.js.dec': true,
|
||||
'resources/ember.js/2.0.2/ember.min.js.dec': true,
|
||||
'resources/ember.js/2.1.0/ember.min.js.dec': true,
|
||||
|
||||
// Ext Core
|
||||
'resources/ext-core/3.0.0/ext-core.js.dec': true,
|
||||
'resources/ext-core/3.1.0/ext-core.js.dec': true,
|
||||
|
||||
// jQuery
|
||||
'resources/jquery/1.2.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.2.6/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.3.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.3.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.3.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.4.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.4.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.4.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.4.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.4.4/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.5.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.5.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.5.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.6.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.6.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.6.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.6.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.6.4/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.7.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.7.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.7.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.8.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.8.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.8.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.8.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.9.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.9.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.10.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.10.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.10.2/jquery.min.js.dec': true,
|
||||
'resources/jquery/1.11.0/jquery.min.js.dec': true,
|
||||
'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,
|
||||
'resources/jquery/2.0.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.1.0/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.1.1/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.1.3/jquery.min.js.dec': true,
|
||||
'resources/jquery/2.1.4/jquery.min.js.dec': true,
|
||||
|
||||
// jQuery UI
|
||||
'resources/jqueryui/1.5.3/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.6.0/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.7.3/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.8.24/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.9.2/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.10.4/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.11.0/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.11.1/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.11.2/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.11.3/jquery-ui.min.js.dec': true,
|
||||
'resources/jqueryui/1.11.4/jquery-ui.min.js.dec': true,
|
||||
|
||||
// Modernizr
|
||||
'resources/modernizr/2.6.2/modernizr.min.js.dec': true,
|
||||
'resources/modernizr/2.7.1/modernizr.min.js.dec': true,
|
||||
'resources/modernizr/2.7.2/modernizr.min.js.dec': true,
|
||||
'resources/modernizr/2.8.2/modernizr.min.js.dec': true,
|
||||
'resources/modernizr/2.8.3/modernizr.min.js.dec': true,
|
||||
|
||||
// MooTools
|
||||
'resources/mootools/1.1.1/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.1.2/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.2.1/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.2.3/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.2.4/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.2.5/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.3.0/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.3.1/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.3.2/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.4.1/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.4.5/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.5.0/mootools-yui-compressed.js.dec': true,
|
||||
'resources/mootools/1.5.1/mootools-yui-compressed.js.dec': true,
|
||||
|
||||
// Prototype
|
||||
'resources/prototype/1.6.0.2/prototype.js.dec': true,
|
||||
'resources/prototype/1.6.0.3/prototype.js.dec': true,
|
||||
'resources/prototype/1.6.1.0/prototype.js.dec': true,
|
||||
'resources/prototype/1.7.0.0/prototype.js.dec': true,
|
||||
'resources/prototype/1.7.1.0/prototype.js.dec': true,
|
||||
'resources/prototype/1.7.2.0/prototype.js.dec': true,
|
||||
'resources/prototype/1.7.3.0/prototype.js.dec': true,
|
||||
|
||||
// Scriptaculous
|
||||
'resources/scriptaculous/1.8.1/scriptaculous.js.dec': true,
|
||||
'resources/scriptaculous/1.8.2/scriptaculous.js.dec': true,
|
||||
'resources/scriptaculous/1.8.3/scriptaculous.js.dec': true,
|
||||
'resources/scriptaculous/1.9.0/scriptaculous.js.dec': true,
|
||||
|
||||
// SWFObject
|
||||
'resources/swfobject/2.1/swfobject.js.dec': true,
|
||||
'resources/swfobject/2.2/swfobject.js.dec': true,
|
||||
|
||||
// Underscore.js
|
||||
'resources/underscore.js/1.3.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.3.1/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.3.3/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.4.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.4.1/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.4.2/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.4.3/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.4.4/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.5.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.5.1/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.5.2/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.6.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.7.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.8.0/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.8.1/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.8.2/underscore-min.js.dec': true,
|
||||
'resources/underscore.js/1.8.3/underscore-min.js.dec': true,
|
||||
|
||||
// Web Font Loader
|
||||
'resources/webfont/1.0.0/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.1/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.2/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.3/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.4/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.5/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.6/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.9/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.10/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.11/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.12/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.13/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.14/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.15/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.16/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.17/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.18/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.19/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.21/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.22/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.23/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.24/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.25/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.26/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.27/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.28/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.29/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.30/webfont.js.dec': true,
|
||||
'resources/webfont/1.0.31/webfont.js.dec': true,
|
||||
'resources/webfont/1.1.0/webfont.js.dec': true,
|
||||
'resources/webfont/1.1.1/webfont.js.dec': true,
|
||||
'resources/webfont/1.1.2/webfont.js.dec': true,
|
||||
'resources/webfont/1.3.0/webfont.js.dec': true,
|
||||
'resources/webfont/1.4.2/webfont.js.dec': true,
|
||||
'resources/webfont/1.4.6/webfont.js.dec': true,
|
||||
'resources/webfont/1.4.7/webfont.js.dec': true,
|
||||
'resources/webfont/1.4.8/webfont.js.dec': true,
|
||||
'resources/webfont/1.4.10/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.0/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.2/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.3/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.6/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.10/webfont.js.dec': true,
|
||||
'resources/webfont/1.5.18/webfont.js.dec': true
|
||||
};
|
||||
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);
|
||||
38
core/main.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
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
|
||||
*/
|
||||
@@ -41,7 +35,7 @@ var mappings = {
|
||||
'swfobject/{version}/swfobject.': resources.swfobject,
|
||||
'webfont/{version}/webfont.': resources.webfont,
|
||||
|
||||
// Common Shorthand Notations
|
||||
// Common Shorthand Notations [Deprecated]
|
||||
'dojo/1/dojo/dojo.': {
|
||||
path: 'resources/dojo/1.6.1/dojo/dojo.js.dec',
|
||||
type: 'application/javascript'
|
||||
@@ -83,14 +77,14 @@ var mappings = {
|
||||
// Microsoft Ajax CDN
|
||||
'ajax.aspnetcdn.com': {
|
||||
'/ajax/': {
|
||||
'jQuery/jquery-{version}.': resources.jQuery,
|
||||
'jquery/jquery-{version}.': resources.jQuery,
|
||||
'modernizr/modernizr-{version}.': resources.modernizr
|
||||
}
|
||||
},
|
||||
// Microsoft Ajax CDN [Deprecated]
|
||||
'ajax.microsoft.com': {
|
||||
'/ajax/': {
|
||||
'jQuery/jquery-{version}.': resources.jQuery,
|
||||
'jquery/jquery-{version}.': resources.jQuery,
|
||||
'modernizr/modernizr-{version}.': resources.modernizr
|
||||
}
|
||||
},
|
||||
@@ -122,7 +116,7 @@ var mappings = {
|
||||
'ui/{version}/jquery-ui.js': resources.jQueryUI,
|
||||
'ui/{version}/jquery-ui.min.js': resources.jQueryUI,
|
||||
|
||||
// Common Shorthand Notations
|
||||
// Common Shorthand Notations [Deprecated]
|
||||
'jquery-latest.': {
|
||||
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
@@ -130,6 +124,46 @@ var mappings = {
|
||||
'jquery.': {
|
||||
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.3.min.js': {
|
||||
path: 'resources/jquery/1.3.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.3.js': {
|
||||
path: 'resources/jquery/1.3.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.4.min.js': {
|
||||
path: 'resources/jquery/1.4.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.4.js': {
|
||||
path: 'resources/jquery/1.4.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.5.min.js': {
|
||||
path: 'resources/jquery/1.5.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.5.js': {
|
||||
path: 'resources/jquery/1.5.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.6.min.js': {
|
||||
path: 'resources/jquery/1.6.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.6.js': {
|
||||
path: 'resources/jquery/1.6.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.7.min.js': {
|
||||
path: 'resources/jquery/1.7.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
},
|
||||
'jquery-1.7.js': {
|
||||
path: 'resources/jquery/1.7.0/jquery.min.js.dec',
|
||||
type: 'application/javascript'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -152,6 +186,25 @@ var mappings = {
|
||||
}
|
||||
},
|
||||
// Yandex CDN
|
||||
'yastatic.net': {
|
||||
'/': {
|
||||
'angularjs/{version}/angular.': resources.angular,
|
||||
'backbone/{version}/backbone.': resources.backbone,
|
||||
'backbone/{version}/backbone-min.': resources.backbone,
|
||||
'dojo/{version}/dojo/dojo.': resources.dojo,
|
||||
'ext-core/{version}/ext-core.': resources.extCore,
|
||||
'jquery/{version}/jquery.': resources.jQuery,
|
||||
'jquery-ui/{version}/jquery-ui.js': resources.jQueryUI,
|
||||
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
|
||||
'modernizr/{version}/modernizr.': resources.modernizr,
|
||||
'prototype/{version}/prototype.': resources.prototypeJS,
|
||||
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
|
||||
'swfobject/{version}/swfobject.': resources.swfobject,
|
||||
'underscore/{version}/underscore.': resources.underscore,
|
||||
'underscore/{version}/underscore-min.': resources.underscore
|
||||
}
|
||||
},
|
||||
// Yandex CDN [Deprecated]
|
||||
'yandex.st': {
|
||||
'/': {
|
||||
'angularjs/{version}/angular.': resources.angular,
|
||||
@@ -224,9 +277,3 @@ var mappings = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = mappings;
|
||||
155
core/request-analyzer.js
Normal file
@@ -0,0 +1,155 @@
|
||||
/**
|
||||
* 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 = resourceMappings[resourceMold].path;
|
||||
targetPath = targetPath.replace(VERSION_PLACEHOLDER, versionNumber);
|
||||
|
||||
// Prepare and return a local target.
|
||||
return {
|
||||
source: channelHost,
|
||||
version: versionNumber[0],
|
||||
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;
|
||||
212
core/state-manager.js
Normal file
@@ -0,0 +1,212 @@
|
||||
/**
|
||||
* 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
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 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,4 +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);
|
||||
BIN
icon16.png
|
Before Width: | Height: | Size: 6.5 KiB |
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,97 +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');
|
||||
var resourceData = self.data;
|
||||
var version = self.version;
|
||||
|
||||
//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');
|
||||
|
||||
/**
|
||||
* 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.indexOf(targetPath) == -1) {
|
||||
throw 'The requested resource is missing.';
|
||||
}
|
||||
|
||||
// Attempt to load resource contents.
|
||||
try {
|
||||
resource = resourceData.load(targetPath);
|
||||
} catch (exception) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
function buildDataURI(type, characterSet, data) {
|
||||
|
||||
var addNotice, dataURI, notice;
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
addNotice = require('sdk/simple-prefs').prefs.addNotice;
|
||||
|
||||
dataURI = 'data:' + type + ';charset=' + characterSet + ',';
|
||||
notice = '/**\n * Local delivery by Decentraleyes (' + version + ').\n */\n\n';
|
||||
|
||||
if (!addNotice) {
|
||||
dataURI = dataURI + encodeURIComponent(data);
|
||||
} else {
|
||||
dataURI = dataURI + encodeURIComponent(notice + data);
|
||||
}
|
||||
|
||||
return dataURI;
|
||||
}
|
||||
263
lib/files.js
@@ -1,263 +0,0 @@
|
||||
/**
|
||||
* Files
|
||||
* Belongs to Decentraleyes.
|
||||
*
|
||||
* @author Thomas Rientjes
|
||||
* @since 2014-07-24
|
||||
* @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';
|
||||
|
||||
/**
|
||||
* Files
|
||||
*/
|
||||
|
||||
var files = [
|
||||
|
||||
// AngularJS
|
||||
'resources/angularjs/1.0.1/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.2/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.3/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.4/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.5/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.6/angular.min.js.dec',
|
||||
'resources/angularjs/1.0.8/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.0/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.1/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.10/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.15/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.16/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.20/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.23/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.26/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.28/angular.min.js.dec',
|
||||
'resources/angularjs/1.2.29/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.0/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.3/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.8/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.10/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.11/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.14/angular.min.js.dec',
|
||||
'resources/angularjs/1.3.15/angular.min.js.dec',
|
||||
'resources/angularjs/1.4.0/angular.min.js.dec',
|
||||
'resources/angularjs/1.4.2/angular.min.js.dec',
|
||||
'resources/angularjs/1.4.8/angular.min.js.dec',
|
||||
|
||||
// Backbone.js
|
||||
'resources/backbone.js/0.9.0/backbone-min.js.dec',
|
||||
'resources/backbone.js/0.9.1/backbone-min.js.dec',
|
||||
'resources/backbone.js/0.9.2/backbone-min.js.dec',
|
||||
'resources/backbone.js/0.9.9/backbone-min.js.dec',
|
||||
'resources/backbone.js/0.9.10/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.0.0/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.1.0/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.1.1/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.1.2/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.2.0/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.2.1/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.2.2/backbone-min.js.dec',
|
||||
'resources/backbone.js/1.2.3/backbone-min.js.dec',
|
||||
|
||||
// Dojo
|
||||
'resources/dojo/1.4.1/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.4.5/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.5.0/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.6.1/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.7.5/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.8.3/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.8.7/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.8.9/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.9.1/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.9.3/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.9.7/dojo/dojo.js.dec',
|
||||
'resources/dojo/1.10.4/dojo/dojo.js.dec',
|
||||
|
||||
// Ember.js
|
||||
'resources/ember.js/1.0.1/ember.min.js.dec',
|
||||
'resources/ember.js/1.1.3/ember.min.js.dec',
|
||||
'resources/ember.js/1.2.2/ember.min.js.dec',
|
||||
'resources/ember.js/1.3.2/ember.min.js.dec',
|
||||
'resources/ember.js/1.4.0/ember.min.js.dec',
|
||||
'resources/ember.js/1.5.1/ember.min.js.dec',
|
||||
'resources/ember.js/2.0.0/ember.min.js.dec',
|
||||
'resources/ember.js/2.0.2/ember.min.js.dec',
|
||||
'resources/ember.js/2.1.0/ember.min.js.dec',
|
||||
|
||||
// Ext Core
|
||||
'resources/ext-core/3.0.0/ext-core.js.dec',
|
||||
'resources/ext-core/3.1.0/ext-core.js.dec',
|
||||
|
||||
// jQuery
|
||||
'resources/jquery/1.2.3/jquery.min.js.dec',
|
||||
'resources/jquery/1.2.6/jquery.min.js.dec',
|
||||
'resources/jquery/1.3.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.3.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.3.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.4.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.4.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.4.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.4.3/jquery.min.js.dec',
|
||||
'resources/jquery/1.4.4/jquery.min.js.dec',
|
||||
'resources/jquery/1.5.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.5.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.5.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.6.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.6.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.6.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.6.3/jquery.min.js.dec',
|
||||
'resources/jquery/1.6.4/jquery.min.js.dec',
|
||||
'resources/jquery/1.7.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.7.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.7.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.8.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.8.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.8.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.8.3/jquery.min.js.dec',
|
||||
'resources/jquery/1.9.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.9.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.10.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.10.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.10.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.11.0/jquery.min.js.dec',
|
||||
'resources/jquery/1.11.1/jquery.min.js.dec',
|
||||
'resources/jquery/1.11.2/jquery.min.js.dec',
|
||||
'resources/jquery/1.11.3/jquery.min.js.dec',
|
||||
'resources/jquery/2.0.0/jquery.min.js.dec',
|
||||
'resources/jquery/2.0.1/jquery.min.js.dec',
|
||||
'resources/jquery/2.0.2/jquery.min.js.dec',
|
||||
'resources/jquery/2.0.3/jquery.min.js.dec',
|
||||
'resources/jquery/2.1.0/jquery.min.js.dec',
|
||||
'resources/jquery/2.1.1/jquery.min.js.dec',
|
||||
'resources/jquery/2.1.3/jquery.min.js.dec',
|
||||
'resources/jquery/2.1.4/jquery.min.js.dec',
|
||||
|
||||
// jQuery UI
|
||||
'resources/jqueryui/1.5.3/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.6.0/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.7.3/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.8.24/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.9.2/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.10.4/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.11.0/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.11.1/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.11.2/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.11.3/jquery-ui.min.js.dec',
|
||||
'resources/jqueryui/1.11.4/jquery-ui.min.js.dec',
|
||||
|
||||
// Modernizr
|
||||
'resources/modernizr/2.6.2/modernizr.min.js.dec',
|
||||
'resources/modernizr/2.7.1/modernizr.min.js.dec',
|
||||
'resources/modernizr/2.7.2/modernizr.min.js.dec',
|
||||
'resources/modernizr/2.8.2/modernizr.min.js.dec',
|
||||
'resources/modernizr/2.8.3/modernizr.min.js.dec',
|
||||
|
||||
// MooTools
|
||||
'resources/mootools/1.1.1/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.1.2/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.2.1/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.2.3/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.2.4/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.2.5/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.3.0/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.3.1/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.3.2/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.4.1/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.4.5/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.5.0/mootools-yui-compressed.js.dec',
|
||||
'resources/mootools/1.5.1/mootools-yui-compressed.js.dec',
|
||||
|
||||
// Prototype
|
||||
'resources/prototype/1.6.0.2/prototype.js.dec',
|
||||
'resources/prototype/1.6.0.3/prototype.js.dec',
|
||||
'resources/prototype/1.6.1.0/prototype.js.dec',
|
||||
'resources/prototype/1.7.0.0/prototype.js.dec',
|
||||
'resources/prototype/1.7.1.0/prototype.js.dec',
|
||||
'resources/prototype/1.7.2.0/prototype.js.dec',
|
||||
'resources/prototype/1.7.3.0/prototype.js.dec',
|
||||
|
||||
// Scriptaculous
|
||||
'resources/scriptaculous/1.8.1/scriptaculous.js.dec',
|
||||
'resources/scriptaculous/1.8.2/scriptaculous.js.dec',
|
||||
'resources/scriptaculous/1.8.3/scriptaculous.js.dec',
|
||||
'resources/scriptaculous/1.9.0/scriptaculous.js.dec',
|
||||
|
||||
// SWFObject
|
||||
'resources/swfobject/2.1/swfobject.js.dec',
|
||||
'resources/swfobject/2.2/swfobject.js.dec',
|
||||
|
||||
// Underscore.js
|
||||
'resources/underscore.js/1.3.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.3.1/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.3.3/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.4.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.4.1/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.4.2/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.4.3/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.4.4/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.5.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.5.1/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.5.2/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.6.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.7.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.8.0/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.8.1/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.8.2/underscore-min.js.dec',
|
||||
'resources/underscore.js/1.8.3/underscore-min.js.dec',
|
||||
|
||||
// Web Font Loader
|
||||
'resources/webfont/1.0.0/webfont.js.dec',
|
||||
'resources/webfont/1.0.1/webfont.js.dec',
|
||||
'resources/webfont/1.0.2/webfont.js.dec',
|
||||
'resources/webfont/1.0.3/webfont.js.dec',
|
||||
'resources/webfont/1.0.4/webfont.js.dec',
|
||||
'resources/webfont/1.0.5/webfont.js.dec',
|
||||
'resources/webfont/1.0.6/webfont.js.dec',
|
||||
'resources/webfont/1.0.9/webfont.js.dec',
|
||||
'resources/webfont/1.0.10/webfont.js.dec',
|
||||
'resources/webfont/1.0.11/webfont.js.dec',
|
||||
'resources/webfont/1.0.12/webfont.js.dec',
|
||||
'resources/webfont/1.0.13/webfont.js.dec',
|
||||
'resources/webfont/1.0.14/webfont.js.dec',
|
||||
'resources/webfont/1.0.15/webfont.js.dec',
|
||||
'resources/webfont/1.0.16/webfont.js.dec',
|
||||
'resources/webfont/1.0.17/webfont.js.dec',
|
||||
'resources/webfont/1.0.18/webfont.js.dec',
|
||||
'resources/webfont/1.0.19/webfont.js.dec',
|
||||
'resources/webfont/1.0.21/webfont.js.dec',
|
||||
'resources/webfont/1.0.22/webfont.js.dec',
|
||||
'resources/webfont/1.0.23/webfont.js.dec',
|
||||
'resources/webfont/1.0.24/webfont.js.dec',
|
||||
'resources/webfont/1.0.25/webfont.js.dec',
|
||||
'resources/webfont/1.0.26/webfont.js.dec',
|
||||
'resources/webfont/1.0.27/webfont.js.dec',
|
||||
'resources/webfont/1.0.28/webfont.js.dec',
|
||||
'resources/webfont/1.0.29/webfont.js.dec',
|
||||
'resources/webfont/1.0.30/webfont.js.dec',
|
||||
'resources/webfont/1.0.31/webfont.js.dec',
|
||||
'resources/webfont/1.1.0/webfont.js.dec',
|
||||
'resources/webfont/1.1.1/webfont.js.dec',
|
||||
'resources/webfont/1.1.2/webfont.js.dec',
|
||||
'resources/webfont/1.3.0/webfont.js.dec',
|
||||
'resources/webfont/1.4.2/webfont.js.dec',
|
||||
'resources/webfont/1.4.6/webfont.js.dec',
|
||||
'resources/webfont/1.4.7/webfont.js.dec',
|
||||
'resources/webfont/1.4.8/webfont.js.dec',
|
||||
'resources/webfont/1.4.10/webfont.js.dec',
|
||||
'resources/webfont/1.5.0/webfont.js.dec',
|
||||
'resources/webfont/1.5.2/webfont.js.dec',
|
||||
'resources/webfont/1.5.3/webfont.js.dec',
|
||||
'resources/webfont/1.5.6/webfont.js.dec',
|
||||
'resources/webfont/1.5.10/webfont.js.dec',
|
||||
'resources/webfont/1.5.18/webfont.js.dec'
|
||||
];
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = files;
|
||||
@@ -1,111 +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');
|
||||
|
||||
//noinspection JSUnresolvedFunction
|
||||
var observerService = Cc['@mozilla.org/observer-service;1']
|
||||
.getService(Ci.nsIObserverService);
|
||||
|
||||
var preferences = require('sdk/simple-prefs').prefs;
|
||||
|
||||
var requestAnalyzer = require('./request-analyzer');
|
||||
var dataHandler = require('./data-handler');
|
||||
|
||||
/**
|
||||
* 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);
|
||||
},
|
||||
|
||||
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);
|
||||
|
||||
// Temporary fix for reported issues with the Play Store website.
|
||||
if (httpChannel.referrer && httpChannel.referrer.host === 'play.google.com') {
|
||||
this.handleMissingCandidate(httpChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
// Convert the original request URI to a local target.
|
||||
target = requestAnalyzer.getLocalTarget(httpChannel.URI.host, httpChannel.URI.path);
|
||||
|
||||
if (!target) {
|
||||
this.handleMissingCandidate(httpChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
characterSet = httpChannel.URI.originCharset;
|
||||
|
||||
// Fetch local data and create a redirection URI.
|
||||
try {
|
||||
redirectionURI = dataHandler.getRedirectionURI(target.path, characterSet, target.type);
|
||||
} catch (exception) {
|
||||
this.handleMissingCandidate(httpChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
httpChannel.redirectTo(redirectionURI);
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
preferences.amountInjected++;
|
||||
},
|
||||
|
||||
handleMissingCandidate: function (httpChannel) {
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
if (preferences.blockMissing) {
|
||||
httpChannel.cancel(Cr.NS_ERROR_NOT_AVAILABLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
module.exports = Interceptor;
|
||||
27
lib/main.js
@@ -1,27 +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');
|
||||
|
||||
/**
|
||||
* Main
|
||||
*/
|
||||
|
||||
var interceptor = new Interceptor();
|
||||
interceptor.register();
|
||||
@@ -1,151 +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
|
||||
*/
|
||||
|
||||
var preferences = require('sdk/simple-prefs').prefs;
|
||||
|
||||
/**
|
||||
* Resource version mappings.
|
||||
* @var {object} mappings
|
||||
*/
|
||||
var mappings = require('./mappings');
|
||||
|
||||
/**
|
||||
* Public Methods
|
||||
*/
|
||||
|
||||
function isValidCandidate(httpChannel) {
|
||||
|
||||
if (mappings[httpChannel.URI.host] === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//noinspection JSUnresolvedVariable
|
||||
var domainWhitelist = preferences.domainWhitelist;
|
||||
|
||||
if (domainWhitelist.length > 0 && httpChannel.referrer) {
|
||||
|
||||
var whitelistedDomains = domainWhitelist.split(';');
|
||||
|
||||
for (var domain in whitelistedDomains) {
|
||||
|
||||
if (whitelistedDomains.hasOwnProperty(domain)) {
|
||||
|
||||
if (whitelistedDomains[domain] === httpChannel.referrer.host ||
|
||||
'www.' + whitelistedDomains[domain] === httpChannel.referrer.host) {
|
||||
|
||||
// Remove referer header from request.
|
||||
httpChannel.setRequestHeader('Referer', null, false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return httpChannel.requestMethod === 'GET';
|
||||
}
|
||||
|
||||
function getLocalTarget(channelHost, channelPath) {
|
||||
|
||||
var basePath, hostMappings, resourceMappings, localTarget;
|
||||
|
||||
hostMappings = mappings[channelHost];
|
||||
|
||||
// Ignore mapping files.
|
||||
if (channelPath.indexOf('.min.js.map') > -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (channelPath.indexOf('.min.map') > -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
basePath = matchBasePath(hostMappings, channelPath);
|
||||
|
||||
if (!basePath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceMappings = hostMappings[basePath];
|
||||
localTarget = matchResourcePath(resourceMappings, basePath, channelPath);
|
||||
|
||||
if (!localTarget) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return localTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports
|
||||
*/
|
||||
|
||||
exports.isValidCandidate = isValidCandidate;
|
||||
exports.getLocalTarget = getLocalTarget;
|
||||
|
||||
/**
|
||||
* Private Methods
|
||||
*/
|
||||
|
||||
function matchBasePath(hostMappings, channelPath) {
|
||||
|
||||
for (var basePath in hostMappings) {
|
||||
|
||||
if (hostMappings.hasOwnProperty(basePath)) {
|
||||
|
||||
if (channelPath.indexOf(basePath) === 0) {
|
||||
return basePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function matchResourcePath(resourceMappings, basePath, channelPath) {
|
||||
|
||||
var resourcePath, versionNumber, resourcePattern;
|
||||
|
||||
resourcePath = channelPath.replace(basePath, '');
|
||||
|
||||
versionNumber = resourcePath.match(/(?:\d{1,2}\.){1,3}\d{1,2}/);
|
||||
resourcePattern = resourcePath.replace(versionNumber, '{version}');
|
||||
|
||||
for (var resourceMold in resourceMappings) {
|
||||
|
||||
if (resourceMappings.hasOwnProperty(resourceMold)) {
|
||||
|
||||
if (resourcePattern.indexOf(resourceMold) === 0) {
|
||||
|
||||
var localTarget = {
|
||||
path: resourceMappings[resourceMold].path,
|
||||
type: resourceMappings[resourceMold].type
|
||||
};
|
||||
|
||||
// Fill in the appropriate version number.
|
||||
localTarget.path = localTarget.path.replace('{version}', versionNumber);
|
||||
|
||||
return localTarget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
61
manifest.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Decentraleyes",
|
||||
"version": "2.0.0beta1",
|
||||
|
||||
"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"],"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
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<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="Add comments to locally fetched files" type="bool">Automatically prepend a notice to retrieved documents to signal local delivery.</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing" pref-name="blockMissing" title="Block requests for missing resources" type="bool">Cancel intercepted request if the required resource is not locally available.</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist" pref-name="domainWhitelist" title="Exclude domains from inspections" type="string">Enter domains to whitelist them. Separate multiple entries with semi-colons (;).</setting>
|
||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected" pref-name="amountInjected" title="Counter for locally injected resources" type="integer">Amount of local Content Delivery Network resource injections since installation.</setting>
|
||||
</vbox>
|
||||
15
package.json
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"description": "Local emulation of Content Delivery Networks.",
|
||||
"author": "Thomas Rientjes",
|
||||
"license": "MPL-2.0",
|
||||
"title": "Decentraleyes",
|
||||
"version": "1.2.0",
|
||||
"main": "lib/main.js",
|
||||
"homepage": "https://addons.mozilla.org/en-US/firefox/addon/decentraleyes",
|
||||
"name": "decentraleyes",
|
||||
"id": "jid1-BoFifL9Vbdl2zQ@jetpack",
|
||||
"engines": {
|
||||
"firefox": ">=38.0a1",
|
||||
"fennec": ">=38.0a1"
|
||||
}
|
||||
}
|
||||
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>
|
||||
17
pages/options/options.css
Normal file
@@ -0,0 +1,17 @@
|
||||
section {
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
section .title {
|
||||
-webkit-margin-start: -32px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
section .description {
|
||||
font-style: italic;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.button-panel {
|
||||
text-align: right;
|
||||
}
|
||||
41
pages/options/options.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!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">
|
||||
<input data-option="blockMissing" type="checkbox">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
</label>
|
||||
|
||||
<div class="description" data-i18n-content="blockMissingDescription"></div>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="title" data-i18n-content="domainWhitelistTitle"></div>
|
||||
<input data-option="domainWhitelist" type="text">
|
||||
<div class="description" data-i18n-content="domainWhitelistDescription"></div>
|
||||
|
||||
</section>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
91
pages/options/options.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* 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, saveButtonElement, blockMissingElement, domainWhitelistElement;
|
||||
|
||||
i18nElements = document.querySelectorAll('[data-i18n-content]');
|
||||
saveButtonElement = document.getElementById('save-button');
|
||||
|
||||
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;
|
||||
}
|
||||
BIN
pages/popup/icon.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
18
pages/popup/icon.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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="81.382mm" width="81.382mm" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 288.36257 288.36256">
|
||||
<g transform="translate(-252.96 -305.32)">
|
||||
<g>
|
||||
<circle cx="397.14" cy="449.51" r="144.18" fill="#69ab90"/>
|
||||
<circle cx="397.33" cy="449.69" r="96.804" fill="#4a856d"/>
|
||||
<circle cx="397.14" cy="449.51" r="85.491" fill="#d9ccb5"/>
|
||||
<path d="m397.84 317.05c-35.857-0.21436-69.613 13.549-95.287 39.223-21.726 21.726-34.785 48.725-38.356 79.299-1.5095 12.924-1.1505 18.559 1.4496 22.765 2.5923 4.1928 7.7157 7.094 12.529 7.094 2.224 0 4.3673-0.59088 6.8602-1.8932 2.6102-1.3636 4.1843-2.796 5.6179-5.1148 1.79-2.8953 2.048-4.0575 2.5639-11.494 1.0787-15.547 3.6425-26.467 9.0225-38.438 5.5317-12.308 11.942-21.608 21.432-31.099 15.367-15.367 34.084-25.098 55.841-29.031 7.7155-1.3947 24.814-1.5398 33.687-0.28464 7.756 1.0971 10.134 0.7672 14.301-1.9925 5.8022-3.8431 8.1425-11.751 5.3024-17.917-3.0315-6.5811-7.1319-8.7184-19.484-10.163-5.1906-0.60718-10.356-0.9226-15.479-0.95322zm109.93 74.51c-8.1977-0.0376-14.914 6.5284-14.914 14.576 0 11.147 10.954 18.298 20.867 13.623 4.0006-1.8866 5.9627-3.8591 7.5023-7.5442 4.0457-9.6829-3.0709-20.608-13.456-20.655zm-14.971 113.33c-4.0751 0.0647-7.3332 2.0205-11.055 6.3482-9.1984 10.697-11.412 13.066-15.958 17.079-13.705 12.096-31.307 20.6-50.351 24.325-9.3447 1.8276-28.844 1.6379-38.299-0.3729-19.891-4.2303-35.81-12.389-51.031-26.152-7.8199-7.071-10.345-8.4952-15.06-8.4952-8.2275 0-14.524 6.3846-14.559 14.764-0.026 6.3329 1.7615 9.0449 11.94 18.107 19.95 17.762 46.738 29.723 73.456 32.798 7.3929 0.8508 22.091 0.86962 29.682 0.0398 24.156-2.6409 47.493-11.922 66.845-26.582 6.4568-4.8917 19.763-18.022 24.347-24.025 5.5848-7.3136 6.7915-11.417 5.1346-17.474-1.1034-4.0332-6.2363-8.7401-10.697-9.8103-1.5875-0.38083-3.0371-0.57098-4.3954-0.54943z" fill-rule="evenodd" fill="#e1eee9"/>
|
||||
</g>
|
||||
<g fill="#fff">
|
||||
<path d="m513.64 468.9c-2.2815-0.10063-3.476 1.6445-4.709 6.2656-0.72585 2.3218-0.8127 3.4136-1.5879 5.7129l-1.1328 3.4004-2.2207-0.7832-2.2207-0.78125 0.48242 3.1484c1.2524 8.1662 2.7305 16.622 2.8926 16.553 1.7355-1.3997 8.0109-6.6523 15.238-12.561 0 0-1.199-0.43109-2.5371-0.91406l-2.3144-0.90039 1.2168-3.7168c0.66905-2.0444 1.5029-5.601 1.8535-7.9043 0.10026-0.65807 0.14896-1.1589 0.19727-1.6621 0.13779-3.332-0.88319-4.7139-3.3906-5.5059-0.6561-0.20727-1.2411-0.32834-1.7676-0.35157z"/>
|
||||
<path d="m468.09 356.16c-1.5821 1.6469-3.6508 1.2077-7.7315-1.2869-2.1272-1.1799-2.9434-1.9104-5.0908-3.04l-3.166-1.68-1.0672 2.099-1.0686 2.0976-1.8229-2.612c-4.7273-6.7756-9.491-13.916-9.326-13.978 2.222-0.18409 10.389-0.7113 19.697-1.4206 0 0-0.57051 1.1392-1.206 2.4121l-1.0542 2.2486 3.4451 1.8511c1.8947 1.0183 4.9521 3.0176 6.795 4.4431 0.52659 0.4072 0.90738 0.73615 1.2895 1.0671 2.3985 2.3169 2.6128 4.0217 1.3441 6.3249-0.33194 0.60269-0.67188 1.0939-1.037 1.474z"/>
|
||||
<path d="m-432.68-16.955c-0.92625 0.11186-1.7636 0.61843-2.5957 1.4668-2.5338 2.583-1.7893 5.0501 3.1855 10.545 2.4906 2.751 6.0466 6.7358 7.9004 8.8555 3.7538 4.2926 5.5909 4.8261 8.1582 2.3672 2.8579-2.737 2.1581-5.0574-3.6914-12.246-6.6046-8.1165-10.178-11.324-12.957-10.988z" transform="translate(912.46 377.29)"/>
|
||||
<path d="m511.69 452.45c-0.1731-2.8106-0.55381-8.1371-0.84577-11.837-0.58317-7.3893 0.33368-9.7981 3.9172-10.296 4.7082-0.65411 6.1374 3.0921 6.5005 17.04 0.24112 9.2648-0.62148 11.529-4.5568 11.95-3.5346 0.37895-4.6643-1.1658-5.0151-6.8574z"/>
|
||||
</g>
|
||||
<path fill="#2a4c3d" d="m459.45 442.28c-2.1109-0.0187-4.3622 1.2952-7.7031 4.248-10.175 8.9932-21.922 15.327-34.545 18.627-8.938 2.3365-24.56 2.9354-33.938 1.3027-14.797-2.576-26.79-8.3704-39.924-19.289-4.784-3.9773-6.1342-4.7617-8.1875-4.7617-3.5186 0-6.0234 2.6331-6.0234 6.332 0 2.525 0.38568 3.1373 4.3926 6.9707 2.416 2.3114 6.445 5.638 8.9551 7.3945 2.51 1.7566 4.8076 3.4001 5.1055 3.6523 0.2983 0.25226 0.17832 1.9504-0.26758 3.7715-1.4733 6.0171-4.278 10.442-7.6934 12.551-1.1265 0.76846-2.2641 1.2685-3.3203 1.3828-6.5363 0.70717-9.3955 4.3121-7.293 9.1953 1.6698 3.8781 6.6162 4.7935 12.031 2.9883 0.24651-0.0848 0.49286-0.16918 0.73829-0.26368 0.23829-0.0897 0.47741-0.18505 0.71679-0.28515 0.49332-0.20988 0.98411-0.43326 1.4707-0.68164 0.0508-0.0257 0.10153-0.0481 0.15234-0.0742 1.8138-0.94212 3.5716-2.1505 5.2266-3.5957 0.14038-0.12553 0.28085-0.25756 0.42188-0.39063 0.20456-0.18578 0.40438-0.38109 0.60547-0.57422 1.7137-1.7335 3.4328-3.9476 4.8926-6.2402 0.20605-0.3236 0.39292-0.64933 0.58789-0.97461 0.10747-0.18366 0.22362-0.36247 0.32813-0.54688 1.5252-2.6914 2.7177-5.4344 3.1113-7.4023 0.2326-1.1632 0.67161-2.1152 0.97461-2.1152 0.3031-0.00001 2.6227 0.7471 5.1543 1.6602 6.1439 2.2158 14.829 4.2505 20.553 4.8144l4.668 0.45899v11.014c0 10.802 0.033 11.054 1.7129 13.051 0.9421 1.1196 2.3872 2.1375 3.2109 2.2617 2.6996 0.407 4.527-0.26757 6.2363-2.2988 1.6414-1.9513 1.6836-2.265 1.6836-13.004v-11.004l4.8105-0.44727c6.0027-0.55789 16.571-3.1406 22.189-5.4238 2.3449-0.9528 4.4893-1.5925 4.7656-1.4219 0.2761 0.17065 0.68736 1.457 0.91406 2.8594 0.7511 4.6454 4.9402 12.24 8.8633 16.07 7.2261 7.0551 16.814 8.4874 19.682 2.9414 2.429-4.6972-0.15457-8.474-6.5898-9.6348-2.868-0.51734-6.1671-3.8642-8.0273-8.1445-1.5696-3.6119-2.9464-10.521-2.2266-11.172 0.3135-0.28323 2.5308-1.9235 4.9277-3.6445 6.261-4.4955 12.034-10.285 12.537-12.574 0.49754-2.2654-1.0289-5.7049-3-6.7598-0.99058-0.53012-1.9214-0.81378-2.8809-0.82227z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
BIN
pages/popup/icon32.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
pages/popup/icon36.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
242
pages/popup/popup.css
Normal file
@@ -0,0 +1,242 @@
|
||||
body {
|
||||
background-color: #f0f0f0;
|
||||
color: #555;
|
||||
cursor: default;
|
||||
font-family: Noto Sans, Arial, sans-serif !important;
|
||||
font-size: 75%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
user-select: none;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 36px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
margin-bottom: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
margin: 0;
|
||||
padding: 10px 8px;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: none !important;
|
||||
border: 1px solid #e4e4e4;
|
||||
color: #737373;
|
||||
font-weight: 600;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.sub-list {
|
||||
align-items: center;
|
||||
background-color: #ececec;
|
||||
border-bottom: none !important;
|
||||
border: 1px solid #e0e0e0;
|
||||
box-shadow: inset 0px 2px 10px #e2e2e2;
|
||||
list-style: none;
|
||||
padding-left: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sub-list:last-child {
|
||||
border-bottom: 1px solid #e0e0e0 !important;
|
||||
}
|
||||
|
||||
.sub-list-item {
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
color: #737373;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.sub-list-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.side-note {
|
||||
color: #a5a5a5;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background-color: #6bb798;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
margin-right: 8px;
|
||||
padding: 3px 15px;
|
||||
}
|
||||
|
||||
.button-panel {
|
||||
padding: 6px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.text-link {
|
||||
color: #bdbdbd;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
padding-left: 4px;
|
||||
padding-top: 2px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.text-link:hover {
|
||||
color: #777;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#injection-counter {
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
#extension-options-overlay-header {
|
||||
align-items: center;
|
||||
border-bottom: solid lightgray 1px;
|
||||
display: flex;
|
||||
padding: 4px 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#extension-options-overlay-icon {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#extension-options-overlay-icon {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
}
|
||||
|
||||
#extension-options-overlay-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
:enabled:hover:-webkit-any(
|
||||
select,
|
||||
input[type='checkbox'],
|
||||
input[type='radio'],
|
||||
:-webkit-any(
|
||||
button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance)) {
|
||||
background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
|
||||
border-color: rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
|
||||
inset 0 1px 2px rgba(255, 255, 255, 0.95);
|
||||
color: black;
|
||||
}
|
||||
|
||||
:enabled:active:-webkit-any(
|
||||
select,
|
||||
input[type='checkbox'],
|
||||
input[type='radio'],
|
||||
:-webkit-any(
|
||||
button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance)) {
|
||||
background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
:enabled:focus:-webkit-any(
|
||||
select,
|
||||
input[type='checkbox'],
|
||||
input[type='number'],
|
||||
input[type='password'],
|
||||
input[type='radio'],
|
||||
input[type='search'],
|
||||
input[type='text'],
|
||||
input[type='url'],
|
||||
input:not([type]),
|
||||
:-webkit-any(
|
||||
button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance)) {
|
||||
/* OVERRIDE */
|
||||
-webkit-transition: border-color 200ms;
|
||||
/* We use border color because it follows the border radius (unlike outline).
|
||||
* This is particularly noticeable on mac. */
|
||||
border-color: rgb(77, 144, 254);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:-webkit-any(button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance),
|
||||
select,
|
||||
input[type='checkbox'],
|
||||
input[type='radio'] {
|
||||
-webkit-appearance: none;
|
||||
-webkit-user-select: none;
|
||||
background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
|
||||
inset 0 1px 2px rgba(255, 255, 255, 0.75);
|
||||
color: #444;
|
||||
font: inherit;
|
||||
margin: 0 1px 0 0;
|
||||
outline: none;
|
||||
text-shadow: 0 1px 0 rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
:-webkit-any(button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance),
|
||||
select {
|
||||
min-height: 2em;
|
||||
min-width: 4em;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
|
||||
}
|
||||
|
||||
:-webkit-any(button,
|
||||
input[type='button'],
|
||||
input[type='submit']):not(.custom-appearance) {
|
||||
-webkit-padding-end: 10px;
|
||||
-webkit-padding-start: 10px;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
color: #5f5f5f;
|
||||
}
|
||||
|
||||
.label-beta {
|
||||
color: #6aac91;
|
||||
font-size: 9px;
|
||||
}
|
||||
49
pages/popup/popup.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!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>
|
||||
|
||||
<div id="extension-options-overlay-header">
|
||||
<img id="extension-options-overlay-icon" src="icon.png" alt="Extension Icon">
|
||||
<div id="extension-options-overlay-title">Decentraleyes <sup class="label-beta">BETA</sup></div>
|
||||
<div style="float: right;"></div>
|
||||
</div>
|
||||
|
||||
<section id="popup-content" class="popup-content">
|
||||
|
||||
<h1 id="injection-counter">0</h1>
|
||||
|
||||
<div class="title" data-i18n-content="amountInjectedTitle"></div>
|
||||
<div class="description" data-i18n-content="amountInjectedDescription"></div>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="button-panel">
|
||||
|
||||
<span id="testing-utility-link" class="text-link">decentraleyes.org/test</span>
|
||||
|
||||
<button id="options-button" class="btn-sm" title="Options">
|
||||
<i class="btn-icon fas fa-cog" data-fa-transform="grow-2"></i>
|
||||
</button>
|
||||
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
259
pages/popup/popup.js
Normal file
@@ -0,0 +1,259 @@
|
||||
/**
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
let i18nElements, saveButtonElement, 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);
|
||||
});
|
||||
|
||||
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.getPlatformInfo(function (information) {
|
||||
|
||||
if (information.os === 'android') {
|
||||
|
||||
browser.tabs.getCurrent().then(function (tab) {
|
||||
|
||||
browser.tabs.update(tab.id, {
|
||||
'active': true
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
browser.runtime.getBackgroundPage().then(function (backgroundPage) {
|
||||
|
||||
if (backgroundPage == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let injections, injectionOverview;
|
||||
|
||||
injections = backgroundPage.stateManager.tabs[tabs[0].id].injections;
|
||||
injectionOverview = {};
|
||||
|
||||
for (let injection in injections) {
|
||||
|
||||
let injectionSource, libraryName;
|
||||
|
||||
injection = injections[injection];
|
||||
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', 'sub-list');
|
||||
|
||||
listElement.appendChild(subListElement);
|
||||
|
||||
cdn.forEach(function (injection) {
|
||||
|
||||
let subListItemElement, resourcePathDetails, resourceFilename, resourceName,
|
||||
resourceNameTextNode, sideNoteElement, sideNoteTextNode;
|
||||
|
||||
subListItemElement = document.createElement('li');
|
||||
subListItemElement.setAttribute('class', 'sub-list-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 popupContentElement = document.getElementById('popup-content');
|
||||
let injectionCounterElement = document.getElementById('injection-counter');
|
||||
|
||||
popupContentElement.insertBefore(listElement, injectionCounterElement);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('options-button').addEventListener('mouseup', function () {
|
||||
|
||||
browser.runtime.getPlatformInfo(function (information) {
|
||||
|
||||
if (information.os === '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();
|
||||
}
|
||||
});
|
||||
});
|
||||