Verified Commit 2a3e5084 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Update and refactor existing codebase

parent 1a7f41ee
......@@ -4,21 +4,28 @@
"es6": true,
"webextensions": true
},
"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"plugin:no-unsanitized/DOM"
],
"globals": {
"Address": true,
"fileGuard": true,
"files": true,
"Header": true,
"helpers": true,
"interceptor": true,
"mappings": true,
"MessageResponse": true,
"requestAnalyzer": true,
"requestSanitizer": true,
"Resource": true,
"resources": true,
"Setting": true,
"shorthands": true,
"stateManager": true,
"WebRequest": true,
"WebRequestType": true,
"Whitelist": true,
"wrappers": true
},
......@@ -27,12 +34,16 @@
"core/constants.js",
"core/files.js",
"core/mappings.js",
"core/resources.js"
"core/resources.js",
"core/shorthands.js"
],
"rules": {
"no-unused-vars": "off"
}
},
"plugins": [
"no-unsanitized"
],
"rules": {
"array-bracket-newline": "error",
"array-bracket-spacing": "error",
......
{
"extensionDescription":{
"message":"Decentraleyes protektas vin kontraŭ sekvado per senkosta, centra enhavoprovizado.",
"description":"Extension description."
"extensionDescription": {
"message": "Decentraleyes protektas vin kontraŭ sekvado per senkosta, centra enhavoprovizado.",
"description": "Extension description."
},
"disableProtectionTitle":{
"message":"Malaktivigi protekton por tiu ĉi retejo",
"description":"Disable protection title."
"disableProtectionTitle": {
"message": "Malaktivigi protekton por tiu ĉi retejo",
"description": "Disable protection title."
},
"enableProtectionTitle":{
"message":"Aktivigi protekton",
"description":"Enable protection title."
"enableProtectionTitle": {
"message": "Aktivigi protekton",
"description": "Enable protection title."
},
"amountInjectedTitle":{
"message":"Nombrilo de loke enmetiaj risurcoj",
"description":"Amount injected title."
"amountInjectedTitle": {
"message": "Nombrilo de loke enmetiaj risurcoj",
"description": "Amount injected title."
},
"amountInjectedDescription":{
"message":"Kvanto de lokaj CDN-risurcoj enmetitaj ekde instaliĝo.",
"description":"Amount injected description."
"amountInjectedDescription": {
"message": "Kvanto de lokaj CDN-risurcoj enmetitaj ekde instaliĝo.",
"description": "Amount injected description."
},
"optionsTitle":{
"message":"Elektebloj",
"description":"Options title."
"optionsTitle": {
"message": "Elektebloj",
"description": "Options title."
},
"showIconBadgeTitle":{
"message":"Display injection counts on icon",
"description":"Show icon badge title."
"showIconBadgeTitle": {
"message": "Montri nombrilon sur piktogramo",
"description": "Show icon badge title."
},
"showIconBadgeDescription":{
"message":"Show the number of injected resources on the extension icon.",
"description":"Show icon badge description."
"showIconBadgeDescription": {
"message": "Montri nombron da enmetataj risurcoj sur la aldonaĵa piktogramo.",
"description": "Show icon badge description."
},
"blockMissingTitle":{
"message":"Bloki petojn por mankaj risurcoj",
"description":"Block requests for missing resources title."
"blockMissingTitle": {
"message": "Bloki petojn por mankaj risurcoj",
"description": "Block requests for missing resources title."
},
"blockMissingDescription":{
"message":"Bloki petojn interkaptitajn se la petitan risurcon ne loke haveblas.",
"description":"Block requests for missing resources description."
"blockMissingDescription": {
"message": "Bloki petojn interkaptitajn se la petitan risurcon ne loke haveblas.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle":{
"message":"Disable link prefetching",
"description":"Disable prefetch title."
"disablePrefetchTitle": {
"message": "Ne antaŭlegi ligilojn",
"description": "Disable prefetch title."
},
"disablePrefetchDescription":{
"message":"Prevent disallowed requests from leaking out to delivery networks.",
"description":"Disable prefetch description."
"disablePrefetchDescription": {
"message": "Bloki malpermesatajn petojn por preventi tralasojn al enhav-proviz-retoj.",
"description": "Disable prefetch description."
},
"stripMetadataTitle":{
"message":"Strip metadata from allowed requests",
"description":"Strip metadata title."
"stripMetadataTitle": {
"message": "Forigi metadatumojn el permesataj petoj",
"description": "Strip metadata title."
},
"stripMetadataDescription":{
"message":"Erase sensitive data from allowed CDN requests for improved privacy.",
"description":"Strip metadata description."
"stripMetadataDescription": {
"message": "Forviŝi delikatajn datumojn el permesataj CDN-petoj por plibonigi privatecon.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle":{
"message":"Neinspektendaj domajnoj",
"description":"Whitelisted domains title."
"whitelistedDomainsTitle": {
"message": "Neinspektendaj domajnoj",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription":{
"message":"Entajpu demajnojn, kiujn Decentraleyes ne devas inspekti. Disigu domajnojn per punktokomoj (;).",
"description":"Whitelisted domains description."
"whitelistedDomainsDescription": {
"message": "Entajpu demajnojn, kiujn Decentraleyes ne devas inspekti. Disigu domajnojn per punktokomoj (;).",
"description": "Whitelisted domains description."
},
"advancedLabel":{
"message":"Spertula",
"description":"Advanced label."
"advancedLabel": {
"message": "Spertula",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription":{
"message":"Protège du pistage lié aux diffuseurs de contenus \"gratuits\", centralisés.",
"description":"Extension description."
"extensionDescription": {
"message": "Protège du pistage lié aux diffuseurs de contenus \"gratuits\", centralisés.",
"description": "Extension description."
},
"disableProtectionTitle":{
"message":"Désactiver la protection pour ce site",
"description":"Disable protection title."
"disableProtectionTitle": {
"message": "Désactiver la protection pour ce site",
"description": "Disable protection title."
},
"enableProtectionTitle":{
"message":"Activer la protection",
"description":"Enable protection title."
"enableProtectionTitle": {
"message": "Activer la protection",
"description": "Enable protection title."
},
"amountInjectedTitle":{
"message":"Compteur de ressources injectées localement",
"description":"Amount injected title."
"amountInjectedTitle": {
"message": "Compteur de ressources injectées localement",
"description": "Amount injected title."
},
"amountInjectedDescription":{
"message":"Quantité de ressource CDN injectées localement depuis l'installation.",
"description":"Amount injected description."
"amountInjectedDescription": {
"message": "Quantité de ressources CDN injectées localement depuis l'installation.",
"description": "Amount injected description."
},
"optionsTitle":{
"message":"Options",
"description":"Options title."
"optionsTitle": {
"message": "Options",
"description": "Options title."
},
"showIconBadgeTitle":{
"message":"Affichage du nombre d'injections sur l'icône",
"description":"Show icon badge title."
"showIconBadgeTitle": {
"message": "Afficher le nombre dinjections sur licône",
"description": "Show icon badge title."
},
"showIconBadgeDescription":{
"message":"Affiche le nombre de ressources injectées sur l'icône d'extension.",
"description":"Show icon badge description."
"showIconBadgeDescription": {
"message": "Affiche le nombre de ressources injectées sur l'icône d'extension.",
"description": "Show icon badge description."
},
"blockMissingTitle":{
"message":"Bloquer les requêtes de ressources manquantes",
"description":"Block requests for missing resources title."
"blockMissingTitle": {
"message": "Bloquer les requêtes de ressources manquantes",
"description": "Block requests for missing resources title."
},
"blockMissingDescription":{
"message":"Annule la requête interceptée si la ressource requise n'est pas disponible localement.",
"description":"Block requests for missing resources description."
"blockMissingDescription": {
"message": "Annule la requête interceptée si la ressource requise n'est pas disponible localement.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle":{
"message":"Désactiver le préchargement de lien",
"description":"Disable prefetch title."
"disablePrefetchTitle": {
"message": "Désactiver le préchargement de lien",
"description": "Disable prefetch title."
},
"disablePrefetchDescription":{
"message":"Empêcher que des requêtes non autorisées fuit du réseaux de distribution.",
"description":"Disable prefetch description."
"disablePrefetchDescription": {
"message": "Empêche que des requêtes non autorisées fuient vers les réseaux de distribution.",
"description": "Disable prefetch description."
},
"stripMetadataTitle":{
"message":"Découper les métadonnées des requêtes autorisées",
"description":"Strip metadata title."
"stripMetadataTitle": {
"message": "Découper les métadonnées des requêtes autorisées",
"description": "Strip metadata title."
},
"stripMetadataDescription":{
"message":"Efface les données sensibles des demandes de CDN autorisées pour améliorer la confidentialité.",
"description":"Strip metadata description."
"stripMetadataDescription": {
"message": "Efface les données sensibles des demandes de CDN autorisées pour améliorer la confidentialité.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle":{
"message":"Exclure les domaines des inspections",
"description":"Whitelisted domains title."
"whitelistedDomainsTitle": {
"message": "Exclure les domaines des inspections",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription":{
"message":"Entrez des domaines pour la liste blanche. Séparez les entrées multiples par des points-virgules (;).",
"description":"Whitelisted domains description."
"whitelistedDomainsDescription": {
"message": "Entrez des domaines pour la liste blanche. Séparez les entrées multiples par des points-virgules (;).",
"description": "Whitelisted domains description."
},
"advancedLabel":{
"message":"Avancé",
"description":"Advanced label."
"advancedLabel": {
"message": "Avancé",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription":{
"message":"Verndar þig gegn eftirliti frá \"ókeypis\" miðlægum efnisveitum.",
"description":"Extension description."
"extensionDescription": {
"message": "Verndar þig gegn eftirliti frá \"ókeypis\" miðlægum efnisveitum.",
"description": "Extension description."
},
"disableProtectionTitle":{
"message":"Slökkva á vörn fyrir þetta vefsvæði",
"description":"Disable protection title."
"disableProtectionTitle": {
"message": "Slökkva á vörn fyrir þetta vefsvæði",
"description": "Disable protection title."
},
"enableProtectionTitle":{
"message":"Virkja vernd",
"description":"Enable protection title."
"enableProtectionTitle": {
"message": "Virkja vernd",
"description": "Enable protection title."
},
"amountInjectedTitle":{
"message":"Fjöldi staðvært inspýttra tilfanga",
"description":"Amount injected title."
"amountInjectedTitle": {
"message": "Fjöldi staðvært inspýttra tilfanga",
"description": "Amount injected title."
},
"amountInjectedDescription":{
"message":"Fjöldi tilfanga frá miðlægum efnisveitum sem skipt hefur verið út síðan viðbótin var sett upp.",
"description":"Amount injected description."
"amountInjectedDescription": {
"message": "Fjöldi tilfanga frá miðlægum efnisveitum sem skipt hefur verið út síðan viðbótin var sett upp.",
"description": "Amount injected description."
},
"optionsTitle":{
"message":"Valkostir",
"description":"Options title."
"optionsTitle": {
"message": "Valkostir",
"description": "Options title."
},
"showIconBadgeTitle":{
"message":"Birta fjölda innspýtinga á táknmynd",
"description":"Show icon badge title."
"showIconBadgeTitle": {
"message": "Birta fjölda innspýtinga á táknmynd",
"description": "Show icon badge title."
},
"showIconBadgeDescription":{
"message":"Sýnir merki fyrir fjölda innspýttra tilfanga á táknmynd viðbótarinnar.",
"description":"Show icon badge description."
"showIconBadgeDescription": {
"message": "Sýnir merki fyrir fjölda innspýttra tilfanga á táknmynd viðbótarinnar.",
"description": "Show icon badge description."
},
"blockMissingTitle":{
"message":"Loka á beiðnir vegna tilfanga sem vantar",
"description":"Block requests for missing resources title."
"blockMissingTitle": {
"message": "Loka á beiðnir vegna tilfanga sem vantar",
"description": "Block requests for missing resources title."
},
"blockMissingDescription":{
"message":"Hætta við veiddar beiðnir ef umbeðið tilfang er ekki til staðar á tölvunni.",
"description":"Block requests for missing resources description."
"blockMissingDescription": {
"message": "Hætta við veiddar beiðnir ef umbeðið tilfang er ekki til staðar á tölvunni.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle":{
"message":"Gera forsöfnun tengla óvirka",
"description":"Disable prefetch title."
"disablePrefetchTitle": {
"message": "Gera forsöfnun tengla óvirka",
"description": "Disable prefetch title."
},
"disablePrefetchDescription":{
"message":"Kemur í veg fyrir að bannaðar beiðnir leki út til afhendingarveitna.",
"description":"Disable prefetch description."
"disablePrefetchDescription": {
"message": "Kemur í veg fyrir að bannaðar beiðnir leki út til afhendingarveitna.",
"description": "Disable prefetch description."
},
"stripMetadataTitle":{
"message":"Hreinsa lýsigögn úr leyfðum beiðnum",
"description":"Strip metadata title."
"stripMetadataTitle": {
"message": "Hreinsa lýsigögn úr leyfðum beiðnum",
"description": "Strip metadata title."
},
"stripMetadataDescription":{
"message":"Þurrka viðkvæm gögn út úr leyfðum beiðnum til efnisveitna til að auka gagnaleynd.",
"description":"Strip metadata description."
"stripMetadataDescription": {
"message": "Þurrka viðkvæm gögn út úr leyfðum beiðnum til efnisveitna til að auka gagnaleynd.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle":{
"message":"Undanskilja lén frá athugun",
"description":"Whitelisted domains title."
"whitelistedDomainsTitle": {
"message": "Undanskilja lén frá athugun",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription":{
"message":"Settu inn lén til að skrá þau á lista yfir leyfð lén. Aðgreindu færslur með semíkommum (;).",
"description":"Whitelisted domains description."
"whitelistedDomainsDescription": {
"message": "Settu inn lén til að skrá þau á lista yfir leyfð lén. Aðgreindu færslur með semíkommum (;).",
"description": "Whitelisted domains description."
},
"advancedLabel":{
"message":"Ítarlegt",
"description":"Advanced label."
"advancedLabel": {
"message": "Ítarlegt",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription": {
"message": "Schützt virun Tracking duerch \"gratis\" Content Delivery Networks.",
"description": "Extension description."
},
"disableProtectionTitle": {
"message": "Schutz fir dëse Site ausschalten",
"description": "Disable protection title."
},
"enableProtectionTitle": {
"message": "Schutz aktivéieren",
"description": "Enable protection title."
},
"amountInjectedTitle": {
"message": "Zieler fir lokal injizéierte Ressourcen",
"description": "Amount injected title."
},
"amountInjectedDescription": {
"message": "Unzuel vu lokalen Injektiounen vun CDN-Ressourcen säit der Installatioun.",
"description": "Amount injected description."
},
"optionsTitle": {
"message": "Astellungen",
"description": "Options title."
},
"showIconBadgeTitle": {
"message": "Unzuel vun Injektiounen op der Ikon uweisen",
"description": "Show icon badge title."
},
"showIconBadgeDescription": {
"message": "D'Unzuel vun injizéierte Ressourcen op der Decentraleyes-Ikon uweisen.",
"description": "Show icon badge description."
},
"blockMissingTitle": {
"message": "Eroflueden vu fehlenden Ressourcen blockéieren",
"description": "Block requests for missing resources title."
},
"blockMissingDescription": {
"message": "Ofgefaangen Ressourcen-Downloads blockéieren, wann déi ugefuerdert Datei net lokal um System verfügbar ass.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle": {
"message": "\"Link Prefetching\" ausschalten",
"description": "Disable prefetch title."
},
"disablePrefetchDescription": {
"message": "Verhënnert, dass onerlaabten Ressourcen entgéint den aneren Astellungen trotzdeem ugefuerdert\/erofgeluede ginn.",
"description": "Disable prefetch description."
},
"stripMetadataTitle": {
"message": "Metadaten aus den erlaabten Downloads erausläschen",
"description": "Strip metadata title."
},
"stripMetadataDescription": {
"message": "Läscht sensibel Daten aus den erlaabten CDN-Downloads fir den Dateschutz ze verbesseren.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle": {
"message": "Downloads fir dës Siten ëmmer erlaaben (Whitelist)",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription": {
"message": "Gitt hei d'Domains un, deenen hir Downloads ëmmer sollen erlaabt ginn. Trennt déi eenzel Domains duerch e Semikolon (;).",
"description": "Whitelisted domains description."
},
"advancedLabel": {
"message": "Erweidert",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription": {
"message": "Para protektahan ka laban sa pagsubaybay sa pamamagitan ng \"libre\", sentralisadong, paghahatid ng nilalaman.",
"description": "Extension description."
},
"disableProtectionTitle": {
"message": "Huwag paganahin ang proteksyon para sa sayt na ito",
"description": "Disable protection title."
},
"enableProtectionTitle": {
"message": "Paganahin ang proteksyon",
"description": "Enable protection title."
},
"amountInjectedTitle": {
"message": "Laban para sa mga lokal na iniksiyong mga mapagkukunan",
"description": "Amount injected title."
},
"amountInjectedDescription": {
"message": "Ang halaga ng mga lokal na Nilalaman sa Network ng Paghahatid ng pinagmulan sa pag-install mula noong pag-install.",
"description": "Amount injected description."
},
"optionsTitle": {
"message": "Ang mga pagpipilian",
"description": "Options title."
},
"showIconBadgeTitle": {
"message": "Ang naka-displey na ineksyon ay mabibilang sa imahe",
"description": "Show icon badge title."
},
"showIconBadgeDescription": {
"message": "Ipakita ang bilang ng mga injected na pinagmulan sa ekstensyon nang imahe.",
"description": "Show icon badge description."
},
"blockMissingTitle": {
"message": "Harangan ang mga kahilingan para sa mga nawawalang mapagkukunan",
"description": "Block requests for missing resources title."
},
"blockMissingDescription": {
"message": "Kanselahin ang kahilingan na intercepted kung ang mga kinakailangang mapagkukunan ay hindi available sa lokal.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle": {
"message": "Huwag paganahin ang prefetching link",
"description": "Disable prefetch title."
},
"disablePrefetchDescription": {
"message": "Pigilan ang mga kahilingan na hindi pinayagan mula sa pagkalat sa paghahatid ng mga network.",
"description": "Disable prefetch description."
},
"stripMetadataTitle": {
"message": "Iliston ang metadata mula sa mga pinayagan na kahilingan",
"description": "Strip metadata title."
},
"stripMetadataDescription": {
"message": "Burahin ang sensitibong datus mula sa mga pinahihintulutang kahilingan ng CDN para sa pinahusay na pagiging pribado nito.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle": {
"message": "Ibukod ang mga domain mula sa mga iinspeksyon",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription": {
"message": "Ipasok ang mga domain upang i-whitelist sila. Paghiwalayin ang maramihang mga entry na may tuldok kuwit (;).",
"description": "Whitelisted domains description."
},
"advancedLabel": {
"message": "Naka-usad",
"description": "Advanced label."
}
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ const Address = {
'ANY': '*://*/*',
'ANY_PATH': '/*',
'ANY_PROTOCOL': '*://',
'CHROME_EXTENSION': 'chrome-extension:',
'EXAMPLE': 'example.org',
'HTTP': 'http:',
'HTTPS': 'https:',
......@@ -33,6 +34,11 @@ const Header = {
'REFERER': 'Referer'
};
const MessageResponse = {
'ASYNCHRONOUS': true,
'SYNCHRONOUS': false
};
const Resource = {
'MAPPING_EXPRESSION': /\.map$/i,
'VERSION_EXPRESSION': /(?:\d{1,2}\.){1,3}\d{1,2}/,
......@@ -46,7 +52,8 @@ const Setting = {
'SHOW_ICON_BADGE': 'showIconBadge',
'SHOW_RELEASE_NOTES': 'showReleaseNotes',
'STRIP_METADATA': 'stripMetadata',
'WHITELISTED_DOMAINS': 'whitelistedDomains'
'WHITELISTED_DOMAINS': 'whitelistedDomains',
'XHR_TEST_DOMAIN': 'xhrTestDomain'
};
const WebRequest = {
......@@ -55,6 +62,10 @@ const WebRequest = {
'HEADERS': 'requestHeaders'
};
const WebRequestType = {
'XHR': 'xmlhttprequest'
};
const Whitelist = {
'TRIM_EXPRESSION': /^;+|;+$/g,
'VALUE_SEPARATOR': ';'
......
/**
* File Guard
* Belongs to Decentraleyes.
*
* @see https://github.com/Synzvato/decentraleyes/pull/258
*
* @author Thomas Rientjes
* @since 2018-05-17