Microsoft has acquired GitHub. Decentraleyes has left GitHub. Welcome to its new home!

To participate, please register, or sign in with an existing GitLab.com, Bitbucket, or GitHub account.

Past contributions on GitHub? Be sure to reclaim your Comments, Issues, and Pull Requests.

Verified Commit e9ccd3e2 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Update and refactor existing codebase

parent 52c9b40c
......@@ -17,7 +17,8 @@
"Setting": true,
"stateManager": true,
"WebRequest": true,
"Whitelist": true
"Whitelist": true,
"wrappers": true
},
"overrides": {
"files": [
......
......@@ -44,15 +44,15 @@
"description": "Disable prefetch title."
},
"disablePrefetchDescription": {
"message": "Prevent disallowed requests from leaking out to delivery networks.",
"message": "配信ネットワークに許可されていないリクエストの漏れから予防する。",
"description": "Disable prefetch description."
},
"stripMetadataTitle": {
"message": "Strip metadata from allowed requests",
"message": "許可されていたるリクエストからメタデータを取り除く",
"description": "Strip metadata title."
},
"stripMetadataDescription": {
"message": "Erase sensitive data from allowed CDN requests for improved privacy.",
"message": "プライバシー向上のために許可されたCDNリクエストから機密データを消去する。",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle": {
......
{
"extensionDescription": {
"message": "\"무료\"라는 미끼로 당신을 추적하는 대규모 CDN을 사용하지 않음으로써 개인 정보를 지킵니다.",
"description": "Extension description."
},
"disableProtectionTitle": {
"message": "이 사이트의 보호 비활성화",
"description": "Disable protection title."
},
"enableProtectionTitle": {
"message": "보호 활성화",
"description": "Enable protection title."
},
"amountInjectedTitle": {
"message": "로컬 리소스로 대체한 요청 횟수",
"description": "Amount injected title."
},
"amountInjectedDescription": {
"message": "Decentraleyes를 설치한 뒤, CDN에서 다운로드 하는 대신 로컬 자원을 사용한 횟수입니다.",
"description": "Amount injected description."
},
"optionsTitle": {
"message": "옵션",
"description": "Options title."
},
"showIconBadgeTitle": {
"message": "차단한 횟수를 아이콘에 표시",
"description": "Show icon badge title."
},
"showIconBadgeDescription": {
"message": "로컬 리소스로 대체한 요청 수를 확장 기능 아이콘에 표시합니다.",
"description": "Show icon badge description."
},
"blockMissingTitle": {
"message": "존재하지 않는 리소스에 대한 요청을 차단",
"description": "Block requests for missing resources title."
},
"blockMissingDescription": {
"message": "리소스를 로컬에서 가져올 수 없다면 리소스 요청을 취소합니다.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle": {
"message": "링크 프리페치를 비활성화",
"description": "Disable prefetch title."
},
"disablePrefetchDescription": {
"message": "허가되지 않은 요청이 전달 네트워크(DN)로 전송되는 것을 차단합니다.",
"description": "Disable prefetch description."
},
"stripMetadataTitle": {
"message": "허용된 요청에서 메타데이터를 제거",
"description": "Strip metadata title."
},
"stripMetadataDescription": {
"message": "프라이버시 보호를 위해 허가된 CDN 요청에서 민감한 데이터를 지웁니다.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle": {
"message": "Decentraleyes를 사용하지 않을 도메인",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription": {
"message": "화이트 리스트에 등록할 도메인을 입력하세요. 여러 개를 입력할 경우 세미콜론 (;) 을 이용해 구분합니다.",
"description": "Whitelisted domains description."
},
"advancedLabel": {
"message": "고급",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription":{
"message":"Beschermt tegen tracking via het \"gratis\", gecentraliseerd, verzorgen van content.",
"description":"Extension description."
"extensionDescription": {
"message": "Beschermt tegen tracking via het \"gratis\", gecentraliseerd, verzorgen van content.",
"description": "Extension description."
},
"disableProtectionTitle":{
"message":"Bescherming voor deze website uitschakelen",
"description":"Disable protection title."
"disableProtectionTitle": {
"message": "Bescherming voor deze website uitschakelen",
"description": "Disable protection title."
},
"enableProtectionTitle":{
"message":"Bescherming inschakelen",
"description":"Enable protection title."
"enableProtectionTitle": {
"message": "Bescherming inschakelen",
"description": "Enable protection title."
},
"amountInjectedTitle":{
"message":"Teller voor lokaal geïnjecteerde bestanden",
"description":"Amount injected title."
"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."
"amountInjectedDescription": {
"message": "Aantal lokale Content Delivery Network-bestandsinjecties sinds installatie.",
"description": "Amount injected description."
},
"optionsTitle":{
"message":"Opties",
"description":"Options title."
"optionsTitle": {
"message": "Opties",
"description": "Options title."
},
"showIconBadgeTitle":{
"message":"Getelde injecties op icoon weergeven",
"description":"Show icon badge title."
"showIconBadgeTitle": {
"message": "Getelde injecties op icoon weergeven",
"description": "Show icon badge title."
},
"showIconBadgeDescription":{
"message":"Toon het aantal geïnjecteerde bestanden op het extensie-icoon.",
"description":"Show icon badge description."
"showIconBadgeDescription": {
"message": "Toon het aantal geïnjecteerde bestanden op het extensie-icoon.",
"description": "Show icon badge description."
},
"blockMissingTitle":{
"message":"Verzoeken voor ontbrekende items blokkeren",
"description":"Block requests for missing resources title."
"blockMissingTitle": {
"message": "Verzoeken voor ontbrekende items blokkeren",
"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."
"blockMissingDescription": {
"message": "Annuleer een onderschept verzoek wanneer het bestand niet lokaal beschikbaar is.",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle":{
"message":"Link prefetching uitschakelen",
"description":"Disable prefetch title."
"disablePrefetchTitle": {
"message": "Link prefetching uitschakelen",
"description": "Disable prefetch title."
},
"disablePrefetchDescription":{
"message":"Voorkom dat geweigerde verzoeken naar afleveringsnetwerken uitlekken.",
"description":"Disable prefetch description."
"disablePrefetchDescription": {
"message": "Voorkom dat geweigerde verzoeken naar afleveringsnetwerken uitlekken.",
"description": "Disable prefetch description."
},
"stripMetadataTitle":{
"message":"Metadata uit toegestane verzoeken verwijderen",
"description":"Strip metadata title."
"stripMetadataTitle": {
"message": "Metadata uit toegestane verzoeken verwijderen",
"description": "Strip metadata title."
},
"stripMetadataDescription":{
"message":"Wis gevoelige gegevens uit toegestane CDN-verzoeken voor verbeterde privacy.",
"description":"Strip metadata description."
"stripMetadataDescription": {
"message": "Wis gevoelige gegevens uit toegestane CDN-verzoeken voor verbeterde privacy.",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle":{
"message":"Sluit domeinen uit van inspecties",
"description":"Whitelisted domains title."
"whitelistedDomainsTitle": {
"message": "Sluit domeinen uit van inspecties",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription":{
"message":"Voer de te negeren domeinen in. Scheid de waarden met puntkomma's (;).",
"description":"Whitelisted domains description."
"whitelistedDomainsDescription": {
"message": "Voer de te negeren domeinen in. Scheid de waarden met puntkomma's (;).",
"description": "Whitelisted domains description."
},
"advancedLabel":{
"message":"Geavanceerd",
"description":"Advanced label."
"advancedLabel": {
"message": "Geavanceerd",
"description": "Advanced label."
}
}
\ No newline at end of file
{
"extensionDescription":{
"message":"保護您不受「免費」、中心化的內容傳遞網路(CDN)的追蹤。",
"description":"Extension description."
"extensionDescription": {
"message": "保護您不受「免費」、中心化的內容傳遞網路(CDN)的追蹤。",
"description": "Extension description."
},
"disableProtectionTitle":{
"message":"為此網站停用保護",
"description":"Disable protection title."
"disableProtectionTitle": {
"message": "為此網站停用保護",
"description": "Disable protection title."
},
"enableProtectionTitle":{
"message":"啟用保護",
"description":"Enable protection title."
"enableProtectionTitle": {
"message": "啟用保護",
"description": "Enable protection title."
},
"amountInjectedTitle":{
"message":"由本機提供的資源計數器",
"description":"Amount injected title."
"amountInjectedTitle": {
"message": "由本機提供的資源計數器",
"description": "Amount injected title."
},
"amountInjectedDescription":{
"message":"安裝以來,由本機檔案所取代的 CDN 資源數量。",
"description":"Amount injected description."
"amountInjectedDescription": {
"message": "安裝以來,由本機檔案所取代的 CDN 資源數量。",
"description": "Amount injected description."
},
"optionsTitle":{
"message":"選項",
"description":"Options title."
"optionsTitle": {
"message": "選項",
"description": "Options title."
},
"showIconBadgeTitle":{
"message":"在圖示上顯示被取代的資源數量",
"description":"Show icon badge title."
"showIconBadgeTitle": {
"message": "在圖示上顯示被取代的資源數量",
"description": "Show icon badge title."
},
"showIconBadgeDescription":{
"message":"在擴充套件圖示上,顯示被取代的資源數量。",
"description":"Show icon badge description."
"showIconBadgeDescription": {
"message": "在擴充套件圖示上,顯示被取代的資源數量。",
"description": "Show icon badge description."
},
"blockMissingTitle":{
"message":"封鎖缺少資源時的連線請求",
"description":"Block requests for missing resources title."
"blockMissingTitle": {
"message": "封鎖缺少資源時的連線請求",
"description": "Block requests for missing resources title."
},
"blockMissingDescription":{
"message":"若本機沒有所請求的資源,就取消該請求。",
"description":"Block requests for missing resources description."
"blockMissingDescription": {
"message": "若本機沒有所請求的資源,就取消該請求。",
"description": "Block requests for missing resources description."
},
"disablePrefetchTitle":{
"message":"停用連結預讀功能",
"description":"Disable prefetch title."
"disablePrefetchTitle": {
"message": "停用連結預讀功能",
"description": "Disable prefetch title."
},
"disablePrefetchDescription":{
"message":"防止發出不被允許的請求到 CDN 網路。",
"description":"Disable prefetch description."
"disablePrefetchDescription": {
"message": "防止發出不被允許的請求到 CDN 網路。",
"description": "Disable prefetch description."
},
"stripMetadataTitle":{
"message":"移除放行請求當中的後設資料",
"description":"Strip metadata title."
"stripMetadataTitle": {
"message": "移除放行請求當中的後設資料",
"description": "Strip metadata title."
},
"stripMetadataDescription":{
"message":"清除放行的 CDN 請求當中的敏感資料,以保護隱私權。",
"description":"Strip metadata description."
"stripMetadataDescription": {
"message": "清除放行的 CDN 請求當中的敏感資料,以保護隱私權。",
"description": "Strip metadata description."
},
"whitelistedDomainsTitle":{
"message":"要排除檢查的網域",
"description":"Whitelisted domains title."
"whitelistedDomainsTitle": {
"message": "要排除檢查的網域",
"description": "Whitelisted domains title."
},
"whitelistedDomainsDescription":{
"message":"輸入網域即可將其加入白名單。使用分號(;)分隔多個網域。",
"description":"Whitelisted domains description."
"whitelistedDomainsDescription": {
"message": "輸入網域即可將其加入白名單。使用分號(;)分隔多個網域。",
"description": "Whitelisted domains description."
},
"advancedLabel":{
"message":"進階",
"description":"Advanced label."
"advancedLabel": {
"message": "進階",
"description": "Advanced label."
}
}
\ No newline at end of file
......@@ -21,12 +21,10 @@ const Address = {
'ANY': '*://*/*',
'ANY_PATH': '/*',
'ANY_PROTOCOL': '*://',
'DOMAIN_EXPRESSION': /:\/\/(.[^/]+)(.*)/,
'EXAMPLE': 'example.org',
'HTTP_EXPRESSION': /^http?:\/\//,
'HTTPS': 'https://',
'WWW_PREFIX': 'www.',
'WWW_PREFIX_LENGTH': 4
'HTTP': 'http:',
'HTTPS': 'https:',
'WWW_PREFIX': 'www.'
};
const Resource = {
......
......@@ -36,19 +36,21 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
};
}
try {
tabDomain = tab.url.match(Address.DOMAIN_EXPRESSION)[1];
tabDomain = requestAnalyzer._normalizeDomain(tabDomain);
} catch (exception) {
tabDomain = helpers.extractDomainFromUrl(tab.url, true);
if (tabDomain === null) {
tabDomain = Address.EXAMPLE;
}
// Temporary list of undetectable tainted domains.
let undetectableTaintedDomains = {
'10fastfingers.com': true,
'cdnjs.com': true,
'dropbox.com': true,
'glowing-bear.org': true,
'minigames.mail.ru': true,
'miniquadtestbench.com': true,
'qwertee.com': true,
'report-uri.io': true,
'scotthelme.co.uk': true,
'securityheaders.io': true,
......@@ -98,12 +100,15 @@ interceptor._handleMissingCandidate = function (requestUrl) {
};
}
if (requestUrl.match(Address.HTTP_EXPRESSION)) {
let requestUrlSegments = new URL(requestUrl);
if (requestUrlSegments.protocol === Address.HTTP) {
let secureRequestUrl = requestUrl.replace(Address.HTTP_EXPRESSION, Address.HTTPS);
requestUrlSegments.protocol = Address.HTTPS;
requestUrl = requestUrlSegments.toString();
return {
'redirectUrl': secureRequestUrl
'redirectUrl': requestUrl
};
} else {
......
......@@ -90,6 +90,6 @@ main._showReleaseNotes = function (details) {
chrome.runtime.onInstalled.addListener(main._showReleaseNotes);
main._initializeOptions();
chrome.browserAction.setBadgeBackgroundColor({
wrappers.setBadgeBackgroundColor({
'color': [74, 130, 108, 255]
});
......@@ -25,15 +25,17 @@ var requestAnalyzer = {};
requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
let initiatorHost;
let initiatorDomain, isWhitelisted;
try {
initiatorHost = tabDetails.url.match(Address.DOMAIN_EXPRESSION)[1];
} catch (exception) {
initiatorHost = Address.EXAMPLE;
initiatorDomain = helpers.extractDomainFromUrl(tabDetails.url, true);
if (initiatorDomain === null) {
initiatorDomain = Address.EXAMPLE;
}
if (initiatorHost && requestAnalyzer.whitelistedDomains[requestAnalyzer._normalizeDomain(initiatorHost)]) {
isWhitelisted = requestAnalyzer.whitelistedDomains[initiatorDomain];
if (isWhitelisted) {
return false;
}
......@@ -43,10 +45,12 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
requestAnalyzer.getLocalTarget = function (requestDetails) {
let destinationHost, destinationPath, hostMappings, basePath, resourceMappings;
let destinationUrl, destinationHost, destinationPath, hostMappings, basePath, resourceMappings;
destinationUrl = new URL(requestDetails.url);
destinationHost = requestDetails.url.match(Address.DOMAIN_EXPRESSION)[1];
destinationPath = requestDetails.url.match(Address.DOMAIN_EXPRESSION)[2];
destinationHost = destinationUrl.host;
destinationPath = destinationUrl.pathname;
// Use the proper mappings for the targeted host.
hostMappings = mappings[destinationHost];
......@@ -122,17 +126,6 @@ requestAnalyzer._applyWhitelistedDomains = function () {
});
};
requestAnalyzer._normalizeDomain = function (domain) {
domain = domain.toLowerCase().trim();
if (domain.startsWith(Address.WWW_PREFIX)) {
domain = domain.slice(Address.WWW_PREFIX_LENGTH);
}
return domain;
};
/**
* Initializations
*/
......
......@@ -37,14 +37,14 @@ stateManager.registerInjection = function (tabIdentifier, injection) {
if (injectionCount > 0) {
chrome.browserAction.setBadgeText({
wrappers.setBadgeText({
'tabId': tabIdentifier,
'text': injectionCount.toString()
});
} else {
chrome.browserAction.setBadgeText({
wrappers.setBadgeText({
'tabId': tabIdentifier,
'text': ''
});
......@@ -137,7 +137,7 @@ stateManager._updateTab = function (details) {
if (stateManager.showIconBadge === true) {
chrome.browserAction.setBadgeText({
wrappers.setBadgeText({
'tabId': tabIdentifier,
'text': ''
});
......@@ -199,7 +199,7 @@ stateManager._handleStorageChanged = function (changes) {
stateManager._removeIconBadgeFromTab = function (tab) {
chrome.browserAction.setBadgeText({
wrappers.setBadgeText({
'tabId': tab.id,
'text': ''
});
......
......@@ -22,6 +22,7 @@
"is": "is"
"it": "it"
"ja": "ja"
"ko": "ko"
"nl": "nl"
"pl": "pl"
"ro": "ro"
......
This diff is collapsed.
This diff is collapsed.
/*!
* Font Awesome Free 5.0.1 by @fontawesome - http://fontawesome.com
* License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
!function(){"use strict";function c(c){"function"==typeof m.hooks.addPack?m.hooks.addPack(c,a):m.styles[c]=s({},m.styles[c]||{},a)}var h={};try{"undefined"!=typeof window&&(h=window)}catch(c){}var v=(h.navigator||{}).userAgent,l=void 0===v?"":v,z=h,H=(~l.indexOf("MSIE")||l.indexOf("Trident/"),[1,2,3,4,5,6,7,8,9,10]),M=H.concat([11,12,13,14,15,16,17,18,19,20]),a=(["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(H.map(function(c){return c+"x"})).concat(M.map(function(c){return"w-"+c})),{btc:[384,512,[],"f15a","M310.204 242.638c27.73-14.18 45.377-39.39 41.28-81.3-5.358-57.351-52.458-76.573-114.85-81.929V0h-48.528v77.203c-12.605 0-25.525.315-38.444.63V0h-48.528v79.409c-17.842.539-38.622.276-97.37 0v51.678c38.314-.678 58.417-3.14 63.023 21.427v217.429c-2.925 19.492-18.524 16.685-53.255 16.071L3.765 443.68c88.481 0 97.37.315 97.37.315V512h48.528v-67.06c13.234.315 26.154.315 38.444.315V512h48.528v-68.005c81.299-4.412 135.647-24.894 142.895-101.467 5.671-61.446-23.32-88.862-69.326-99.89zM150.608 134.553c27.415 0 113.126-8.507 113.126 48.528 0 54.515-85.71 48.212-113.126 48.212v-96.74zm0 251.776V279.821c32.772 0 133.127-9.138 133.127 53.255-.001 60.186-100.355 53.253-133.127 53.253z"],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"],cube:[512,512,[],"f1b2","M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"],"exclamation-triangle":[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"],"github-alt":[480,512,[],"f113","M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"],globe:[512,512,[],"f0ac","M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"],monero:[496,512,[],"f3d0","M352 384h108.4C417 455.9 338.1 504 248 504S79 455.9 35.6 384H144V256.2L248 361l104-105v128zM88 336V128l159.4 159.4L408 128v208h74.8c8.5-25.1 13.2-52 13.2-80C496 119 385 8 248 8S0 119 0 256c0 28 4.6 54.9 13.2 80H88z"],"power-off":[512,512,[],"f011","M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"],"shield-alt":[512,512,[],"f3ed","M496 128c0 221.282-135.934 344.645-221.539 380.308a48 48 0 0 1-36.923 0C130.495 463.713 16 326.487 16 128a48 48 0 0 1 29.539-44.308l192-80a48 48 0 0 1 36.923 0l192 80A48 48 0 0 1 496 128zM256 446.313l.066.034c93.735-46.689 172.497-156.308 175.817-307.729L256 65.333v380.98z"],"window-restore":[512,512,[],"f2d2","M512 48v288c0 26.5-21.5 48-48 48h-48V176c0-44.1-35.9-80-80-80H128V48c0-26.5 21.5-48 48-48h288c26.5 0 48 21.5 48 48zM384 176v288c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V176c0-26.5 21.5-48 48-48h288c26.5 0 48 21.5 48 48zm-68 28c0-6.6-5.4-12-12-12H76c-6.6 0-12 5.4-12 12v52h252v-52z"]}),V=z||{};V.___FONT_AWESOME___||(V.___FONT_AWESOME___={}),V.___FONT_AWESOME___.styles||(V.___FONT_AWESOME___.styles={}),V.___FONT_AWESOME___.hooks||(V.___FONT_AWESOME___.hooks={}),V.___FONT_AWESOME___.shims||(V.___FONT_AWESOME___.shims=[]);var m=V.___FONT_AWESOME___,s=Object.assign||function(c){for(var h=1;h<arguments.length;h++){var v=arguments[h];for(var l in v)Object.prototype.hasOwnProperty.call(v,l)&&(c[l]=v[l])}return c};!function(c){try{c()}catch(c){}}(function(){c("fai"),c("fa")})}();
!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={browser:[512,512,[],"f37e","M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM128 148c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm320 0c0 6.6-5.4 12-12 12H188c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h248c6.6 0 12 5.4 12 12v40z"],btc:[384,512,[],"f15a","M310.204 242.638c27.73-14.18 45.377-39.39 41.28-81.3-5.358-57.351-52.458-76.573-114.85-81.929V0h-48.528v77.203c-12.605 0-25.525.315-38.444.63V0h-48.528v79.409c-17.842.539-38.622.276-97.37 0v51.678c38.314-.678 58.417-3.14 63.023 21.427v217.429c-2.925 19.492-18.524 16.685-53.255 16.071L3.765 443.68c88.481 0 97.37.315 97.37.315V512h48.528v-67.06c13.234.315 26.154.315 38.444.315V512h48.528v-68.005c81.299-4.412 135.647-24.894 142.895-101.467 5.671-61.446-23.32-88.862-69.326-99.89zM150.608 134.553c27.415 0 113.126-8.507 113.126 48.528 0 54.515-85.71 48.212-113.126 48.212v-96.74zm0 251.776V279.821c32.772 0 133.127-9.138 133.127 53.255-.001 60.186-100.355 53.253-133.127 53.253z"],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"],cube:[512,512,[],"f1b2","M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"],"exclamation-triangle":[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"],"github-alt":[480,512,[],"f113","M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"],monero:[496,512,[],"f3d0","M352 384h108.4C417 455.9 338.1 504 248 504S79 455.9 35.6 384H144V256.2L248 361l104-105v128zM88 336V128l159.4 159.4L408 128v208h74.8c8.5-25.1 13.2-52 13.2-80C496 119 385 8 248 8S0 119 0 256c0 28 4.6 54.9 13.2 80H88z"],"power-off":[512,512,[],"f011","M400 54.1c63 45 104 118.6 104 201.9 0 136.8-110.8 247.7-247.5 248C120 504.3 8.2 393 8 256.4 7.9 173.1 48.9 99.3 111.8 54.2c11.7-8.3 28-4.8 35 7.7L162.6 90c5.9 10.5 3.1 23.8-6.6 31-41.5 30.8-68 79.6-68 134.9-.1 92.3 74.5 168.1 168 168.1 91.6 0 168.6-74.2 168-169.1-.3-51.8-24.7-101.8-68.1-134-9.7-7.2-12.4-20.5-6.5-30.9l15.8-28.1c7-12.4 23.2-16.1 34.8-7.8zM296 264V24c0-13.3-10.7-24-24-24h-32c-13.3 0-24 10.7-24 24v240c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24z"],globe:[512,512,[],"f0ac","M364.215 192h131.43c5.439 20.419 8.354 41.868 8.354 64s-2.915 43.581-8.354 64h-131.43c5.154-43.049 4.939-86.746 0-128zM185.214 352c10.678 53.68 33.173 112.514 70.125 151.992.221.001.44.008.661.008s.44-.008.661-.008c37.012-39.543 59.467-98.414 70.125-151.992H185.214zm174.13-192h125.385C452.802 84.024 384.128 27.305 300.95 12.075c30.238 43.12 48.821 96.332 58.394 147.925zm-27.35 32H180.006c-5.339 41.914-5.345 86.037 0 128h151.989c5.339-41.915 5.345-86.037-.001-128zM152.656 352H27.271c31.926 75.976 100.6 132.695 183.778 147.925-30.246-43.136-48.823-96.35-58.393-147.925zm206.688 0c-9.575 51.605-28.163 104.814-58.394 147.925 83.178-15.23 151.852-71.949 183.778-147.925H359.344zm-32.558-192c-10.678-53.68-33.174-112.514-70.125-151.992-.221 0-.44-.008-.661-.008s-.44.008-.661.008C218.327 47.551 195.872 106.422 185.214 160h141.572zM16.355 192C10.915 212.419 8 233.868 8 256s2.915 43.581 8.355 64h131.43c-4.939-41.254-5.154-84.951 0-128H16.355zm136.301-32c9.575-51.602 28.161-104.81 58.394-147.925C127.872 27.305 59.198 84.024 27.271 160h125.385z"],"shield-alt":[512,512,[],"f3ca","M496 128c0 221.282-135.934 344.645-221.539 380.308a48 48 0 0 1-36.923 0C130.495 463.713 16 326.487 16 128a48 48 0 0 1 29.539-44.308l192-80a48 48 0 0 1 36.923 0l192 80A48 48 0 0 1 496 128zM256 446.313l.066.034c93.735-46.689 172.497-156.308 175.817-307.729L256 65.333v380.98z"]},v=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,a=function(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de","5"===Object.getOwnPropertyNames(c)[0])return!1;for(var l={},h=0;h<10;h++)l["_"+String.fromCharCode(h)]=h;if("0123456789"!==Object.getOwnPropertyNames(l).map(function(c){return l[c]}).join(""))return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(c){v[c]=c}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},v)).join("")}catch(c){return!1}}()?Object.assign:function(l,h){for(var a,M,V=c(l),f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var e in a)z.call(a,e)&&(V[e]=a[e]);if(v){M=v(a);for(var m=0;m<M.length;m++)H.call(a,M[m])&&(V[M[m]]=a[M[m]])}}return V},M=a({},{namespace:"___FONT_AWESOME___",familyPrefix:"fa",replacementClass:"svg-inline--fa",autoReplaceSvg:!0,autoA11y:!0,observeMutations:!0,keepOriginalSource:!0,measurePerformance:!1},window.FontAwesomeConfig||{});M.autoReplaceSvg||(M.observeMutations=!1),window[M.namespace]||(window[M.namespace]={}),window[M.namespace].packs||(window[M.namespace].packs={}),window[M.namespace].hooks||(window[M.namespace].hooks={}),window[M.namespace].shims||(window[M.namespace].shims=[]);var V=window[M.namespace];l("fas"),l("fa")}();
......@@ -20,7 +20,7 @@
var helpers = {};
/**
* Public Functions
* Public Methods
*/
helpers.insertI18nContentIntoDocument = function (document) {
......@@ -62,8 +62,8 @@ helpers.languageIsFullySupported = function (language) {
languageSupported = false;
supportedLanguages = [
'ar', 'bg', 'zh-CN', 'zh-TW', 'da', 'nl', 'en', 'et', 'fi', 'fr', 'de',
'el', 'is', 'id', 'pl', 'pt-PT', 'ro', 'ru', 'es', 'sv', 'tr'
'ar', 'bg', 'zh', 'da', 'nl', 'en', 'et', 'fi', 'fr', 'de', 'el', 'is',
'id', 'it', 'ja', 'ko', 'pl', 'pt', 'ro', 'ru', 'es', 'sv', 'tr'
];
for (let supportedLanguage of supportedLanguages) {
......@@ -76,6 +76,48 @@ helpers.languageIsFullySupported = function (language) {
return languageSupported;
};
helpers.normalizeDomain = function (domain) {
domain = domain.toLowerCase().trim();
if (domain.startsWith(Address.WWW_PREFIX)) {
domain = domain.slice(Address.WWW_PREFIX.length);
}
return domain;
};
helpers.extractDomainFromUrl = function (url, normalize) {
let extractedDomain;
try {
extractedDomain = new URL(url).host;
} catch (exception) {
extractedDomain = null;
}
if (extractedDomain === '') {