Implement support for Firefox 57 and higher
6
.gitignore
vendored
@@ -1,4 +1,2 @@
|
|||||||
data/_audit/node_modules
|
audit/node_modules
|
||||||
data/_audit/report.txt
|
audit/report.txt
|
||||||
*.xpi
|
|
||||||
.idea
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
data/_audit/node_modules
|
|
||||||
data/_audit/report.txt
|
|
||||||
.jpmignore
|
|
||||||
.gitignore
|
|
||||||
.idea
|
|
||||||
*.xpi
|
|
||||||
test
|
|
||||||
.git
|
|
||||||
39
README.md
@@ -1,49 +1,30 @@
|
|||||||
Decentraleyes
|
Decentraleyes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
A [web browser extension](https://decentraleyes.org) 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. Feel free to use this [testing utility](https://decentraleyes.org/test) to see if it's properly installed, enabled, and correctly configured.
|
A [web browser extension](https://decentraleyes.org) that emulates Content Delivery Networks to improve your online privacy. It intercepts traffic, finds supported resources locally, and injects them into the environment. All of this happens automatically, so no prior configuration is required. Feel free to use the following [testing utility](https://decentraleyes.org/test) to find out if you are properly protected.
|
||||||
|
|
||||||
> **Note:** Decentraleyes is no silver bullet, but it does prevent a lot of websites from making you send these kinds of requests. Ultimately, you can make Decentraleyes block requests for any missing CDN resources, too.
|
> **Note:** Decentraleyes is no silver bullet, but it does prevent a lot of websites from making you send these kinds of requests. Ultimately, you can make Decentraleyes block requests for any missing CDN resources, too.
|
||||||
|
|
||||||
## Roadmap
|
## Contributing Code
|
||||||
|
|
||||||
Now that there's a solid, Mozilla approved, foundation, it's time to move forward. Mobility, extensibility (through support for community-powered resource packages), and usability, will be the main points of attention during this phase.
|
Suggestions in the form of **Issues**, and contributions in the form of **Pull Requests**, are highly welcome. You can also use the public contact details and PGP key on the extension's [contact page](https://decentraleyes.org/contact) to get in touch.
|
||||||
|
|
||||||
#### Essential Next Steps
|
#### Prerequisites
|
||||||
|
|
||||||
* Start work on a resource bundle standard, to allow users to create and import custom resources. With support for these bundles in place, Decentraleyes will still work out of the box, but can be extended if needed.
|
* Mozilla Firefox 56 *(or higher)*.
|
||||||
* 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
|
> **Note:** If you want to contribute to the Firefox legacy extension, please check out the ```legacy``` branch. If you are looking for the Chromium-compatible codebase, please see the ```experimental``` branch.
|
||||||
|
|
||||||
* Advanced policy management for users who block requests for missing resources.
|
#### Running the Code
|
||||||
* 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.
|
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
|
## Submitting Translations
|
||||||
|
|
||||||
Do you master a non-supported language? Please help out by translating this add-on on [Crowdin](https://crowdin.com/project/decentraleyes).
|
Do you master a non-supported language? Please help out by translating this add-on on [Crowdin](https://crowdin.com/project/decentraleyes).
|
||||||
|
|
||||||
## Contributing Code
|
|
||||||
|
|
||||||
Suggestions in the form of **Issues** and contributions in the form of **Pull Requests** are highly welcome. You can also use the contact details and PGP key on the add-on [download page](https://addons.mozilla.org/firefox/addon/decentraleyes) to get in touch.
|
|
||||||
|
|
||||||
#### Prerequisites
|
|
||||||
|
|
||||||
* Jetpack Manager [jpm](https://developer.mozilla.org/Add-ons/SDK/Tools/jpm#Installation) (a Node-based replacement for cfx).
|
|
||||||
* Firefox version 38 or later. *If you need to work with earlier versions of Firefox, you'll need to use the old cfx tool. See instructions for [getting started with cfx](https://developer.mozilla.org/Add-ons/SDK/Tutorials/Getting_started).
|
|
||||||
|
|
||||||
#### Build Instructions (Unix)
|
|
||||||
|
|
||||||
git clone https://github.com/Synzvato/decentraleyes
|
|
||||||
cd decentraleyes
|
|
||||||
jpm xpi
|
|
||||||
|
|
||||||
> **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.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MPL-2.0](https://www.mozilla.org/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.4.0",
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"source-map-url": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
|
||||||
|
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "decentraleyes-audit",
|
"name": "decentraleyes-audit",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"author": "Thomas Rientjes",
|
"author": "Thomas Rientjes",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"description": "Library audit tool for Decentraleyes.",
|
"description": "Library audit tool for Decentraleyes.",
|
||||||
@@ -31,6 +31,7 @@ sourceMappingURL = require('source-map-url');
|
|||||||
var localResourceLocation = '../resources';
|
var localResourceLocation = '../resources';
|
||||||
var localResourceLocationLength = localResourceLocation.length;
|
var localResourceLocationLength = localResourceLocation.length;
|
||||||
var localResourcePaths = [];
|
var localResourcePaths = [];
|
||||||
|
var comparedResourceAmount = 0;
|
||||||
var resourceAmount = 0;
|
var resourceAmount = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,10 +42,6 @@ function _fetchLocalResourcePaths(folderPath) {
|
|||||||
|
|
||||||
fileSystem.readdirSync(folderPath).forEach(function (resourceName) {
|
fileSystem.readdirSync(folderPath).forEach(function (resourceName) {
|
||||||
|
|
||||||
if (resourceName === '_audit') {
|
|
||||||
return localResourcePaths;
|
|
||||||
}
|
|
||||||
|
|
||||||
var resourcePath = folderPath + '/' + resourceName;
|
var resourcePath = folderPath + '/' + resourceName;
|
||||||
var resourceStatistics = fileSystem.statSync(resourcePath);
|
var resourceStatistics = fileSystem.statSync(resourcePath);
|
||||||
|
|
||||||
@@ -75,7 +72,7 @@ function _getLocalResourceContents(fileLocation, callback) {
|
|||||||
|
|
||||||
var localFileContents = buffer.toString('utf8', 0, buffer.length);
|
var localFileContents = buffer.toString('utf8', 0, buffer.length);
|
||||||
|
|
||||||
fileSystem.close(fileDescriptor);
|
fileSystem.close(fileDescriptor, function () {});
|
||||||
callback(localFileContents);
|
callback(localFileContents);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -156,9 +153,6 @@ function _compareResources(localResourceContents, remoteResourceContents, URL) {
|
|||||||
sourceMappingNotice = '[X] REMOTE RESOURCE HAD SOURCE MAPPING URL';
|
sourceMappingNotice = '[X] REMOTE RESOURCE HAD SOURCE MAPPING URL';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the syntax invalidation character from the local contents.
|
|
||||||
localResourceContents = localResourceContents.substring(1);
|
|
||||||
|
|
||||||
var localResourceHash = _hashFileContents(localResourceContents);
|
var localResourceHash = _hashFileContents(localResourceContents);
|
||||||
var remoteResourceHash = _hashFileContents(remoteResourceContents);
|
var remoteResourceHash = _hashFileContents(remoteResourceContents);
|
||||||
|
|
||||||
@@ -176,6 +170,8 @@ function _compareResources(localResourceContents, remoteResourceContents, URL) {
|
|||||||
console.log();
|
console.log();
|
||||||
console.log('[X] LOCAL AND REMOTE RESOURCE HASHES MATCH');
|
console.log('[X] LOCAL AND REMOTE RESOURCE HASHES MATCH');
|
||||||
console.log(sourceMappingNotice);
|
console.log(sourceMappingNotice);
|
||||||
|
|
||||||
|
_incrementComparedResourceAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _showCompletedMessage() {
|
function _showCompletedMessage() {
|
||||||
@@ -186,6 +182,18 @@ function _showCompletedMessage() {
|
|||||||
console.log();
|
console.log();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _incrementComparedResourceAmount() {
|
||||||
|
|
||||||
|
comparedResourceAmount++;
|
||||||
|
|
||||||
|
if (comparedResourceAmount === resourceAmount) {
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
_showCompletedMessage();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializations
|
* Initializations
|
||||||
*/
|
*/
|
||||||
@@ -215,13 +223,6 @@ localResourcePaths.forEach(function (resourcePath, index) {
|
|||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
console.log('------------------------------------------');
|
console.log('------------------------------------------');
|
||||||
|
|
||||||
if (index === resourceAmount - 1) {
|
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
_showCompletedMessage();
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
locale decentraleyes bg locale/bg/
|
|
||||||
locale decentraleyes da locale/da/
|
|
||||||
locale decentraleyes de locale/de/
|
|
||||||
locale decentraleyes en-GB locale/en-GB/
|
|
||||||
locale decentraleyes en-US locale/en-US/
|
|
||||||
locale decentraleyes eo locale/eo/
|
|
||||||
locale decentraleyes es locale/es/
|
|
||||||
locale decentraleyes fi locale/fi/
|
|
||||||
locale decentraleyes fr locale/fr/
|
|
||||||
locale decentraleyes id locale/id/
|
|
||||||
locale decentraleyes it locale/it/
|
|
||||||
locale decentraleyes ja locale/ja/
|
|
||||||
locale decentraleyes nl locale/nl/
|
|
||||||
locale decentraleyes pl locale/pl/
|
|
||||||
locale decentraleyes pt-PT locale/pt-PT/
|
|
||||||
locale decentraleyes ru locale/ru/
|
|
||||||
locale decentraleyes sv-SE locale/sv-SE/
|
|
||||||
locale decentraleyes zh-CN locale/zh-CN/
|
|
||||||
locale decentraleyes zh-TW locale/zh-TW/
|
|
||||||
@@ -260,9 +260,3 @@ var files = {
|
|||||||
'resources/webfont/1.5.10/webfont.js.dec': true,
|
'resources/webfont/1.5.10/webfont.js.dec': true,
|
||||||
'resources/webfont/1.5.18/webfont.js.dec': true
|
'resources/webfont/1.5.18/webfont.js.dec': true
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Exports
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = files;
|
|
||||||
119
core/interceptor.js
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/**
|
||||||
|
* Interceptor
|
||||||
|
* Belongs to Decentraleyes.
|
||||||
|
*
|
||||||
|
* @author Thomas Rientjes
|
||||||
|
* @since 2016-04-06
|
||||||
|
* @license MPL 2.0
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interceptor
|
||||||
|
*/
|
||||||
|
|
||||||
|
var interceptor = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constants
|
||||||
|
*/
|
||||||
|
|
||||||
|
const HTTP_EXPRESSION = /^http?:\/\//;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public Methods
|
||||||
|
*/
|
||||||
|
|
||||||
|
interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
|
||||||
|
|
||||||
|
let validCandidate, targetDetails, targetPath;
|
||||||
|
|
||||||
|
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
|
||||||
|
|
||||||
|
if (!validCandidate) {
|
||||||
|
|
||||||
|
return {
|
||||||
|
'cancel': false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
targetDetails = requestAnalyzer.getLocalTarget(requestDetails);
|
||||||
|
targetPath = targetDetails.path;
|
||||||
|
|
||||||
|
if (!targetPath) {
|
||||||
|
return interceptor._handleMissingCandidate(requestDetails.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!files[targetPath]) {
|
||||||
|
return interceptor._handleMissingCandidate(requestDetails.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
stateManager.requests[requestDetails.requestId] = {
|
||||||
|
'tabIdentifier': tabIdentifier,
|
||||||
|
'targetDetails': targetDetails
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
'redirectUrl': chrome.extension.getURL(targetPath)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private Methods
|
||||||
|
*/
|
||||||
|
|
||||||
|
interceptor._handleMissingCandidate = function (requestUrl) {
|
||||||
|
|
||||||
|
if (interceptor.blockMissing === true) {
|
||||||
|
|
||||||
|
return {
|
||||||
|
'cancel': true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestUrl.match(HTTP_EXPRESSION)) {
|
||||||
|
|
||||||
|
requestUrl = requestUrl.replace(HTTP_EXPRESSION, 'https://');
|
||||||
|
|
||||||
|
return {
|
||||||
|
'redirectUrl': requestUrl
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
return {
|
||||||
|
'cancel': false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
interceptor._handleStorageChanged = function (changes) {
|
||||||
|
|
||||||
|
if ('blockMissing' in changes) {
|
||||||
|
interceptor.blockMissing = changes.blockMissing.newValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializations
|
||||||
|
*/
|
||||||
|
|
||||||
|
interceptor.amountInjected = 0;
|
||||||
|
interceptor.blockMissing = false;
|
||||||
|
|
||||||
|
chrome.storage.local.get(['amountInjected', 'blockMissing'], function (items) {
|
||||||
|
|
||||||
|
interceptor.amountInjected = items.amountInjected || 0;
|
||||||
|
interceptor.blockMissing = items.blockMissing || false;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event Handlers
|
||||||
|
*/
|
||||||
|
|
||||||
|
chrome.storage.onChanged.addListener(interceptor._handleStorageChanged);
|
||||||
36
core/main.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/**
|
||||||
|
* 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.browserAction.setBadgeBackgroundColor({
|
||||||
|
'color': [74, 130, 108, 255]
|
||||||
|
});
|
||||||
@@ -13,12 +13,6 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
var resources = require('./resources');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mappings
|
* Mappings
|
||||||
*/
|
*/
|
||||||
@@ -50,62 +44,6 @@ var mappings = {
|
|||||||
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
|
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
|
||||||
type: 'application/javascript'
|
type: 'application/javascript'
|
||||||
},
|
},
|
||||||
'jquery/1.2/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.2.6/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.2/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.2.6/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.3/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.3.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.3/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.3.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.4/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.4.4/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.4/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.4.4/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.5/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.5.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.5/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.5.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.6/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.6.4/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.6/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.6.4/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.7/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.7.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.7/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.7.2/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.8/jquery.min.js': {
|
|
||||||
path: 'resources/jquery/1.8.3/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jquery/1.8/jquery.js': {
|
|
||||||
path: 'resources/jquery/1.8.3/jquery.min.js.dec',
|
|
||||||
type: 'application/javascript'
|
|
||||||
},
|
|
||||||
'jqueryui/1/jquery-ui.js': {
|
'jqueryui/1/jquery-ui.js': {
|
||||||
path: 'resources/jqueryui/1.10.4/jquery-ui.min.js.dec',
|
path: 'resources/jqueryui/1.10.4/jquery-ui.min.js.dec',
|
||||||
type: 'application/javascript'
|
type: 'application/javascript'
|
||||||
@@ -139,7 +77,6 @@ var mappings = {
|
|||||||
// Microsoft Ajax CDN
|
// Microsoft Ajax CDN
|
||||||
'ajax.aspnetcdn.com': {
|
'ajax.aspnetcdn.com': {
|
||||||
'/ajax/': {
|
'/ajax/': {
|
||||||
'jQuery/jquery-{version}.': resources.jQuery,
|
|
||||||
'jquery/jquery-{version}.': resources.jQuery,
|
'jquery/jquery-{version}.': resources.jQuery,
|
||||||
'modernizr/modernizr-{version}.': resources.modernizr
|
'modernizr/modernizr-{version}.': resources.modernizr
|
||||||
}
|
}
|
||||||
@@ -147,7 +84,6 @@ var mappings = {
|
|||||||
// Microsoft Ajax CDN [Deprecated]
|
// Microsoft Ajax CDN [Deprecated]
|
||||||
'ajax.microsoft.com': {
|
'ajax.microsoft.com': {
|
||||||
'/ajax/': {
|
'/ajax/': {
|
||||||
'jQuery/jquery-{version}.': resources.jQuery,
|
|
||||||
'jquery/jquery-{version}.': resources.jQuery,
|
'jquery/jquery-{version}.': resources.jQuery,
|
||||||
'modernizr/modernizr-{version}.': resources.modernizr
|
'modernizr/modernizr-{version}.': resources.modernizr
|
||||||
}
|
}
|
||||||
@@ -341,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'
|
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,5 +0,0 @@
|
|||||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.addNotice', true);
|
|
||||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing', false);
|
|
||||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist', '');
|
|
||||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected', 0);
|
|
||||||
pref('extensions.jid1-BoFifL9Vbdl2zQ@jetpack.showReleaseNotes', true);
|
|
||||||
BIN
icon64.png
|
Before Width: | Height: | Size: 3.7 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,101 +0,0 @@
|
|||||||
/**
|
|
||||||
* Data Handler
|
|
||||||
* Belongs to Decentraleyes.
|
|
||||||
*
|
|
||||||
* @author Thomas Rientjes
|
|
||||||
* @since 2014-05-30
|
|
||||||
* @license MPL 2.0
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
var { Cc, Ci } = require('chrome');
|
|
||||||
var self = require('sdk/self');
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedFunction
|
|
||||||
var ioService = Cc['@mozilla.org/network/io-service;1']
|
|
||||||
.getService(Ci.nsIIOService);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Absolute resource file paths.
|
|
||||||
* @var {object} files
|
|
||||||
*/
|
|
||||||
var files = require('./files');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constants
|
|
||||||
*/
|
|
||||||
|
|
||||||
const DELIVERY_NOTICE = '/**\n * Local delivery by Decentraleyes (' + self.version + ').\n */\n\n';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variables
|
|
||||||
*/
|
|
||||||
|
|
||||||
var resourceData = self.data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Public Methods
|
|
||||||
*/
|
|
||||||
|
|
||||||
function getRedirectionURI(targetPath, characterSet, type) {
|
|
||||||
|
|
||||||
var data, dataURI, redirectionURI;
|
|
||||||
|
|
||||||
data = _loadResource(targetPath);
|
|
||||||
dataURI = _buildDataURI(type, characterSet, data);
|
|
||||||
redirectionURI = ioService.newURI(dataURI, null, null);
|
|
||||||
|
|
||||||
return redirectionURI;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exports
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.getRedirectionURI = getRedirectionURI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Private Methods
|
|
||||||
*/
|
|
||||||
|
|
||||||
function _loadResource(targetPath) {
|
|
||||||
|
|
||||||
var resource;
|
|
||||||
|
|
||||||
// Find the result inside a static path index.
|
|
||||||
if (!files[targetPath]) {
|
|
||||||
throw new Error('The requested resource is missing.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempt to load resource contents.
|
|
||||||
return resource = resourceData.load(targetPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
function _buildDataURI(type, characterSet, data) {
|
|
||||||
|
|
||||||
var addNotice, dataURI;
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedVariable
|
|
||||||
addNotice = require('sdk/simple-prefs').prefs.addNotice;
|
|
||||||
dataURI = 'data:' + type + ';charset=' + characterSet + ',';
|
|
||||||
|
|
||||||
// Remove the syntax invalidation character.
|
|
||||||
data = data.substring(1);
|
|
||||||
|
|
||||||
if (!addNotice) {
|
|
||||||
dataURI = dataURI + encodeURIComponent(data);
|
|
||||||
} else {
|
|
||||||
dataURI = dataURI + encodeURIComponent(DELIVERY_NOTICE + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dataURI;
|
|
||||||
}
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
/**
|
|
||||||
* Interceptor
|
|
||||||
* Belongs to Decentraleyes.
|
|
||||||
*
|
|
||||||
* @author Thomas Rientjes
|
|
||||||
* @since 2014-05-30
|
|
||||||
* @license MPL 2.0
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
var { Class } = require('sdk/core/heritage');
|
|
||||||
var { Unknown } = require('sdk/platform/xpcom');
|
|
||||||
var { Cc, Ci, Cr } = require('chrome');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets and sets add-on specific preferences.
|
|
||||||
* @var {object} simplePreferences
|
|
||||||
*/
|
|
||||||
var simplePreferences = require('sdk/simple-prefs');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retains data across application restarts.
|
|
||||||
* @var {object} simpleStorage
|
|
||||||
*/
|
|
||||||
var simpleStorage = require('sdk/simple-storage');
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedFunction
|
|
||||||
var observerService = Cc['@mozilla.org/observer-service;1']
|
|
||||||
.getService(Ci.nsIObserverService);
|
|
||||||
|
|
||||||
var requestAnalyzer = require('./request-analyzer');
|
|
||||||
var dataHandler = require('./data-handler');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variables
|
|
||||||
*/
|
|
||||||
|
|
||||||
var preferences = simplePreferences.prefs;
|
|
||||||
var storage = simpleStorage.storage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interceptor Class
|
|
||||||
*/
|
|
||||||
|
|
||||||
var Interceptor = new Class({
|
|
||||||
|
|
||||||
extends: Unknown,
|
|
||||||
interfaces: ['nsIObserver'],
|
|
||||||
topic: 'http-on-modify-request',
|
|
||||||
|
|
||||||
register: function () {
|
|
||||||
observerService.addObserver(this, this.topic, false);
|
|
||||||
},
|
|
||||||
|
|
||||||
unregister: function () {
|
|
||||||
observerService.removeObserver(this, this.topic);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called whenever an HTTP request is made.
|
|
||||||
* @param httpChannel
|
|
||||||
*/
|
|
||||||
observe: function (httpChannel) {
|
|
||||||
|
|
||||||
var validCandidate, target, characterSet, redirectionURI;
|
|
||||||
|
|
||||||
// Enable runtime discovery.
|
|
||||||
httpChannel.QueryInterface(Ci.nsIHttpChannel);
|
|
||||||
|
|
||||||
// Determine the validity of the candidate.
|
|
||||||
validCandidate = requestAnalyzer.isValidCandidate(httpChannel);
|
|
||||||
|
|
||||||
if (!validCandidate) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove referer header from request.
|
|
||||||
httpChannel.setRequestHeader('Referer', null, false);
|
|
||||||
|
|
||||||
// Convert the original request URI to a local target.
|
|
||||||
target = requestAnalyzer.getLocalTarget(httpChannel.URI.host, httpChannel.URI.path);
|
|
||||||
|
|
||||||
if (!target) {
|
|
||||||
return this.handleMissingCandidate(httpChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
characterSet = httpChannel.URI.originCharset;
|
|
||||||
|
|
||||||
// Fetch local data and create a redirection URI.
|
|
||||||
try {
|
|
||||||
redirectionURI = dataHandler.getRedirectionURI(target.path, characterSet, target.type);
|
|
||||||
} catch (exception) {
|
|
||||||
return this.handleMissingCandidate(httpChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix for reported edge-case issues with specific websites.
|
|
||||||
var initiatorDomain =
|
|
||||||
httpChannel.loadInfo && httpChannel.loadInfo.loadingDocument && httpChannel.loadInfo.loadingDocument.domain ||
|
|
||||||
httpChannel.referrer && httpChannel.referrer.host;
|
|
||||||
|
|
||||||
if (storage.taintedDomains[initiatorDomain] || /yandex\./.test(initiatorDomain)) {
|
|
||||||
return this.handleMissingCandidate(httpChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redirect the HTTP channel to the the local destination.
|
|
||||||
httpChannel.redirectTo(redirectionURI);
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedVariable
|
|
||||||
preferences.amountInjected++;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a valid candidate cannot be injected.
|
|
||||||
* @param httpChannel
|
|
||||||
*/
|
|
||||||
handleMissingCandidate: function (httpChannel) {
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedVariable
|
|
||||||
if (preferences.blockMissing) {
|
|
||||||
httpChannel.cancel(Cr.NS_ERROR_NOT_AVAILABLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exports
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = Interceptor;
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
/**
|
|
||||||
* Load Watcher
|
|
||||||
* Belongs to Decentraleyes.
|
|
||||||
*
|
|
||||||
* @author Thomas Rientjes
|
|
||||||
* @since 2016-02-04
|
|
||||||
* @license MPL 2.0
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
var { Class } = require('sdk/core/heritage');
|
|
||||||
var { Unknown, Factory } = require('sdk/platform/xpcom');
|
|
||||||
var { Cc, Ci, Cu } = require('chrome');
|
|
||||||
|
|
||||||
var xpcom = require('sdk/platform/xpcom');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource version mappings.
|
|
||||||
* @var {object} mappings
|
|
||||||
*/
|
|
||||||
var mappings = require('./mappings');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retains data across application restarts.
|
|
||||||
* @var {object} simpleStorage
|
|
||||||
*/
|
|
||||||
var simpleStorage = require('sdk/simple-storage');
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedFunction
|
|
||||||
var categoryManager = Cc['@mozilla.org/categorymanager;1']
|
|
||||||
.getService(Ci.nsICategoryManager);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constants
|
|
||||||
*/
|
|
||||||
|
|
||||||
const CONTRACT_ID = '@decentraleyes.org/load-watcher;1';
|
|
||||||
const SCRIPT_CONTENT_TYPE = Ci.nsIContentPolicy.TYPE_SCRIPT;
|
|
||||||
const SCRIPT_ELEMENT = Ci.nsIDOMHTMLScriptElement;
|
|
||||||
const REQUEST_ACCEPTATION = Ci.nsIContentPolicy.ACCEPT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variables
|
|
||||||
*/
|
|
||||||
|
|
||||||
var storage = simpleStorage.storage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tainted domains that are not automatically detectable.
|
|
||||||
* @var {object} undetectableTaintedDomains
|
|
||||||
*/
|
|
||||||
var undetectableTaintedDomains = {
|
|
||||||
|
|
||||||
'identi.ca': true,
|
|
||||||
'minigames.mail.ru': true,
|
|
||||||
'passport.twitch.tv': true,
|
|
||||||
'ya.ru': true,
|
|
||||||
'yadi.sk': true
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializations
|
|
||||||
*/
|
|
||||||
|
|
||||||
Object.extend = function (destination, source) {
|
|
||||||
|
|
||||||
for (var property in source) {
|
|
||||||
|
|
||||||
if (source.hasOwnProperty(property)) {
|
|
||||||
destination[property] = source[property];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return destination;
|
|
||||||
};
|
|
||||||
|
|
||||||
storage.taintedDomains = storage.taintedDomains || {};
|
|
||||||
storage.taintedDomains = Object.extend(storage.taintedDomains, undetectableTaintedDomains);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load Watcher Class
|
|
||||||
*/
|
|
||||||
|
|
||||||
var LoadWatcher = new Class({
|
|
||||||
|
|
||||||
extends: Unknown,
|
|
||||||
interfaces: ['nsIContentPolicy'],
|
|
||||||
get wrappedJSObject() {
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
|
|
||||||
register: function () {
|
|
||||||
|
|
||||||
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
|
|
||||||
categoryManager.addCategoryEntry('content-policy', CONTRACT_ID, CONTRACT_ID, false, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
shouldLoad: function (contentType, contentLocation, requestOrigin, node) {
|
|
||||||
|
|
||||||
if (contentType == SCRIPT_CONTENT_TYPE && mappings[contentLocation.host]) {
|
|
||||||
|
|
||||||
if (node instanceof SCRIPT_ELEMENT) {
|
|
||||||
|
|
||||||
if (node.hasAttribute('crossorigin') || node.hasAttribute('integrity')) {
|
|
||||||
|
|
||||||
// Add corresponding origin domain to the list of tainted domains.
|
|
||||||
storage.taintedDomains[requestOrigin.host] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Accept the resource load request.
|
|
||||||
return REQUEST_ACCEPTATION;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load Watcher Factory
|
|
||||||
*/
|
|
||||||
|
|
||||||
var factory = Factory({
|
|
||||||
|
|
||||||
contract: CONTRACT_ID,
|
|
||||||
Component: LoadWatcher,
|
|
||||||
unregister: false
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unregister
|
|
||||||
*/
|
|
||||||
|
|
||||||
var unload = require('sdk/system/unload');
|
|
||||||
|
|
||||||
unload.when(function () {
|
|
||||||
|
|
||||||
function trueUnregister() {
|
|
||||||
|
|
||||||
categoryManager.deleteCategoryEntry('content-policy', CONTRACT_ID, false);
|
|
||||||
|
|
||||||
try {
|
|
||||||
xpcom.unregister(factory);
|
|
||||||
} catch (exception) {
|
|
||||||
Cu.reportError(exception);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('dispatch' in Cu) {
|
|
||||||
Cu.dispatch(trueUnregister, trueUnregister);
|
|
||||||
} else {
|
|
||||||
Cu.import('resource://gre/modules/Services.jsm');
|
|
||||||
Services.tm.mainThread.dispatch(trueUnregister, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exports
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = LoadWatcher;
|
|
||||||
62
lib/main.js
@@ -1,62 +0,0 @@
|
|||||||
/**
|
|
||||||
* Entry Point
|
|
||||||
* Belongs to Decentraleyes.
|
|
||||||
*
|
|
||||||
* @author Thomas Rientjes
|
|
||||||
* @since 2014-05-30
|
|
||||||
* @license MPL 2.0
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
var Interceptor = require('./interceptor');
|
|
||||||
var LoadWatcher = require('./load-watcher');
|
|
||||||
|
|
||||||
var preferences = require('sdk/simple-prefs').prefs;
|
|
||||||
var self = require('sdk/self');
|
|
||||||
var tabs = require("sdk/tabs");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Main
|
|
||||||
*/
|
|
||||||
|
|
||||||
var interceptor = new Interceptor();
|
|
||||||
var loadWatcher = new LoadWatcher();
|
|
||||||
|
|
||||||
var featurelessVersions = {
|
|
||||||
|
|
||||||
'1.3.7': true
|
|
||||||
};
|
|
||||||
|
|
||||||
// Executed as soon as the add-on is loaded.
|
|
||||||
exports.main = function (options) {
|
|
||||||
|
|
||||||
// Initialize add-on state.
|
|
||||||
interceptor.register();
|
|
||||||
loadWatcher.register();
|
|
||||||
|
|
||||||
if (preferences.showReleaseNotes) {
|
|
||||||
|
|
||||||
if (options.loadReason === 'install' || (options.loadReason === 'upgrade' && !featurelessVersions[self.version])) {
|
|
||||||
|
|
||||||
if (preferences['sdk.baseURI']) {
|
|
||||||
tabs.open(preferences['sdk.baseURI'] + 'static/release-notes.html');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Executed as soon as the add-on is unloaded.
|
|
||||||
exports.onUnload = function () {
|
|
||||||
|
|
||||||
// Clean up add-on state.
|
|
||||||
interceptor.unregister();
|
|
||||||
};
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
/**
|
|
||||||
* Request Analyzer
|
|
||||||
* Belongs to Decentraleyes.
|
|
||||||
*
|
|
||||||
* @author Thomas Rientjes
|
|
||||||
* @since 2014-05-30
|
|
||||||
* @license MPL 2.0
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Imports
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource version mappings.
|
|
||||||
* @var {object} mappings
|
|
||||||
*/
|
|
||||||
var mappings = require('./mappings');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets and sets add-on specific preferences.
|
|
||||||
* @var {object} simplePreferences
|
|
||||||
*/
|
|
||||||
var simplePreferences = require('sdk/simple-prefs');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constants
|
|
||||||
*/
|
|
||||||
|
|
||||||
const MAPPING_FILE_EXPRESSION = new RegExp('.map$', 'i');
|
|
||||||
const VERSION_EXPRESSION = /(?:\d{1,2}\.){1,3}\d{1,2}/;
|
|
||||||
const VERSION_PLACEHOLDER = '{version}';
|
|
||||||
const WEB_PREFIX_VALUE = 'www.';
|
|
||||||
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
|
|
||||||
const VALUE_SEPARATOR = ';';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Variables
|
|
||||||
*/
|
|
||||||
|
|
||||||
var preferences = simplePreferences.prefs;
|
|
||||||
var whitelistedDomains = {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializations
|
|
||||||
*/
|
|
||||||
|
|
||||||
_applyWhitelistPreference();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Event Handlers
|
|
||||||
*/
|
|
||||||
|
|
||||||
simplePreferences.on('domainWhitelist', _applyWhitelistPreference);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Public Methods
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.isValidCandidate = function (httpChannel) {
|
|
||||||
|
|
||||||
// See if the request is targeted at a Content Delivery Network.
|
|
||||||
if (mappings[httpChannel.URI.host] === undefined) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Attempt to determine the domain of the request initiator.
|
|
||||||
var initiatorDomain =
|
|
||||||
httpChannel.loadInfo && httpChannel.loadInfo.loadingDocument && httpChannel.loadInfo.loadingDocument.domain ||
|
|
||||||
httpChannel.referrer && httpChannel.referrer.host;
|
|
||||||
|
|
||||||
// If the request initiator could be determined and is whitelisted.
|
|
||||||
if (initiatorDomain && whitelistedDomains[_normalizeDomain(initiatorDomain)]) {
|
|
||||||
|
|
||||||
// Remove referer header from request.
|
|
||||||
httpChannel.setRequestHeader('Referer', null, false);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only requests of type GET can be valid candidates.
|
|
||||||
return httpChannel.requestMethod === 'GET';
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.getLocalTarget = function (channelHost, channelPath) {
|
|
||||||
|
|
||||||
var hostMappings, basePath, resourceMappings;
|
|
||||||
|
|
||||||
// Use the proper mappings for the targeted host.
|
|
||||||
hostMappings = mappings[channelHost];
|
|
||||||
|
|
||||||
// Resource mapping files are never locally available.
|
|
||||||
if (MAPPING_FILE_EXPRESSION.test(channelPath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
basePath = _matchBasePath(hostMappings, channelPath);
|
|
||||||
resourceMappings = hostMappings[basePath];
|
|
||||||
|
|
||||||
if (!resourceMappings) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return either the local target's path or false.
|
|
||||||
return _findLocalTarget(resourceMappings, basePath, channelPath);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Private Methods
|
|
||||||
*/
|
|
||||||
|
|
||||||
function _matchBasePath(hostMappings, channelPath) {
|
|
||||||
|
|
||||||
for (let basePath of Object.keys(hostMappings)) {
|
|
||||||
|
|
||||||
if (channelPath.startsWith(basePath)) {
|
|
||||||
return basePath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _findLocalTarget(resourceMappings, basePath, channelPath) {
|
|
||||||
|
|
||||||
var resourcePath, versionNumber, resourcePattern;
|
|
||||||
|
|
||||||
resourcePath = channelPath.replace(basePath, '');
|
|
||||||
|
|
||||||
versionNumber = resourcePath.match(VERSION_EXPRESSION);
|
|
||||||
resourcePattern = resourcePath.replace(versionNumber, VERSION_PLACEHOLDER);
|
|
||||||
|
|
||||||
// Determine if the resource path has a static mapping.
|
|
||||||
if (resourceMappings[resourcePath]) {
|
|
||||||
|
|
||||||
// Prepare and return a local target.
|
|
||||||
return {
|
|
||||||
path: resourceMappings[resourcePath].path,
|
|
||||||
type: resourceMappings[resourcePath].type
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine if the resource path fits into a resource mold.
|
|
||||||
for (let resourceMold of Object.keys(resourceMappings)) {
|
|
||||||
|
|
||||||
if (resourcePattern.startsWith(resourceMold)) {
|
|
||||||
|
|
||||||
// Prepare and return a local target.
|
|
||||||
return {
|
|
||||||
path: resourceMappings[resourceMold].path.replace(VERSION_PLACEHOLDER, versionNumber),
|
|
||||||
type: resourceMappings[resourceMold].type
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _normalizeDomain(domain) {
|
|
||||||
|
|
||||||
domain = domain.toLowerCase().trim();
|
|
||||||
|
|
||||||
if (domain.startsWith(WEB_PREFIX_VALUE)) {
|
|
||||||
domain = domain.slice(WEB_PREFIX_LENGTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
return domain;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _applyWhitelistPreference() {
|
|
||||||
|
|
||||||
whitelistedDomains = {};
|
|
||||||
|
|
||||||
//noinspection JSUnresolvedVariable
|
|
||||||
preferences.domainWhitelist.split(VALUE_SEPARATOR).forEach(function (domain) {
|
|
||||||
whitelistedDomains[_normalizeDomain(domain)] = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Добавяне на коментари към местно извлечени файлове">
|
|
||||||
<!ENTITY options.addNotice.description "Автоматично вмъкване на известие към извлечените документи, за да се сигнализира местна доставка.">
|
|
||||||
<!ENTITY options.blockMissing.title "Блокиране на заявки за липсващи ресурси">
|
|
||||||
<!ENTITY options.blockMissing.description "Отмяна на прехванатата заявка, ако изисквания ресурс не е наличен на местно ниво.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Изключване на домейните от инспекции">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Въведете домейни, които да се добавят в белия списък. Отделете стойностите с точка и запетая.">
|
|
||||||
<!ENTITY options.amountInjected.title "Брояч за местно вмъкнати ресурси">
|
|
||||||
<!ENTITY options.amountInjected.description "Количество на местни вмъквания на ресурси от началото на инсталацията.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Tilføj kommentarer til lokalt hentede filer">
|
|
||||||
<!ENTITY options.addNotice.description "Tilføj automatiskt en notits til filer, så det fremgår at de er leveret lokalt.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloker anmodninger om manglende ressourcer">
|
|
||||||
<!ENTITY options.blockMissing.description "Annullerer en anmodning hvis den forespurgte ressource ikke findes lokalt.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Udeluk disse domæner fra inspektion">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Tilføj domæner der ikke skal opfanges. Separer flere med semikolon (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Optælling af lokalt leverede ressourcer">
|
|
||||||
<!ENTITY options.amountInjected.description "Antal injektioner af lokale ressourcer siden installation.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Kennzeichne lokal abgerufene Dateien">
|
|
||||||
<!ENTITY options.addNotice.description "Füge automatisch Kommentare an lokal ausgelieferte Bibliotheken hinzu.">
|
|
||||||
<!ENTITY options.blockMissing.title "Blockiere Anfordern fehlender Inhalte">
|
|
||||||
<!ENTITY options.blockMissing.description "Abgefangene Anforderung unterbinden, falls angeforderte Datei nicht lokal verfügbar ist.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Domains von Prüfung ausschließen">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Gebe zu ignorierende Domains an. Trenne mehrere Einträge durch Semikolons (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Zähler für lokal injizierte Ressourcen">
|
|
||||||
<!ENTITY options.amountInjected.description "Anzahl der lokalen Injektionen von den CDN-Ressourcen seit der Installation.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Προσθήκη σχολίων σε τοπικά τοποθετημένα αρχεία">
|
|
||||||
<!ENTITY options.addNotice.description "Πρόσθεση αυτόματης ειδοποίησης ανάκτησης εγγράφων ώστε να σηματοδοτηθεί τοπική παράδοση.">
|
|
||||||
<!ENTITY options.blockMissing.title "Μπλοκ αιτήσεων για ανύπαρκτους πόρους">
|
|
||||||
<!ENTITY options.blockMissing.description "Ακύρωση απομακρυσμένης αίτησης, αν ο απαιτούμενος πόρος δεν είναι τοπικά διαθέσιμος.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Εξαίρεση διευθύνσεων από επιθεωρήσεις">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Εισαγωγή διευθύνσεων στις επιτρεπόμενες. Διαχωρίστε πολλαπλές καταχωρήσεις με ερωτηματικά (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Μετρητής εμβόλιμων τοπικών πόρων">
|
|
||||||
<!ENTITY options.amountInjected.description "Ποσοστό εμβόλιμων τοπικών πόρων Δικτύων Παροχής Περιεχομένου από την στιγμή της εγκατάστασης.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Add comments to locally fetched files">
|
|
||||||
<!ENTITY options.addNotice.description "Automatically prepend a notice to retrieved documents to signal local delivery.">
|
|
||||||
<!ENTITY options.blockMissing.title "Block requests for missing resources">
|
|
||||||
<!ENTITY options.blockMissing.description "Cancel intercepted request if the required resource is not locally available.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Exclude domains from inspections">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Counter for locally injected resources">
|
|
||||||
<!ENTITY options.amountInjected.description "Amount of local Content Delivery Network resource injections since installation.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Add comments to locally fetched files">
|
|
||||||
<!ENTITY options.addNotice.description "Automatically prepend a notice to retrieved documents to signal local delivery.">
|
|
||||||
<!ENTITY options.blockMissing.title "Block requests for missing resources">
|
|
||||||
<!ENTITY options.blockMissing.description "Cancel intercepted request if the required resource is not locally available.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Exclude domains from inspections">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Enter domains to whitelist them. Separate multiple entries with semi-colons (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Counter for locally injected resources">
|
|
||||||
<!ENTITY options.amountInjected.description "Amount of local Content Delivery Network resource injections since installation.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Aldoni komentojn al lokaj dosieroj">
|
|
||||||
<!ENTITY options.addNotice.description "Aldoni sciigon al enmetitaj dokumentoj por marki ke ili estas lokaj risurcoj.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloki petojn por mankaj risurcoj">
|
|
||||||
<!ENTITY options.blockMissing.description "Bloki petojn interkaptitajn se la petitan risurcon ne loke haveblas.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Neinspektendaj domajnoj">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Entajpu demajnojn, kiujn Decentraleyes ne devas inspekti. Disigu domajnojn per punktokomoj (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Nombrilo de loke enmetiaj risurcoj">
|
|
||||||
<!ENTITY options.amountInjected.description "Kvanto de lokaj CDN-risurcoj enmetitaj ekde instaliĝo.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Añadir notas a archivos obtenidos localmente">
|
|
||||||
<!ENTITY options.addNotice.description "Anteponer un aviso a documentos obtenidos para señalar entrega local.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloquear peticiones de fuentes faltantes">
|
|
||||||
<!ENTITY options.blockMissing.description "Cancelar peticiones detenidas si la fuente requerida no se encuentra localmente.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Excluir dominios de inspecciones">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Ingresar dominios a ser ignorados. Separar múltiples entradas con punto y coma (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Contador para fuentes inyectadas localmente">
|
|
||||||
<!ENTITY options.amountInjected.description "Cifra de inyecciones de fuentes de Redes de Entrega de Contenido desde instalación.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Merkitse korvatut tiedostot">
|
|
||||||
<!ENTITY options.addNotice.description "Lisää alkuun ilmoituksen paikallisesti noudetuille tiedostoille.">
|
|
||||||
<!ENTITY options.blockMissing.title "Estä pyynnöt puuttuviin resursseihin">
|
|
||||||
<!ENTITY options.blockMissing.description "Estää pyynnöt jos paikallista sisältöä ei ole saatavilla.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Poissulje verkkotunnukset">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Lisää verkkotunnus jottei sitä korvata. Erota rivit puolipisteellä (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Korvatut pyynnöt">
|
|
||||||
<!ENTITY options.amountInjected.description "Korvatut sisältöpyynnöt lisäosan asennuksen jälkeen.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Pointer les documents joints localement">
|
|
||||||
<!ENTITY options.addNotice.description "Accoler une notice aux documents récupérés pour en signaler l'origine locale.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloquer les ressources manquantes">
|
|
||||||
<!ENTITY options.blockMissing.description "Annuler une demande de ressource si elle est indisponible localement.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Ne pas inspecter certains domaines">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Indiquez les domaines à exclure. Séparer les noms par un point-virgule (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Compteur des ressources injectées">
|
|
||||||
<!ENTITY options.amountInjected.description "Total des ressources des CDN injectées localement depuis l'installation.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Tambahkan komentar ke berkas lokal yang disimpan">
|
|
||||||
<!ENTITY options.addNotice.description "Secara otomatis menambahkan pemberitahuan untuk mengambil dokumen untuk sinyal pengiriman lokal.">
|
|
||||||
<!ENTITY options.blockMissing.title "Blokir permintaan untuk sumber daya yang hilang">
|
|
||||||
<!ENTITY options.blockMissing.description "Batalkan intersep permintaan jika sumber daya yang dibutuhkan tidak tersedia secara lokal.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Cegah inspeksi domain">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Masukkan domain ke daftar putih. Pisahkan entri dengan titik koma (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Sumber daya lokal yang disematkan">
|
|
||||||
<!ENTITY options.amountInjected.description "Jumlah penyematan sumber daya Jaringan Distribusi Konten lokal sejak pemasangan.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Aggiungere commenti a file raccolti localmente">
|
|
||||||
<!ENTITY options.addNotice.description "Antepone automaticamente un avviso ai documenti recuperati per segnalare la distribuzione locale.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloccare richieste di risorse mancanti">
|
|
||||||
<!ENTITY options.blockMissing.description "Annullare la richiesta intercettata se la risorsa necessaria non è disponibile localmente.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Escludere domini dalle ispezioni">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Inserire domini nella whitelist per escluderli. Separare voci multiple con punti e virgola (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Contatore per risorse iniettate localmente">
|
|
||||||
<!ENTITY options.amountInjected.description "Quantità di iniezioni di risorse dalla Rete di Distribuzione di Contenuti locale sin dall'installazione.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "ローカルからのファイルにコメントを追加する">
|
|
||||||
<!ENTITY options.addNotice.description "ローカルCDNから取得したドキュメントにその旨を記載する。">
|
|
||||||
<!ENTITY options.blockMissing.title "存在しないリソースへの要求をブロック">
|
|
||||||
<!ENTITY options.blockMissing.description "必要なリソースがローカルで利用できない場合、リクエストを取り消す。">
|
|
||||||
<!ENTITY options.domainWhitelist.title "保護から除外するドメイン">
|
|
||||||
<!ENTITY options.domainWhitelist.description "ホワイト リストにドメインを入力します。複数のエントリをセミコロン (;) で区切ります。">
|
|
||||||
<!ENTITY options.amountInjected.title "ローカルから挿入されたリソースの数">
|
|
||||||
<!ENTITY options.amountInjected.description "インストールから起算した、ローカルCDNのリソース使用数。">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Notities aan lokale bestanden toevoegen">
|
|
||||||
<!ENTITY options.addNotice.description "Voorzie alle door deze add-on opgehaalde bestanden automatisch van een notitie.">
|
|
||||||
<!ENTITY options.blockMissing.title "Stop verzoeken voor ontbrekende items">
|
|
||||||
<!ENTITY options.blockMissing.description "Annuleer een onderschept verzoek wanneer het bestand niet lokaal beschikbaar is.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Sluit domeinen uit van inspecties">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Voer de te negeren domeinen in. Scheid de waarden met puntkomma's (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Teller voor lokaal geïnjecteerde bestanden">
|
|
||||||
<!ENTITY options.amountInjected.description "Aantal lokale Content Delivery Network-bestandsinjecties sinds installatie.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Dodaj komentarz do plików przechowywanych lokalnie">
|
|
||||||
<!ENTITY options.addNotice.description "Automatycznie dodawaj powiadomienie do pobranych dokumentów aby zasygnalizować lokalne dostarczanie.">
|
|
||||||
<!ENTITY options.blockMissing.title "Blokuj żądania brakujących zasobów">
|
|
||||||
<!ENTITY options.blockMissing.description "Anuluj przechwycone żądania jeśli wymagany zasób nie jest dostępny lokalnie.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Wyklucz domeny z analizy">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Podaj domeny aby dodać je do białej listy. Oddziel wpisy średnikami (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Licznik zasobów podanych lokalnie">
|
|
||||||
<!ENTITY options.amountInjected.description "Ilość wstrzyknięć z lokalnego Content Delivery Network od czasu instalacji.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Adicionar comentários aos ficheiros obtidos localmente">
|
|
||||||
<!ENTITY options.addNotice.description "Preceder automaticamente um aviso aos documentos readquiridos para sinalizar a entrega local.">
|
|
||||||
<!ENTITY options.blockMissing.title "Bloquear pedidos por falta de recursos">
|
|
||||||
<!ENTITY options.blockMissing.description "Cancelar pedido intercetado se o recurso necessário não estiver disponível localmente.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Excluir domínios de inspeções">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Insira domínios para os colocar na lista branca. Separe múltiplas entradas com pontos e vírgulas (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Contador para recursos injetados localmente">
|
|
||||||
<!ENTITY options.amountInjected.description "Quantidade de injeções de recurso Content Delivery Network locais desde a instalação.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Добавить комментарии к локальным файлам">
|
|
||||||
<!ENTITY options.addNotice.description "Автоматически добавляет комментарий к скачанным «документам» для обозначения локальной «доставки».">
|
|
||||||
<!ENTITY options.blockMissing.title "Блокировать запросы недостающих ресурсов">
|
|
||||||
<!ENTITY options.blockMissing.description "Отменить перехваченный запрос, если требуемый ресурс не доступен локально (может «ломать» сайты).">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Исключить домены из проверки">
|
|
||||||
<!ENTITY options.domainWhitelist.description "«Белый список» доменов. Контент, расположенный на них не будет фильтроваться. Записи (при количестве более одной) разделяются точкой с запятой (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Счётчик файлов «доставленных» локально">
|
|
||||||
<!ENTITY options.amountInjected.description "Количество локально «доставленных» файлов с момента установки.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "Kommentera hämtade filer">
|
|
||||||
<!ENTITY options.addNotice.description "Lägg automatiskt in en notis i böjan av hämtade filer för att påvisa att de finns lokalt.">
|
|
||||||
<!ENTITY options.blockMissing.title "Blockera förfrågningar när resurs saknas">
|
|
||||||
<!ENTITY options.blockMissing.description "Avbryt uppsnappning om resurs inte finns lokalt.">
|
|
||||||
<!ENTITY options.domainWhitelist.title "Utelämna domäner från uppsnappningar">
|
|
||||||
<!ENTITY options.domainWhitelist.description "Ange domäner för vitlistning. Spearera domänerna med semikolon (;).">
|
|
||||||
<!ENTITY options.amountInjected.title "Räknare för lokalt insatta resurser">
|
|
||||||
<!ENTITY options.amountInjected.description "Antalet insatta Content Delivery Network-resurser sedan installationen.">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "添加注释到从本地获取的文件">
|
|
||||||
<!ENTITY options.addNotice.description "自动预置一个通知到获取的文档以标记从本地交付。">
|
|
||||||
<!ENTITY options.blockMissing.title "阻止缺失资源的请求">
|
|
||||||
<!ENTITY options.blockMissing.description "取消被拦截的请求,如果请求的资源在本地不可用。">
|
|
||||||
<!ENTITY options.domainWhitelist.title "排除要检查的域名">
|
|
||||||
<!ENTITY options.domainWhitelist.description "输入白名单的域名。用分号 (;) 分隔多项。">
|
|
||||||
<!ENTITY options.amountInjected.title "本地发送资源的计数器">
|
|
||||||
<!ENTITY options.amountInjected.description "自安装以来,从本地的“内容交付网络”发送的资源总量。">
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<!ENTITY options.addNotice.title "在從本機取得的檔案中加入註解">
|
|
||||||
<!ENTITY options.addNotice.description "自動在取回的文件前方加入提示,以表示這是從本機提供的檔案。">
|
|
||||||
<!ENTITY options.blockMissing.title "封鎖缺少資源時的連線請求">
|
|
||||||
<!ENTITY options.blockMissing.description "若本機沒有所請求的資源,就取消該請求。">
|
|
||||||
<!ENTITY options.domainWhitelist.title "要排除檢查的網域">
|
|
||||||
<!ENTITY options.domainWhitelist.description "輸入網域即可將其加入白名單。使用分號(;)分隔多個網域。">
|
|
||||||
<!ENTITY options.amountInjected.title "由本機提供的資源計數器">
|
|
||||||
<!ENTITY options.amountInjected.description "安裝以來,由本機檔案所取代的 CDN 資源數量。">
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"locales": []
|
|
||||||
}
|
|
||||||
60
manifest.json
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "Decentraleyes",
|
||||||
|
"version": "2.0.0-beta1",
|
||||||
|
|
||||||
|
"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": [
|
||||||
|
"*://*/*",
|
||||||
|
"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"]},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")}();
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" ?>
|
|
||||||
<!DOCTYPE vbox SYSTEM "chrome://decentraleyes/locale/options.dtd">
|
|
||||||
<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
||||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.addNotice" pref-name="addNotice" title="&options.addNotice.title;" type="bool">&options.addNotice.description;</setting>
|
|
||||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing" pref-name="blockMissing" title="&options.blockMissing.title;" type="bool">&options.blockMissing.description;</setting>
|
|
||||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist" pref-name="domainWhitelist" title="&options.domainWhitelist.title;" type="string">&options.domainWhitelist.description;</setting>
|
|
||||||
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected" pref-name="amountInjected" title="&options.amountInjected.title;" type="integer">&options.amountInjected.description;</setting>
|
|
||||||
</vbox>
|
|
||||||
20
package.json
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "Local emulation of Content Delivery Networks.",
|
|
||||||
"author": "Thomas Rientjes",
|
|
||||||
"license": "MPL-2.0",
|
|
||||||
"title": "Decentraleyes",
|
|
||||||
"version": "1.3.8",
|
|
||||||
"main": "lib/main.js",
|
|
||||||
"homepage": "https://addons.mozilla.org/firefox/addon/decentraleyes",
|
|
||||||
"name": "decentraleyes",
|
|
||||||
"id": "jid1-BoFifL9Vbdl2zQ@jetpack",
|
|
||||||
"permissions": {
|
|
||||||
"multiprocess": true
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"firefox": ">=38.0a1",
|
|
||||||
"fennec": ">=38.0a1",
|
|
||||||
"seamonkey": ">=2.0a1 <=2.46",
|
|
||||||
"{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}": ">=27.1.0b1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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 |