Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Synzvato/decentraleyes
  • gkrishnaks/decentraleyes
  • ExE-Boss/decentraleyes
  • whtsky/decentraleyes
  • grtgarrett/decentraleyes
  • An_dz/decentraleyes
  • Alaska/decentraleyes
  • finn/decentraleyes
  • klippy/decentraleyes
9 results
Show changes
Showing
with 1783 additions and 1301 deletions
/**
* Global Constants
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-10-27
* @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/.
*/
/**
* Public Constants
*/
const Address = {
'ANY': '*://*/*',
'ANY_PATH': '/*',
'ANY_PROTOCOL': '*://',
'CHROME': 'chrome:',
'DECENTRALEYES': 'decentraleyes.org',
'EXAMPLE': 'example.org',
'HTTP': 'http:',
'HTTPS': 'https:',
'WWW_PREFIX': 'www.'
};
const Environment = {
'STABLE': 'stable',
'STAGING': 'staging'
};
const Header = {
'COOKIE': 'Cookie',
'ORIGIN': 'Origin',
'REFERER': 'Referer'
};
const MessageResponse = {
'ASYNCHRONOUS': true,
'SYNCHRONOUS': false
};
const Resource = {
'MAPPING_EXPRESSION': /\.map$/i,
'VERSION_EXPRESSION': /(?:\d{1,2}\.){1,3}\d{1,2}/,
'VERSION_PLACEHOLDER': '{version}'
};
const SessionItem = {
'TAB_CONTEXTS': 'tabContexts'
};
const TabContext = {
'IDENTIFIER': 'identifier',
'INJECTIONS': 'injections',
'URL': 'url'
};
const Setting = {
'BLOCK_MISSING': 'blockMissing',
'DISABLE_PREFETCH': 'disablePrefetch',
'ENFORCE_STAGING': 'enforceStaging',
'SHOW_ICON_BADGE': 'showIconBadge',
'SHOW_RELEASE_NOTES': 'showReleaseNotes',
'STRIP_METADATA': 'stripMetadata',
'WHITELISTED_DOMAINS': 'whitelistedDomains',
'XHR_TEST_DOMAIN': 'xhrTestDomain'
};
const ComputedSetting = {
'ENVIRONMENT_NAME': 'environmentName'
};
const Statistic = {
'AMOUNT_INJECTED': 'amountInjected',
'AMOUNT_SANITIZED': 'amountSanitized',
'AMOUNT_BLOCKED': 'amountBlocked'
};
const WebRequest = {
'GET': 'GET',
'BLOCKING': 'blocking',
'HEADERS': 'requestHeaders',
'MAIN_FRAME_ID': 0
};
const WebRequestType = {
'MAIN_FRAME': 'main_frame',
'XHR': 'xmlhttprequest'
};
/**
* Exports
*/
export default {
Address,
Environment,
Header,
MessageResponse,
Resource,
SessionItem,
TabContext,
Setting,
ComputedSetting,
Statistic,
WebRequest,
WebRequestType
};
/**
* Domain Exceptions
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-10-08 (originally "tainted")
* @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/.
*/
/**
* Public Constants
*/
const literal = {
'MTBmYXN0ZmluZ2Vycy5jb20=': true,
'Y291cmllci10cmlidW5lLmNvbQ==': true,
'Y29kZS53b3JsZA==': true,
'Y29sdW1iaWF0cmlidW5lLmNvbQ==': true,
'Y29sdW1iaWFkYWlseWhlcmFsZC5jb20=': true,
'Y2FtYnJpZGdlY2hyb24uY29t': true,
'Y2FudG9uZGFpbHlsZWRnZXIuY29t': true,
'Y2FudG9ucmVwLmNvbQ==': true,
'Y2FwZWNvZHRpbWVzLmNvbQ==': true,
'Y2FwdGNoYS5yZWFsdGVrLmNvbQ==': true,
'Y2FybWl0aW1lcy5jb20=': true,
'Y2RuanMuY29t': true,
'Y2VsbG1hcHBlci5uZXQ=': true,
'Y2hhcmxlc3RvbmV4cHJlc3MuY29t': true,
'Y2hlYm95Z2FubmV3cy5jb20=': true,
'Y2hpZWZ0YWluLmNvbQ==': true,
'Y2hpbGxpY290aGV0aW1lc2J1bGxldGluLmNvbQ==': true,
'Y2hpbGxpY290aGVuZXdzLmNvbQ==': true,
'Y2hpcGxleXBhcGVyLmNvbQ==': true,
'Y2hyb25pY2xlLWV4cHJlc3MuY29t': true,
'Y2lyY3VpdGxhYi5jb20=': true,
'Y2pvbmxpbmUuY29t': true,
'Y3JlYXRpdmVjb21tb25zLm9yZw==': true,
'Y3Jlc3R2aWV3YnVsbGV0aW4uY29t': true,
'Y3Jvb2tzdG9udGltZXMuY29t': true,
'Y3Nnb3N0YXRzLmdn': true,
'YW10cmliLmNvbQ==': true,
'YW1hcmlsbG8uY29t': true,
'YW1lc3RyaWIuY29t': true,
'YW55dmFuLmNvbQ==': true,
'YWNrLm5ldA==': true,
'YWR2b2NhdGVwcmVzcy5jb20=': true,
'YWRlbG5ld3MuY29t': true,
'YWRoZXJlbnQubGF2aWxsZWF2ZWxvLm9yZw==': true,
'YWxlZG90aW1lc3JlY29yZC5jb20=': true,
'YWxpY2V0eC5jb20=': true,
'YXBhbGFjaHRpbWVzLmNvbQ==': true,
'YXJkbW9yZWl0ZS5jb20=': true,
'YXVndXN0YWNocm9uaWNsZS5jb20=': true,
'YXVyb3JhYWR2ZXJ0aXNlci5uZXQ=': true,
'Ym9vbmV2aWxsZWRlbW9jcmF0LmNvbQ==': true,
'Ym9vbnZpbGxlZGFpbHluZXdzLmNvbQ==': true,
'YmFybmVzdmlsbGUtZW50ZXJwcmlzZS5jb20=': true,
'YmFybnN0YWJsZXBhdHJpb3QuY29t': true,
'YmFzaXNzZXRleGNoYW5nZS5vcmc=': true,
'YmNkZW1vY3JhdG9ubGluZS5jb20=': true,
'YmVhdXJlZ2FyZGRhaWx5bmV3cy5uZXQ=': true,
'Ymx1ZXJpZGdlbm93LmNvbQ==': true,
'Ymx1ZmZ0b250b2RheS5jb20=': true,
'YmxvZy5kYXRhd3JhcHBlci5kZQ==': true,
'YnIuc3BhbmtiYW5nLmNvbQ==': true,
'YnJvd253b29kdHguY29t': true,
'YnV0bGVyY291bnR5dGltZXNnYXpldHRlLmNvbQ==': true,
'YnVja3Njb3VudHljb3VyaWVydGltZXMuY29t': true,
'YnVuZGxlb2Zob2xkaW5nLmNvbQ==': true,
'YnVybGluZ3RvbmNvdW50eXRpbWVzLmNvbQ==': true,
'Z291cHN0YXRlLmNvbQ==': true,
'Z29lcmllLmNvbQ==': true,
'Z2F6ZXRhZG9wb3ZvLmNvbS5icg==': true,
'Z2Fkc2RlbnRpbWVzLmNvbQ==': true,
'Z2FpbmVzdmlsbGUuY29t': true,
'Z2FsZXNidXJnLmNvbQ==': true,
'Z2FsdmFuZXdzLmNvbQ==': true,
'Z2FzdG9uZ2F6ZXR0ZS5jb20=': true,
'Z2N0ZWxlZ3JhbS5jb20=': true,
'Z2R0Lm9xbGYuZ291di5xYy5jYQ==': true,
'Z2VuZXNlb3JlcHVibGljLmNvbQ==': true,
'Z2xvYmV0cm90dGVyLmRl': true,
'Z2xvd2luZy1iZWFyLm9yZw==': true,
'Z3JhbmRsYWtlbmV3cy5jb20=': true,
'Z3Jhbml0ZWZhbGxzbmV3cy5jb20=': true,
'Z3JlZW53b29kZGVtb2NyYXQuY29t': true,
'ZG92ZXJwb3N0LmNvbQ==': true,
'ZG9jcy5zZXJ2aWNlbm93LmNvbQ==': true,
'ZG9kZ2VnbG9iZS5jb20=': true,
'ZG9uYWxkc29udmlsbGVjaGllZi5jb20=': true,
'ZGFpbHktamVmZi5jb20=': true,
'ZGFpbHljb21ldC5jb20=': true,
'ZGFpbHljb21tZXJjaWFsLmNvbQ==': true,
'ZGFuc3ZpbGxlb25saW5lLmNvbQ==': true,
'ZGUuc2hhcmtvb24uY29t': true,
'ZGUuc3BhbmtiYW5nLmNvbQ==': true,
'ZGV2aWxzbGFrZWpvdXJuYWwuY29t': true,
'ZGlzcGF0Y2guY29t': true,
'ZHJvcGJveC5jb20=': true,
'ZW4uc2hhcmtvb24uY29t': true,
'ZW50ZXJwcmlzZW5ld3MuY29t': true,
'ZWFzdHBlb3JpYXRpbWVzY291cmllci5jb20=': true,
'ZWNoby1uZXdzLmNvLnVr': true,
'ZWNoby1waWxvdC5jb20=': true,
'ZWRpbmJ1cmdyZXZpZXcuY29t': true,
'ZWxsd29vZGNpdHlsZWRnZXIuY29t': true,
'ZXBleS5jb20=': true,
'ZXMuc2hhcmtvb24uY29t': true,
'ZXMuc3BhbmtiYW5nLmNvbQ==': true,
'ZXZvaWNlLmNvbQ==': true,
'ZXhhbWluZXItZW50ZXJwcmlzZS5jb20=': true,
'ZXhhbWluZXIubmV0': true,
'Zm93bGVydHJpYnVuZS5jb20=': true,
'Zm9zdGVycy5jb20=': true,
'ZmF5b2JzZXJ2ZXIuY29t': true,
'ZnIuc2hhcmtvb24uY29t': true,
'ZnIuc3BhbmtiYW5nLmNvbQ==': true,
'ZnJlZWJ1c3kuaW8=': true,
'a28uc2hhcmtvb24uY29t': true,
'a2luc3Rvbi5jb20=': true,
'a2lvd2Fjb3VudHlzaWduYWwuY29t': true,
'a2lya3N2aWxsZWRhaWx5ZXhwcmVzcy5jb20=': true,
'aG91bWF0b2RheS5jb20=': true,
'aG9ja2Vzc2luY29tbXVuaXR5bmV3cy5jb20=': true,
'aG9sbGFuZHNlbnRpbmVsLmNvbQ==': true,
'aGF2ZW5ld3MuY29t': true,
'aGFtYnVyZ3JlcG9ydGVyLmNvbQ==': true,
'aGFubmliYWwubmV0': true,
'aGRuZXdzLm5ldA==': true,
'aGVsZW5hLWFya2Fuc2FzLmNvbQ==': true,
'aGVyYWxkZGVtb2NyYXQuY29t': true,
'aGVyYWxkbmV3cy5jb20=': true,
'aGVyYWxkdHJpYnVuZS5jb20=': true,
'aGlsbHNkYWxlLm5ldA==': true,
'aHN2dm9pY2UuY29t': true,
'aHV0Y2huZXdzLmNvbQ==': true,
'aW4uc3BhbmtiYW5nLmNvbQ==': true,
'aW5kZW9ubGluZS5jb20=': true,
'aWNvLm9yZy51aw==': true,
'aWQuc3BhbmtiYW5nLmNvbQ==': true,
'aWRlbnRpLmNh': true,
'aXQuc2hhcmtvb24uY29t': true,
'aXQuc3BhbmtiYW5nLmNvbQ==': true,
'am91cm5hbGRlbW9jcmF0LmNvbQ==': true,
'am91cm5hbHN0YW5kYXJkLmNvbQ==': true,
'am95ZnVsbm9pc2VyZWNvcmRpbmdzLmNvbQ==': true,
'amEuc2hhcmtvb24uY29t': true,
'amFja3Nvbm5ld3NwYXBlcnMuY29t': true,
'amFja3NvbnZpbGxlLmNvbQ==': true,
'amRuZXdzLmNvbQ==': true,
'anAuc3BhbmtiYW5nLmNvbQ==': true,
'b253ZWxvLmNvbQ==': true,
'b25saW5lYXRoZW5zLmNvbQ==': true,
'b2FrcmlkZ2VyLmNvbQ==': true,
'b2NhbGEuY29t': true,
'b2hpby5jb20=': true,
'b2xuZXlkYWlseW1haWwuY29t': true,
'b3Bhdm90ZS5jb20=': true,
'b3BlbmRhdGEuY2JzLm5s': true,
'b3BlbndlYXRoZXJtYXAub3Jn': true,
'b3J6ZXN6ZS5jb20ucGw=': true,
'b3Jpb25nYXpldHRlLmNvbQ==': true,
'b3R0YXdhaGVyYWxkLmNvbQ==': true,
'bGEuc3BhbmtiYW5nLmNvbQ==': true,
'bGF6aXNrYS5jb20ucGw=': true,
'bGFiZG9vci5jb20=': true,
'bGFqdW50YXRyaWJ1bmVkZW1vY3JhdC5jb20=': true,
'bGFrZW5ld3NvbmxpbmUuY29t': true,
'bGVhdmVud29ydGh0aW1lcy5jb20=': true,
'bGVlc3ZpbGxlZGFpbHlsZWFkZXIuY29t': true,
'bGVtb24tYWlkLmRl': true,
'bGVuY29ubmVjdC5jb20=': true,
'bGVvbWluc3RlcmNoYW1wLmNvbQ==': true,
'bGluY29sbmNvdXJpZXIuY29t': true,
'bGlua2Jvc3RvbmhvbWVzLmNvbQ==': true,
'bGlubmNvdW50eWxlYWRlci5jb20=': true,
'bHViYm9ja29ubGluZS5jb20=': true,
'bS1jZS5wbA==': true,
'bW9iZXJseW1vbml0b3IuY29t': true,
'bW9qY2hvcnpvdy5wbA==': true,
'bW9qYnl0b20ucGw=': true,
'bW9qZWdsaXdpY2UucGw=': true,
'bW9qZWthdG93aWNlLnBs': true,
'bW9qZXR5Y2h5LnBs': true,
'bW9qbWlrb2xvdy5wbA==': true,
'bW9ucm9lY29wb3N0LmNvbQ==': true,
'bW9ucm9lbmV3cy5jb20=': true,
'bW9udGVuZXdzLmNvbQ==': true,
'bW9ybmluZ3N1bi5uZXQ=': true,
'bW9ydG9udGltZXNuZXdzLmNvbQ==': true,
'bW9zY293dmlsbGFnZXIuY29t': true,
'bWFudWFsc2xpYi5jb20=': true,
'bWNkb25vdWdodm9pY2UuY29t': true,
'bWNwaGVyc29uc2VudGluZWwuY29t': true,
'bWV0cm93ZXN0ZGFpbHluZXdzLmNvbQ==': true,
'bWV4aWNvbGVkZ2VyLmNvbQ==': true,
'bWVzbGlldXgucGFyaXMuZnI=': true,
'bWdtLmdvdi50cg==': true,
'bWlhbWlvay5jb20=': true,
'bWlkZGxldG93bnRyYW5zY3JpcHQuY29t': true,
'bWlkbG90aGlhbm1pcnJvci5jb20=': true,
'bWlsZm9yZGJlYWNvbi5jb20=': true,
'bWlsZm9yZGRhaWx5bmV3cy5jb20=': true,
'bWlsbGJ1cnlzdXR0b24uY29t': true,
'bWluaWdhbWVzLm1haWwucnU=': true,
'bWluaXF1YWR0ZXN0YmVuY2guY29t': true,
'bXBubm93LmNvbQ==': true,
'bXMuc3BhbmtiYW5nLmNvbQ==': true,
'bXRzaGFzdGFuZXdzLmNvbQ==': true,
'bXl0b3dubmVvLmNvbQ==': true,
'bm9yd2ljaGJ1bGxldGluLmNvbQ==': true,
'bm9ydGhuZWlnaGJvcm5ld3MuY29t': true,
'bmNuZXdzcHJlc3MuY29t': true,
'bmV2YWRhaW93YWpvdXJuYWwuY29t': true,
'bmV3Y29tZXJzdG93bi1uZXdzLmNvbQ==': true,
'bmV3YmVybnNqLmNvbQ==': true,
'bmV3bG9vay5kdGVlbmVyZ3kuY29t': true,
'bmV3c2NoaWVmLmNvbQ==': true,
'bmV3c2hlcmFsZC5jb20=': true,
'bmV3c3JlcHVibGljYW4uY29t': true,
'bmV3c3RyaWJ1bmUuaW5mbw==': true,
'bmV3cG9ydHJpLmNvbQ==': true,
'bmV3cy1qb3VybmFsb25saW5lLmNvbQ==': true,
'bmV3cy1zdGFyLmNvbQ==': true,
'bmVhZ2xlLmNvbQ==': true,
'bmVvc2hvZGFpbHluZXdzLmNvbQ==': true,
'bmhtLmFjLnVr': true,
'bmwuc2hhcmtvb24uY29t': true,
'bmwuc3BhbmtiYW5nLmNvbQ==': true,
'bndmZGFpbHluZXdzLmNvbQ==': true,
'c291dGhjb2FzdHRvZGF5LmNvbQ==': true,
'c29taWliby5jb20=': true,
'c29vZXZlbmluZ25ld3MuY29t': true,
'c29zbm93aWVja2kucGw=': true,
'c2F2YW5uYWhub3cuY29t': true,
'c2FsaW5hLmNvbQ==': true,
'c2Nhbi5uZXh0Y2xvdWQuY29t': true,
'c2NvdHRoZWxtZS5jby51aw==': true,
'c2NzdW50aW1lcy5jb20=': true,
'c2Uuc3BhbmtiYW5nLmNvbQ==': true,
'c2VhY29hc3RvbmxpbmUuY29t': true,
'c2VjdXJlLnBheW1lbnRldm9sdXRpb24uY29t': true,
'c2VjdXJpdHloZWFkZXJzLmNvbQ==': true,
'c2VjdXJpdHloZWFkZXJzLmlv': true,
'c2Vrdm9pY2UuY29t': true,
'c2VudGluZWwtc3RhbmRhcmQuY29t': true,
'c2hlbGJ5c3Rhci5jb20=': true,
'c2llbWlhbm93aWNlLm5ldC5wbA==': true,
'c2lnbmFsLm9yZw==': true,
'c2lza2l5b3VkYWlseS5jb20=': true,
'c2otci5jb20=': true,
'c2puZXdzb25saW5lLmNvbQ==': true,
'c2tvdXNlbi5kaw==': true,
'c2tvdXNlbi5ubw==': true,
'c2xlZXB5ZXllbmV3cy5jb20=': true,
'c3BhbmtiYW5nLmNvbQ==': true,
'c3JwcmVzc2dhemV0dGUuY29t': true,
'c3R1cmdpc2pvdXJuYWwuY29t': true,
'c3R1dHRnYXJ0ZGFpbHlsZWFkZXIuY29t': true,
'c3RhZGl1bS5zZQ==': true,
'c3Rhcm5ld3NvbmxpbmUuY29t': true,
'c3RhcmNvdXJpZXIuY29t': true,
'c3RhcmZsLmNvbQ==': true,
'c3RhdGVzbWFuLmNvbQ==': true,
'c3RhdWd1c3RpbmUuY29t': true,
'c3RlZmFuc3VuZGluLmdpdGh1Yi5pbw==': true,
'c3RldWJlbmNvdXJpZXIuY29t': true,
'c3RqYW1lc25ld3MuY29t': true,
'c3d0aW1lcy5jb20=': true,
'c3dpb255LnBs': true,
'cG9jb25vcmVjb3JkLmNvbQ==': true,
'cG9lZGIudHc=': true,
'cG9udGlhY2RhaWx5bGVhZGVyLmNvbQ==': true,
'cG9zdHNvdXRoLmNvbQ==': true,
'cGF0cmlvdGxlZGdlci5jb20=': true,
'cGF3aHVza2Fqb3VybmFsY2FwaXRhbC5jb20=': true,
'cGFsbWJlYWNocG9zdC5jb20=': true,
'cGFuZG9jLm9yZw==': true,
'cGFyaXMtZXhwcmVzcy5jb20=': true,
'cGJjb21tZXJjaWFsLmNvbQ==': true,
'cGVraW50aW1lcy5jb20=': true,
'cGVvcGxlZm9uZS5jaA==': true,
'cGlla2FyeXNsYXNraWUuY29tLnBs': true,
'cGpzdGFyLmNvbQ==': true,
'cGwuc2hhcmtvb24uY29t': true,
'cGwuc3BhbmtiYW5nLmNvbQ==': true,
'cHJhdHR0cmlidW5lLmNvbQ==': true,
'cHJlc3Nhcmd1cy5jb20=': true,
'cHJlc3NtZW50b3IuY29t': true,
'cHJvY2Vzc3R5cGVmb3VuZHJ5LmNvbQ==': true,
'cHJvZ3Jlc3MtaW5kZXguY29t': true,
'cHJvc3BlcnByZXNzbmV3cy5jb20=': true,
'cHJvdmlkZW5jZWpvdXJuYWwuY29t': true,
'cHQuc2hhcmtvb24uY29t': true,
'cHQuc3BhbmtiYW5nLmNvbQ==': true,
'cHlza293aWNlLmNvbS5wbA==': true,
'cXdlcnRlZS5jb20=': true,
'cmV2aWV3YXRsYXMuY29t': true,
'cmVjb3JkLWNvdXJpZXIuY29t': true,
'cmVjb3Jkb25saW5lLmNvbQ==': true,
'cmVjb3JkbmV0LmNvbQ==': true,
'cmVjb3Jkc3Rhci5jb20=': true,
'cmVkd29vZGZhbGxzZ2F6ZXR0ZS5jb20=': true,
'cmVnZW50Z3JleW1vdXRoLmNvLm56': true,
'cmVnaXN0ZXJndWFyZC5jb20=': true,
'cmVwb3J0LXVyaS5pbw==': true,
'cmlkZ2VjcmVzdGNhLmNvbQ==': true,
'cnJzdGFyLmNvbQ==': true,
'cnUuc2hhcmtvb24uY29t': true,
'cnUuc3BhbmtiYW5nLmNvbQ==': true,
'cnVkYXNsYXNrYS5jb20ucGw=': true,
'cnVubmVsc2NvdW50eXJlZ2lzdGVyLmNvbQ==': true,
'cnlibmlja2kuY29t': true,
'd29kemlzbGF3LmNvbS5wbA==': true,
'd29vZGZvcmR0aW1lcy5jb20=': true,
'd29yY2VzdGVybWFnLmNvbQ==': true,
'd2F4YWhhY2hpZXR4LmNvbQ==': true,
'd2F5bmVpbmRlcGVuZGVudC5jb20=': true,
'd2F5bmVwb3N0LmNvbQ==': true,
'd2FsdG9uc3VuLmNvbQ==': true,
'd2FzaGluZ3RvbnRpbWVzcmVwb3J0ZXIuY29t': true,
'd2ViLXBhdGllbnQuZGs=': true,
'd2Vla2x5Y2l0aXplbi5jb20=': true,
'd2VsbGluZ3RvbmRhaWx5bmV3cy5jb20=': true,
'd2VsbHN2aWxsZWRhaWx5LmNvbQ==': true,
'd2hpdGVhd2F5Lm5v': true,
'd2hpdGVhd2F5LmNvbQ==': true,
'd2hpdGVhd2F5LnNl': true,
'd2hpdGVoYWxsam91cm5hbC5jb20=': true,
'dG9uZXMuYmU=': true,
'dG9wc2FpbGFkdmVydGlzZXIuY29t': true,
'dGF1bnRvbmdhemV0dGUuY29t': true,
'dGFmdG1pZHdheWRyaWxsZXIuY29t': true,
'dGV1dG9wb2xpc3ByZXNzLmNvbQ==': true,
'dGVsZWdyYW0uY29t': true,
'dGguc3BhbmtiYW5nLmNvbQ==': true,
'dGhlLWRhaWx5LXJlY29yZC5jb20=': true,
'dGhlLWRpc3BhdGNoLmNvbQ==': true,
'dGhlLWxlYWRlci5jb20=': true,
'dGhlLXJldmlldy5jb20=': true,
'dGhlY2FyYm9uZGFsZW5ld3MuY29t': true,
'dGhlZ3JhZnRvbm5ld3MuY29t': true,
'dGhlZ3VyZG9udGltZXMuY29t': true,
'dGhlZGFpbHlyZXBvcnRlci5jb20=': true,
'dGhlZGVzdGlubG9nLmNvbQ==': true,
'dGhla2Fuc2FuLmNvbQ==': true,
'dGhlaGF3a2V5ZS5jb20=': true,
'dGhlaW50ZWxsLmNvbQ==': true,
'dGhlbGFuZG1hcmsuY29t': true,
'dGhlbGVkZ2VyLmNvbQ==': true,
'dGhlc3VidXJiYW5pdGUuY29t': true,
'dGhlcGVycnljaGllZi5jb20=': true,
'dGhlcm9sbGFkYWlseW5ld3MuY29t': true,
'dGhlcmVjb3JkaGVyYWxkLmNvbQ==': true,
'dGhldGltZXNuZXdzLmNvbQ==': true,
'dGhpc3dlZWtuZXdzLmNvbQ==': true,
'dGltZXMtZ2F6ZXR0ZS5jb20=': true,
'dGltZXN0ZWxlZ3JhbS5jb20=': true,
'dGltZXNjYWxlLmNvbQ==': true,
'dGltZXNvbmxpbmUuY29t': true,
'dGltZXNyZXBvcnRlci5jb20=': true,
'dHIuc2hhcmtvb24uY29t': true,
'dHIuc3BhbmtiYW5nLmNvbQ==': true,
'dHJhbnNjZW5kLWluZm8uY29t': true,
'dHVuZW15bXVzaWMuY29t': true,
'dHVzY2Fsb29zYW5ld3MuY29t': true,
'dW5pZmllZHBvcnRhbC1tZW0uZXBmaW5kaWEuZ292Lmlu': true,
'dWRhY2l0eS5jb20=': true,
'dXRpY2FvZC5jb20=': true,
'dXdvcmxkLmNvbQ==': true,
'dmFuYWxzdHluZWxlYWRlci5jb20=': true,
'dnZkYWlseXByZXNzLmNvbQ==': true,
'eW91cmdsZW5yb3NldHguY29t': true,
'eW91cnN0ZXBoZW52aWxsZXR4LmNvbQ==': true,
'eW91cnZhbGxleXZvaWNlLmNvbQ==': true,
'eW91cnZvdGVtYXR0ZXJzLmNvLnVr': true,
'eWFkaS5zaw==': true,
'eWVscC5jb20=': true,
'em9yeS5jb20ucGw=': true,
'emFicnplLmNvbS5wbA==': true,
'emgtaGFudC5zaGFya29vbi5jb20=': true
};
const dynamic = [
'd2lja2VkbG9jYWxcLmNvbQ==',
'eWFuZGV4XC5jb20=',
'eWFuZGV4XC5ydQ=='
];
/**
* Exports
*/
export default {
'literal': Object.fromEntries(Object.entries(literal).map(([key, value]) => [atob(key), value])),
'dynamic': dynamic.map((value) => new RegExp(atob(value)))
};
/**
* Resource Aliases
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2018-02-24 (originally "shorthands")
* @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/.
*/
/**
* Public Constants
*/
const aliases = {
// Google Hosted Libraries [Deprecated]
'ajax.googleapis.com': {
'resources/jquery/1.8/jquery.min.jsm': {
'path': 'resources/jquery/1.8.3/jquery.min.jsm',
'version': '1.8.3'
},
'resources/jquery/1.7/jquery.min.jsm': {
'path': 'resources/jquery/1.7.2/jquery.min.jsm',
'version': '1.7.2'
},
'resources/jquery/1.6/jquery.min.jsm': {
'path': 'resources/jquery/1.6.4/jquery.min.jsm',
'version': '1.6.4'
},
'resources/jquery/1.5/jquery.min.jsm': {
'path': 'resources/jquery/1.5.2/jquery.min.jsm',
'version': '1.5.2'
},
'resources/jquery/1.4/jquery.min.jsm': {
'path': 'resources/jquery/1.4.4/jquery.min.jsm',
'version': '1.4.4'
},
'resources/jquery/1.3/jquery.min.jsm': {
'path': 'resources/jquery/1.3.2/jquery.min.jsm',
'version': '1.3.2'
},
'resources/jquery/1.2/jquery.min.jsm': {
'path': 'resources/jquery/1.2.6/jquery.min.jsm',
'version': '1.2.6'
}
},
// jQuery CDN [Deprecated]
'code.jquery.com': {
'resources/jquery/1.7/jquery.min.jsm': {
'path': 'resources/jquery/1.7.0/jquery.min.jsm',
'version': '1.7.0'
},
'resources/jquery/1.6/jquery.min.jsm': {
'path': 'resources/jquery/1.6.0/jquery.min.jsm',
'version': '1.6.0'
},
'resources/jquery/1.5/jquery.min.jsm': {
'path': 'resources/jquery/1.5.0/jquery.min.jsm',
'version': '1.5.0'
},
'resources/jquery/1.4/jquery.min.jsm': {
'path': 'resources/jquery/1.4.0/jquery.min.jsm',
'version': '1.4.0'
},
'resources/jquery/1.3/jquery.min.jsm': {
'path': 'resources/jquery/1.3.0/jquery.min.jsm',
'version': '1.3.0'
}
}
};
/**
* Initializations
*/
// Geekzu Public Service [Mirror]
aliases['sdn.geekzu.org'] = aliases['ajax.googleapis.com'];
// USTC Linux User Group [Mirror]
aliases['ajax.proxy.ustclug.org'] = aliases['ajax.googleapis.com'];
/**
* Exports
*/
export default aliases;
/**
* Resource Environments
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-07-24 (originally "files")
* @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/.
*/
/**
* Public Constants
*/
const stable = {
// AngularJS
'resources/angularjs/1.0.1/angular.min.jsm': true,
'resources/angularjs/1.0.2/angular.min.jsm': true,
'resources/angularjs/1.0.3/angular.min.jsm': true,
'resources/angularjs/1.0.4/angular.min.jsm': true,
'resources/angularjs/1.0.5/angular.min.jsm': true,
'resources/angularjs/1.0.6/angular.min.jsm': true,
'resources/angularjs/1.0.8/angular.min.jsm': true,
'resources/angularjs/1.2.0/angular.min.jsm': true,
'resources/angularjs/1.2.1/angular.min.jsm': true,
'resources/angularjs/1.2.10/angular.min.jsm': true,
'resources/angularjs/1.2.15/angular.min.jsm': true,
'resources/angularjs/1.2.16/angular.min.jsm': true,
'resources/angularjs/1.2.20/angular.min.jsm': true,
'resources/angularjs/1.2.23/angular.min.jsm': true,
'resources/angularjs/1.2.26/angular.min.jsm': true,
'resources/angularjs/1.2.28/angular.min.jsm': true,
'resources/angularjs/1.2.29/angular.min.jsm': true,
'resources/angularjs/1.3.0/angular.min.jsm': true,
'resources/angularjs/1.3.3/angular.min.jsm': true,
'resources/angularjs/1.3.8/angular.min.jsm': true,
'resources/angularjs/1.3.10/angular.min.jsm': true,
'resources/angularjs/1.3.11/angular.min.jsm': true,
'resources/angularjs/1.3.14/angular.min.jsm': true,
'resources/angularjs/1.3.15/angular.min.jsm': true,
'resources/angularjs/1.4.0/angular.min.jsm': true,
'resources/angularjs/1.4.2/angular.min.jsm': true,
'resources/angularjs/1.4.8/angular.min.jsm': true,
// Backbone.js
'resources/backbone.js/0.9.0/backbone-min.jsm': true,
'resources/backbone.js/0.9.1/backbone-min.jsm': true,
'resources/backbone.js/0.9.2/backbone-min.jsm': true,
'resources/backbone.js/0.9.9/backbone-min.jsm': true,
'resources/backbone.js/0.9.10/backbone-min.jsm': true,
'resources/backbone.js/1.0.0/backbone-min.jsm': true,
'resources/backbone.js/1.1.0/backbone-min.jsm': true,
'resources/backbone.js/1.1.1/backbone-min.jsm': true,
'resources/backbone.js/1.1.2/backbone-min.jsm': true,
'resources/backbone.js/1.2.0/backbone-min.jsm': true,
'resources/backbone.js/1.2.1/backbone-min.jsm': true,
'resources/backbone.js/1.2.2/backbone-min.jsm': true,
'resources/backbone.js/1.2.3/backbone-min.jsm': true,
// Dojo
'resources/dojo/1.4.1/dojo/dojo.jsm': true,
'resources/dojo/1.4.5/dojo/dojo.jsm': true,
'resources/dojo/1.5.0/dojo/dojo.jsm': true,
'resources/dojo/1.6.1/dojo/dojo.jsm': true,
'resources/dojo/1.7.5/dojo/dojo.jsm': true,
'resources/dojo/1.8.3/dojo/dojo.jsm': true,
'resources/dojo/1.8.7/dojo/dojo.jsm': true,
'resources/dojo/1.8.9/dojo/dojo.jsm': true,
'resources/dojo/1.9.1/dojo/dojo.jsm': true,
'resources/dojo/1.9.3/dojo/dojo.jsm': true,
'resources/dojo/1.9.7/dojo/dojo.jsm': true,
'resources/dojo/1.10.4/dojo/dojo.jsm': true,
// Ember.js
'resources/ember.js/1.0.1/ember.min.jsm': true,
'resources/ember.js/1.1.3/ember.min.jsm': true,
'resources/ember.js/1.2.2/ember.min.jsm': true,
'resources/ember.js/1.3.2/ember.min.jsm': true,
'resources/ember.js/1.4.0/ember.min.jsm': true,
'resources/ember.js/1.5.1/ember.min.jsm': true,
'resources/ember.js/2.0.0/ember.min.jsm': true,
'resources/ember.js/2.0.2/ember.min.jsm': true,
'resources/ember.js/2.1.0/ember.min.jsm': true,
// Ext Core
'resources/ext-core/3.0.0/ext-core.jsm': true,
'resources/ext-core/3.1.0/ext-core.jsm': true,
// jQuery
'resources/jquery/1.2.3/jquery.min.jsm': true,
'resources/jquery/1.2.6/jquery.min.jsm': true,
'resources/jquery/1.3.0/jquery.min.jsm': true,
'resources/jquery/1.3.1/jquery.min.jsm': true,
'resources/jquery/1.3.2/jquery.min.jsm': true,
'resources/jquery/1.4.0/jquery.min.jsm': true,
'resources/jquery/1.4.1/jquery.min.jsm': true,
'resources/jquery/1.4.2/jquery.min.jsm': true,
'resources/jquery/1.4.3/jquery.min.jsm': true,
'resources/jquery/1.4.4/jquery.min.jsm': true,
'resources/jquery/1.5.0/jquery.min.jsm': true,
'resources/jquery/1.5.1/jquery.min.jsm': true,
'resources/jquery/1.5.2/jquery.min.jsm': true,
'resources/jquery/1.6.0/jquery.min.jsm': true,
'resources/jquery/1.6.1/jquery.min.jsm': true,
'resources/jquery/1.6.2/jquery.min.jsm': true,
'resources/jquery/1.6.3/jquery.min.jsm': true,
'resources/jquery/1.6.4/jquery.min.jsm': true,
'resources/jquery/1.7.0/jquery.min.jsm': true,
'resources/jquery/1.7.1/jquery.min.jsm': true,
'resources/jquery/1.7.2/jquery.min.jsm': true,
'resources/jquery/1.8.0/jquery.min.jsm': true,
'resources/jquery/1.8.1/jquery.min.jsm': true,
'resources/jquery/1.8.2/jquery.min.jsm': true,
'resources/jquery/1.8.3/jquery.min.jsm': true,
'resources/jquery/1.9.0/jquery.min.jsm': true,
'resources/jquery/1.9.1/jquery.min.jsm': true,
'resources/jquery/1.10.0/jquery.min.jsm': true,
'resources/jquery/1.10.1/jquery.min.jsm': true,
'resources/jquery/1.10.2/jquery.min.jsm': true,
'resources/jquery/1.11.0/jquery.min.jsm': true,
'resources/jquery/1.11.1/jquery.min.jsm': true,
'resources/jquery/1.11.2/jquery.min.jsm': true,
'resources/jquery/1.11.3/jquery.min.jsm': true,
'resources/jquery/1.12.0/jquery.min.jsm': true,
'resources/jquery/1.12.1/jquery.min.jsm': true,
'resources/jquery/1.12.2/jquery.min.jsm': true,
'resources/jquery/1.12.3/jquery.min.jsm': true,
'resources/jquery/1.12.4/jquery.min.jsm': true,
'resources/jquery/2.0.0/jquery.min.jsm': true,
'resources/jquery/2.0.1/jquery.min.jsm': true,
'resources/jquery/2.0.2/jquery.min.jsm': true,
'resources/jquery/2.0.3/jquery.min.jsm': true,
'resources/jquery/2.1.0/jquery.min.jsm': true,
'resources/jquery/2.1.1/jquery.min.jsm': true,
'resources/jquery/2.1.3/jquery.min.jsm': true,
'resources/jquery/2.1.4/jquery.min.jsm': true,
// jQuery UI
'resources/jqueryui/1.5.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.6.0/jquery-ui.min.jsm': true,
'resources/jqueryui/1.7.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.8.24/jquery-ui.min.jsm': true,
'resources/jqueryui/1.9.2/jquery-ui.min.jsm': true,
'resources/jqueryui/1.10.4/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.0/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.1/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.2/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.3/jquery-ui.min.jsm': true,
'resources/jqueryui/1.11.4/jquery-ui.min.jsm': true,
// Modernizr
'resources/modernizr/2.6.2/modernizr.min.jsm': true,
'resources/modernizr/2.7.1/modernizr.min.jsm': true,
'resources/modernizr/2.7.2/modernizr.min.jsm': true,
'resources/modernizr/2.8.2/modernizr.min.jsm': true,
'resources/modernizr/2.8.3/modernizr.min.jsm': true,
// MooTools
'resources/mootools/1.1.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.1.2/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.3/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.4/mootools-yui-compressed.jsm': true,
'resources/mootools/1.2.5/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.0/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.3.2/mootools-yui-compressed.jsm': true,
'resources/mootools/1.4.1/mootools-yui-compressed.jsm': true,
'resources/mootools/1.4.5/mootools-yui-compressed.jsm': true,
'resources/mootools/1.5.0/mootools-yui-compressed.jsm': true,
'resources/mootools/1.5.1/mootools-yui-compressed.jsm': true,
// Prototype
'resources/prototype/1.6.0.2/prototype.jsm': true,
'resources/prototype/1.6.0.3/prototype.jsm': true,
'resources/prototype/1.6.1.0/prototype.jsm': true,
'resources/prototype/1.7.0.0/prototype.jsm': true,
'resources/prototype/1.7.1.0/prototype.jsm': true,
'resources/prototype/1.7.2.0/prototype.jsm': true,
'resources/prototype/1.7.3.0/prototype.jsm': true,
// Scriptaculous
'resources/scriptaculous/1.8.1/scriptaculous.jsm': true,
'resources/scriptaculous/1.8.2/scriptaculous.jsm': true,
'resources/scriptaculous/1.8.3/scriptaculous.jsm': true,
'resources/scriptaculous/1.9.0/scriptaculous.jsm': true,
// SWFObject
'resources/swfobject/2.1/swfobject.jsm': true,
'resources/swfobject/2.2/swfobject.jsm': true,
// Underscore.js
'resources/underscore.js/1.3.0/underscore-min.jsm': true,
'resources/underscore.js/1.3.1/underscore-min.jsm': true,
'resources/underscore.js/1.3.3/underscore-min.jsm': true,
'resources/underscore.js/1.4.0/underscore-min.jsm': true,
'resources/underscore.js/1.4.1/underscore-min.jsm': true,
'resources/underscore.js/1.4.2/underscore-min.jsm': true,
'resources/underscore.js/1.4.3/underscore-min.jsm': true,
'resources/underscore.js/1.4.4/underscore-min.jsm': true,
'resources/underscore.js/1.5.0/underscore-min.jsm': true,
'resources/underscore.js/1.5.1/underscore-min.jsm': true,
'resources/underscore.js/1.5.2/underscore-min.jsm': true,
'resources/underscore.js/1.6.0/underscore-min.jsm': true,
'resources/underscore.js/1.7.0/underscore-min.jsm': true,
'resources/underscore.js/1.8.0/underscore-min.jsm': true,
'resources/underscore.js/1.8.1/underscore-min.jsm': true,
'resources/underscore.js/1.8.2/underscore-min.jsm': true,
'resources/underscore.js/1.8.3/underscore-min.jsm': true,
// Web Font Loader
'resources/webfont/1.0.0/webfont.jsm': true,
'resources/webfont/1.0.1/webfont.jsm': true,
'resources/webfont/1.0.2/webfont.jsm': true,
'resources/webfont/1.0.3/webfont.jsm': true,
'resources/webfont/1.0.4/webfont.jsm': true,
'resources/webfont/1.0.5/webfont.jsm': true,
'resources/webfont/1.0.6/webfont.jsm': true,
'resources/webfont/1.0.9/webfont.jsm': true,
'resources/webfont/1.0.10/webfont.jsm': true,
'resources/webfont/1.0.11/webfont.jsm': true,
'resources/webfont/1.0.12/webfont.jsm': true,
'resources/webfont/1.0.13/webfont.jsm': true,
'resources/webfont/1.0.14/webfont.jsm': true,
'resources/webfont/1.0.15/webfont.jsm': true,
'resources/webfont/1.0.16/webfont.jsm': true,
'resources/webfont/1.0.17/webfont.jsm': true,
'resources/webfont/1.0.18/webfont.jsm': true,
'resources/webfont/1.0.19/webfont.jsm': true,
'resources/webfont/1.0.21/webfont.jsm': true,
'resources/webfont/1.0.22/webfont.jsm': true,
'resources/webfont/1.0.23/webfont.jsm': true,
'resources/webfont/1.0.24/webfont.jsm': true,
'resources/webfont/1.0.25/webfont.jsm': true,
'resources/webfont/1.0.26/webfont.jsm': true,
'resources/webfont/1.0.27/webfont.jsm': true,
'resources/webfont/1.0.28/webfont.jsm': true,
'resources/webfont/1.0.29/webfont.jsm': true,
'resources/webfont/1.0.30/webfont.jsm': true,
'resources/webfont/1.0.31/webfont.jsm': true,
'resources/webfont/1.1.0/webfont.jsm': true,
'resources/webfont/1.1.1/webfont.jsm': true,
'resources/webfont/1.1.2/webfont.jsm': true,
'resources/webfont/1.3.0/webfont.jsm': true,
'resources/webfont/1.4.2/webfont.jsm': true,
'resources/webfont/1.4.6/webfont.jsm': true,
'resources/webfont/1.4.7/webfont.jsm': true,
'resources/webfont/1.4.8/webfont.jsm': true,
'resources/webfont/1.4.10/webfont.jsm': true,
'resources/webfont/1.5.0/webfont.jsm': true,
'resources/webfont/1.5.2/webfont.jsm': true,
'resources/webfont/1.5.3/webfont.jsm': true,
'resources/webfont/1.5.6/webfont.jsm': true,
'resources/webfont/1.5.10/webfont.jsm': true,
'resources/webfont/1.5.18/webfont.jsm': true
};
const staging = {...stable, ...{
// AngularJS
'resources/angularjs/1.5.8/angular.min.jsm': true,
'resources/angularjs/1.6.1/angular.min.jsm': true,
'resources/angularjs/1.6.5/angular.min.jsm': true,
// Backbone.js
'resources/backbone.js/1.3.3/backbone-min.jsm': true,
'resources/backbone.js/1.4.0/backbone-min.jsm': true,
// jQuery
'resources/jquery/2.2.0/jquery.min.jsm': true,
'resources/jquery/2.2.1/jquery.min.jsm': true,
'resources/jquery/2.2.2/jquery.min.jsm': true,
'resources/jquery/2.2.3/jquery.min.jsm': true,
'resources/jquery/2.2.4/jquery.min.jsm': true,
'resources/jquery/3.0.0/jquery.min.jsm': true,
'resources/jquery/3.1.0/jquery.min.jsm': true,
'resources/jquery/3.1.1/jquery.min.jsm': true,
'resources/jquery/3.2.0/jquery.min.jsm': true,
'resources/jquery/3.2.1/jquery.min.jsm': true,
'resources/jquery/3.3.1/jquery.min.jsm': true,
'resources/jquery/3.4.0/jquery.min.jsm': true,
'resources/jquery/3.4.1/jquery.min.jsm': true,
'resources/jquery/3.5.0/jquery.min.jsm': true,
'resources/jquery/3.5.1/jquery.min.jsm': true,
'resources/jquery/3.6.0/jquery.min.jsm': true,
'resources/jquery/3.6.1/jquery.min.jsm': true,
'resources/jquery/3.6.4/jquery.min.jsm': true,
'resources/jquery/3.7.0/jquery.min.jsm': true,
'resources/jquery/3.7.1/jquery.min.jsm': true,
// Moment.js
'resources/moment.js/2.8.3/moment.min.jsm': true,
'resources/moment.js/2.8.4/moment.min.jsm': true,
'resources/moment.js/2.10.2/moment.min.jsm': true,
'resources/moment.js/2.10.3/moment.min.jsm': true,
'resources/moment.js/2.10.6/moment.min.jsm': true,
'resources/moment.js/2.11.1/moment.min.jsm': true,
'resources/moment.js/2.11.2/moment.min.jsm': true,
'resources/moment.js/2.17.0/moment.min.jsm': true,
'resources/moment.js/2.17.1/moment.min.jsm': true,
'resources/moment.js/2.18.1/moment.min.jsm': true,
'resources/moment.js/2.19.1/moment.min.jsm': true,
'resources/moment.js/2.19.2/moment.min.jsm': true,
'resources/moment.js/2.19.3/moment.min.jsm': true,
'resources/moment.js/2.20.1/moment.min.jsm': true,
'resources/moment.js/2.22.0/moment.min.jsm': true,
'resources/moment.js/2.22.1/moment.min.jsm': true,
'resources/moment.js/2.22.2/moment.min.jsm': true,
'resources/moment.js/2.24.0/moment.min.jsm': true,
'resources/moment.js/2.29.1/moment.min.jsm': true,
'resources/moment.js/2.29.4/moment.min.jsm': true,
// Underscore.js
'resources/underscore.js/1.9.0/underscore-min.jsm': true,
'resources/underscore.js/1.9.1/underscore-min.jsm': true,
'resources/underscore.js/1.13.4/underscore-min.jsm': true
}};
/**
* Exports
*/
export default {
stable,
staging
};
/**
* Resource Mappings
* 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/.
*/
import ResourceSets from './sets.js';
/**
* Public Constants
*/
const mappings = {
// Google Hosted Libraries
'ajax.googleapis.com': {
'/ajax/libs/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'ext-core/{version}/ext-core-debug.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'webfont/{version}/webfont.': ResourceSets.webfont,
// Mapping Aliases [Deprecated]
'dojo/1/dojo/dojo.': {
'path': 'resources/dojo/1.6.1/dojo/dojo.jsm',
'type': 'application/javascript'
},
'jquery/1/jquery.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
},
'jqueryui/1/jquery-ui.js': {
'path': 'resources/jqueryui/1.10.4/jquery-ui.min.jsm',
'type': 'application/javascript'
},
'jqueryui/1/jquery-ui.min.js': {
'path': 'resources/jqueryui/1.10.4/jquery-ui.min.jsm',
'type': 'application/javascript'
},
'mootools/1/mootools-yui-compressed.': {
'path': 'resources/mootools/1.1.2/mootools-yui-compressed.jsm',
'type': 'application/javascript'
},
'prototype/1/prototype.': {
'path': 'resources/prototype/1.7.1.0/prototype.jsm',
'type': 'application/javascript'
},
'scriptaculous/1/scriptaculous.': {
'path': 'resources/scriptaculous/1.9.0/scriptaculous.jsm',
'type': 'application/javascript'
},
'swfobject/2/swfobject.': {
'path': 'resources/swfobject/2.2/swfobject.jsm',
'type': 'application/javascript'
},
'webfont/1/webfont.': {
'path': 'resources/webfont/1.5.18/webfont.jsm',
'type': 'application/javascript'
}
}
},
// Microsoft Ajax CDN
'ajax.aspnetcdn.com': {
'/ajax/': {
'jQuery/jquery-{version}.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'modernizr/modernizr-{version}.': ResourceSets.modernizr
}
},
// Microsoft Ajax CDN [Deprecated]
'ajax.microsoft.com': {
'/ajax/': {
'jQuery/jquery-{version}.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'modernizr/modernizr-{version}.': ResourceSets.modernizr
}
},
// CDNJS (Cloudflare)
'cdnjs.cloudflare.com': {
'/ajax/libs/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'moment.js/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-core': ResourceSets.mootools,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont': ResourceSets.webfont
}
},
// jQuery CDN (Fastly)
'code.jquery.com': {
'/': {
'jquery-{version}.': ResourceSets.jQuery,
'ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
// Mapping Aliases [Deprecated]
'jquery-latest.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
},
'jquery.': {
'path': 'resources/jquery/1.11.1/jquery.min.jsm',
'type': 'application/javascript'
}
}
},
// jsDelivr (Cloudflare, Fastly)
'cdn.jsdelivr.net': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbonejs/{version}/backbone.': ResourceSets.backbone,
'backbonejs/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'emberjs/{version}/ember.': ResourceSets.ember,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery.ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery.ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'momentjs/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-': ResourceSets.mootools,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscorejs/{version}/underscore.': ResourceSets.underscore,
'underscorejs/{version}/underscore-min.': ResourceSets.underscore,
'webfontloader/{version}/webfont': ResourceSets.webfont
}
},
// Yandex CDN
'yastatic.net': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'backbone/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'momentjs/{version}/moment.': ResourceSets.moment,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore
}
},
// Yandex CDN [Deprecated]
'yandex.st': {
'/': {
'angularjs/{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'backbone/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'momentjs/{version}/moment.': ResourceSets.moment,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore
}
},
// Baidu CDN
'apps.bdimg.com': {
'/libs/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'moment/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'swfobject/{version}/swfobject_src.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// Baidu CDN [Deprecated]
'libs.baidu.com': {
'/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'moment/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'swfobject/{version}/swfobject_src.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// Sina Public Resources
'lib.sinaapp.com': {
'/js/': {
'angular.js/angular-{version}/angular.': ResourceSets.angular,
'backbone/{version}/backbone.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'ext-core/{version}/ext-core-debug.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery-ui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'mootools/{version}/mootools.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore/{version}/underscore.': ResourceSets.underscore,
'underscore/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfont.': ResourceSets.webfont,
'webfont/{version}/webfont_debug.': ResourceSets.webfont
}
},
// UpYun Library
'upcdn.b0.upaiyun.com': {
'/libs/': {
'dojo/dojo-{version}.': ResourceSets.dojo,
'emberjs/emberjs-{version}.': ResourceSets.ember,
'jquery/jquery-{version}.': ResourceSets.jQuery,
'jqueryui/jquery.ui-{version}.js': ResourceSets.jQueryUI,
'jqueryui/jquery.ui-{version}.min.js': ResourceSets.jQueryUI,
'modernizr/modernizr-{version}.': ResourceSets.modernizr,
'mootoolscore/mootools.core-{version}.': ResourceSets.mootools
}
},
// Tencent Cloud CDN
'mat1.gtimg.com': {
'/libs/': {
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jquery/jquery-{version}.': ResourceSets.jQuery
}
},
// BootCDN [Dissolved]
'cdn.bootcss.com': {
'/': {
'angular.js/{version}/angular.': ResourceSets.angular,
'backbone.js/{version}/backbone.': ResourceSets.backbone,
'backbone.js/{version}/backbone-min.': ResourceSets.backbone,
'dojo/{version}/dojo.': ResourceSets.dojo,
'ember.js/{version}/ember.': ResourceSets.ember,
'ext-core/{version}/ext-core.': ResourceSets.extCore,
'jquery/{version}/jquery.': ResourceSets.jQuery,
'jqueryui/{version}/jquery-ui.js': ResourceSets.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': ResourceSets.jQueryUI,
'modernizr/{version}/modernizr.': ResourceSets.modernizr,
'moment.js/{version}/moment.': ResourceSets.moment,
'mootools/{version}/mootools-yui-compressed.': ResourceSets.mootools,
'prototype/{version}/prototype.': ResourceSets.prototypeJS,
'scriptaculous/{version}/scriptaculous.': ResourceSets.scriptaculous,
'swfobject/{version}/swfobject.': ResourceSets.swfobject,
'underscore.js/{version}/underscore.': ResourceSets.underscore,
'underscore.js/{version}/underscore-min.': ResourceSets.underscore,
'webfont/{version}/webfontloader.': ResourceSets.webfont
}
}
};
/**
* Initializations
*/
// Geekzu Public Service [Mirror]
mappings['sdn.geekzu.org'] = {
'/ajax/ajax/libs/': mappings['ajax.googleapis.com']['/ajax/libs/']
};
// USTC Linux User Group [Mirror]
mappings['ajax.proxy.ustclug.org'] = mappings['ajax.googleapis.com'];
/**
* Exports
*/
export default mappings;
/**
* Resource Sets
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-05-30 (originally "resources")
* @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/.
*/
/**
* Public Constants
*/
const sets = {
// AngularJS
'angular': {
'path': 'resources/angularjs/{version}/angular.min.jsm',
'type': 'application/javascript'
},
// Backbone.js
'backbone': {
'path': 'resources/backbone.js/{version}/backbone-min.jsm',
'type': 'application/javascript'
},
// Dojo
'dojo': {
'path': 'resources/dojo/{version}/dojo/dojo.jsm',
'type': 'application/javascript'
},
// Ember.js
'ember': {
'path': 'resources/ember.js/{version}/ember.min.jsm',
'type': 'application/javascript'
},
// Ext Core
'extCore': {
'path': 'resources/ext-core/{version}/ext-core.jsm',
'type': 'application/javascript'
},
// jQuery
'jQuery': {
'path': 'resources/jquery/{version}/jquery.min.jsm',
'type': 'application/javascript'
},
// jQuery UI
'jQueryUI': {
'path': 'resources/jqueryui/{version}/jquery-ui.min.jsm',
'type': 'application/javascript'
},
// Modernizr
'modernizr': {
'path': 'resources/modernizr/{version}/modernizr.min.jsm',
'type': 'application/javascript'
},
// Moment.js
'moment': {
'path': 'resources/moment.js/{version}/moment.min.jsm',
'type': 'application/javascript'
},
// MooTools
'mootools': {
'path': 'resources/mootools/{version}/mootools-yui-compressed.jsm',
'type': 'application/javascript'
},
// Prototype
'prototypeJS': {
'path': 'resources/prototype/{version}/prototype.jsm',
'type': 'application/javascript'
},
// Scriptaculous
'scriptaculous': {
'path': 'resources/scriptaculous/{version}/scriptaculous.jsm',
'type': 'application/javascript'
},
// SWFObject
'swfobject': {
'path': 'resources/swfobject/{version}/swfobject.jsm',
'type': 'application/javascript'
},
// Underscore.js
'underscore': {
'path': 'resources/underscore.js/{version}/underscore-min.jsm',
'type': 'application/javascript'
},
// Web Font Loader
'webfont': {
'path': 'resources/webfont/{version}/webfont.jsm',
'type': 'application/javascript'
}
};
/**
* Exports
*/
export default sets;
/**
* Setting Defaults
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2024-10-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/.
*/
import Constants from '../constants.js';
/**
* Public Constants
*/
const defaults = {
[Constants.Setting.BLOCK_MISSING]: false,
[Constants.Setting.DISABLE_PREFETCH]: true,
[Constants.Setting.ENFORCE_STAGING]: false,
[Constants.Setting.SHOW_ICON_BADGE]: true,
[Constants.Setting.SHOW_RELEASE_NOTES]: true,
[Constants.Setting.STRIP_METADATA]: true,
[Constants.Setting.WHITELISTED_DOMAINS]: {},
[Constants.Setting.XHR_TEST_DOMAIN]: Constants.Address.DECENTRALEYES
};
/**
* Exports
*/
export default defaults;
/**
* Statistic Defaults
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2024-10-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/.
*/
import Constants from '../constants.js';
/**
* Public Constants
*/
const defaults = {
[Constants.Statistic.AMOUNT_INJECTED]: {
'value': 0, 'createdAt': new Date().toISOString()
},
[Constants.Statistic.AMOUNT_SANITIZED]: {
'value': 0, 'createdAt': new Date().toISOString()
},
[Constants.Statistic.AMOUNT_BLOCKED]: {
'value': 0, 'createdAt': new Date().toISOString()
}
};
/**
* Exports
*/
export default defaults;
/**
* 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/.
*/
import './core/request/interceptor.js';
import './core/request/sanitizer.js';
import './utilities/messenger.js';
/**
* Background Helpers
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-10-26
* @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/.
*/
import Constants from '../data/constants.js';
import ResourceMappings from '../data/resource/mappings.js';
import Storage from '../core/storage.js';
/**
* Public Functions
*/
const normalizeDomain = (domain) => {
domain = domain.toLowerCase().trim().replace(/[^A-Za-z0-9.-]/g, '');
if (domain.startsWith(Constants.Address.WWW_PREFIX)) {
domain = domain.slice(Constants.Address.WWW_PREFIX.length);
}
return domain;
};
const domainIsWhitelisted = async (domain, whitelistedDomains = null) => {
if (domain !== null) {
if (! whitelistedDomains) {
whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
}
return Boolean(whitelistedDomains[domain]);
}
return false;
};
const updateWhitelistedDomains = async (whitelistedDomains) => {
await Storage.updateSetting(Constants.Setting.WHITELISTED_DOMAINS, whitelistedDomains);
};
const addDomainToWhitelist = async (domain) => {
const whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
whitelistedDomains[domain] = true;
await updateWhitelistedDomains(whitelistedDomains);
chrome.runtime.sendMessage({
'topic': 'domain:added-to-whitelist', 'value': whitelistedDomains
}, () => {
if (chrome.runtime.lastError) { /**/ }
});
};
const removeDomainFromWhitelist = async (domain) => {
const whitelistedDomains = await Storage.getSetting(Constants.Setting.WHITELISTED_DOMAINS);
delete whitelistedDomains[domain];
await updateWhitelistedDomains(whitelistedDomains);
chrome.runtime.sendMessage({
'topic': 'domain:removed-from-whitelist', 'value': whitelistedDomains
}, () => {
if (chrome.runtime.lastError) { /**/ }
});
};
const extractDomainFromUrl = (url, normalize = true) => {
let extractedDomain = null;
if (typeof url !== 'string') {
return null;
}
if (url.startsWith(Constants.Address.CHROME)) {
return null;
}
try {
extractedDomain = new URL(url).hostname;
} catch {
return null;
}
if (extractedDomain === '') {
return null;
}
if (normalize === true) {
extractedDomain = normalizeDomain(extractedDomain);
}
return extractedDomain;
};
const determineValidHosts = () => {
const validHosts = [];
for (const mapping of Object.keys(ResourceMappings)) {
const supportedHost = Constants.Address.ANY_PROTOCOL + mapping + Constants.Address.ANY_PATH;
validHosts.push(supportedHost);
}
return validHosts;
};
const setPrefetchDisabled = (disable) => {
if (disable === false) {
chrome.privacy.network.networkPredictionEnabled.clear({});
} else {
chrome.privacy.network.networkPredictionEnabled.set({'value': false});
}
};
const determineIconPaths = (type) => {
let sizes, iconPaths;
sizes = ['16', '18', '19', '32', '36', '38', '64'];
iconPaths = {};
for (const size of sizes) {
iconPaths[size] = chrome.runtime.getURL(`images/icons/action/${type}/${size}.png`);
}
return iconPaths;
};
/**
* Exports
*/
export default {
normalizeDomain,
domainIsWhitelisted,
updateWhitelistedDomains,
addDomainToWhitelist,
removeDomainFromWhitelist,
extractDomainFromUrl,
determineValidHosts,
setPrefetchDisabled,
determineIconPaths
};
/**
* Runtime Messenger
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2018-05-28
* @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/.
*/
import Constants from '../data/constants.js';
import Helpers from '../utilities/helpers.js';
import Storage from '../core/storage.js';
/**
* Private Functions
*/
const _handleMessageReceived = (message, sender, sendResponse) => {
let topic, value;
topic = message.topic;
value = message.value;
if (topic === 'extension:is-initialized') {
sendResponse({'value': true});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'tab-context:get') {
Storage.getTabContext(value).then((tabContext) => {
sendResponse({'value': tabContext});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'settings:get') {
Storage.getSettings(value?.concise).then((settings) => {
sendResponse({'value': settings});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'setting:update') {
Storage.updateSetting(value.key, value.value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'whitelisted-domains:update') {
Helpers.updateWhitelistedDomains(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'statistics:get-amount-injected') {
Storage.getStatistic(Constants.Statistic.AMOUNT_INJECTED).then((amountInjected) => {
sendResponse({'value': amountInjected});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:extract-from-url') {
sendResponse({'value': Helpers.extractDomainFromUrl(value)});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'domain:normalize') {
sendResponse({'value': Helpers.normalizeDomain(value)});
return Constants.MessageResponse.SYNCHRONOUS;
}
if (topic === 'domain:add-to-whitelist') {
Helpers.addDomainToWhitelist(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:remove-from-whitelist') {
Helpers.removeDomainFromWhitelist(value).then(() => {
sendResponse({'value': true});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
if (topic === 'domain:is-whitelisted') {
Helpers.domainIsWhitelisted(value).then((domainIsWhitelisted) => {
sendResponse({'value': domainIsWhitelisted});
});
return Constants.MessageResponse.ASYNCHRONOUS;
}
};
/**
* Event Handlers
*/
chrome.runtime.onMessage.addListener(_handleMessageReceived);
/**
* Browser API Wrappers
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2017-12-03
* @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/.
*/
/**
* Public Constants
*/
const action = {
setBadgeBackgroundColor (details) {
chrome.action.setBadgeBackgroundColor(details);
},
setBadgeText (details) {
chrome.action.setBadgeText(details);
},
setBadgeTextColor (details) {
if (chrome.action.setBadgeTextColor !== undefined) {
chrome.action.setBadgeTextColor(details);
}
},
setIcon (details) {
chrome.action.setIcon(details);
},
async setTitle (details) {
const platformInformation = await chrome.runtime.getPlatformInfo();
if (platformInformation.os !== chrome.runtime.PlatformOs.ANDROID) {
await chrome.action.setTitle(details);
}
}
};
/**
* Exports
*/
export default {
action
};
/**
* Files
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2014-07-24
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Files
*/
var files = {
// AngularJS
'resources/angularjs/1.0.1/angular.min.js.dec': true,
'resources/angularjs/1.0.2/angular.min.js.dec': true,
'resources/angularjs/1.0.3/angular.min.js.dec': true,
'resources/angularjs/1.0.4/angular.min.js.dec': true,
'resources/angularjs/1.0.5/angular.min.js.dec': true,
'resources/angularjs/1.0.6/angular.min.js.dec': true,
'resources/angularjs/1.0.8/angular.min.js.dec': true,
'resources/angularjs/1.2.0/angular.min.js.dec': true,
'resources/angularjs/1.2.1/angular.min.js.dec': true,
'resources/angularjs/1.2.10/angular.min.js.dec': true,
'resources/angularjs/1.2.15/angular.min.js.dec': true,
'resources/angularjs/1.2.16/angular.min.js.dec': true,
'resources/angularjs/1.2.20/angular.min.js.dec': true,
'resources/angularjs/1.2.23/angular.min.js.dec': true,
'resources/angularjs/1.2.26/angular.min.js.dec': true,
'resources/angularjs/1.2.28/angular.min.js.dec': true,
'resources/angularjs/1.2.29/angular.min.js.dec': true,
'resources/angularjs/1.3.0/angular.min.js.dec': true,
'resources/angularjs/1.3.3/angular.min.js.dec': true,
'resources/angularjs/1.3.8/angular.min.js.dec': true,
'resources/angularjs/1.3.10/angular.min.js.dec': true,
'resources/angularjs/1.3.11/angular.min.js.dec': true,
'resources/angularjs/1.3.14/angular.min.js.dec': true,
'resources/angularjs/1.3.15/angular.min.js.dec': true,
'resources/angularjs/1.4.0/angular.min.js.dec': true,
'resources/angularjs/1.4.2/angular.min.js.dec': true,
'resources/angularjs/1.4.8/angular.min.js.dec': true,
// Backbone.js
'resources/backbone.js/0.9.0/backbone-min.js.dec': true,
'resources/backbone.js/0.9.1/backbone-min.js.dec': true,
'resources/backbone.js/0.9.2/backbone-min.js.dec': true,
'resources/backbone.js/0.9.9/backbone-min.js.dec': true,
'resources/backbone.js/0.9.10/backbone-min.js.dec': true,
'resources/backbone.js/1.0.0/backbone-min.js.dec': true,
'resources/backbone.js/1.1.0/backbone-min.js.dec': true,
'resources/backbone.js/1.1.1/backbone-min.js.dec': true,
'resources/backbone.js/1.1.2/backbone-min.js.dec': true,
'resources/backbone.js/1.2.0/backbone-min.js.dec': true,
'resources/backbone.js/1.2.1/backbone-min.js.dec': true,
'resources/backbone.js/1.2.2/backbone-min.js.dec': true,
'resources/backbone.js/1.2.3/backbone-min.js.dec': true,
// Dojo
'resources/dojo/1.4.1/dojo/dojo.js.dec': true,
'resources/dojo/1.4.5/dojo/dojo.js.dec': true,
'resources/dojo/1.5.0/dojo/dojo.js.dec': true,
'resources/dojo/1.6.1/dojo/dojo.js.dec': true,
'resources/dojo/1.7.5/dojo/dojo.js.dec': true,
'resources/dojo/1.8.3/dojo/dojo.js.dec': true,
'resources/dojo/1.8.7/dojo/dojo.js.dec': true,
'resources/dojo/1.8.9/dojo/dojo.js.dec': true,
'resources/dojo/1.9.1/dojo/dojo.js.dec': true,
'resources/dojo/1.9.3/dojo/dojo.js.dec': true,
'resources/dojo/1.9.7/dojo/dojo.js.dec': true,
'resources/dojo/1.10.4/dojo/dojo.js.dec': true,
// Ember.js
'resources/ember.js/1.0.1/ember.min.js.dec': true,
'resources/ember.js/1.1.3/ember.min.js.dec': true,
'resources/ember.js/1.2.2/ember.min.js.dec': true,
'resources/ember.js/1.3.2/ember.min.js.dec': true,
'resources/ember.js/1.4.0/ember.min.js.dec': true,
'resources/ember.js/1.5.1/ember.min.js.dec': true,
'resources/ember.js/2.0.0/ember.min.js.dec': true,
'resources/ember.js/2.0.2/ember.min.js.dec': true,
'resources/ember.js/2.1.0/ember.min.js.dec': true,
// Ext Core
'resources/ext-core/3.0.0/ext-core.js.dec': true,
'resources/ext-core/3.1.0/ext-core.js.dec': true,
// jQuery
'resources/jquery/1.2.3/jquery.min.js.dec': true,
'resources/jquery/1.2.6/jquery.min.js.dec': true,
'resources/jquery/1.3.0/jquery.min.js.dec': true,
'resources/jquery/1.3.1/jquery.min.js.dec': true,
'resources/jquery/1.3.2/jquery.min.js.dec': true,
'resources/jquery/1.4.0/jquery.min.js.dec': true,
'resources/jquery/1.4.1/jquery.min.js.dec': true,
'resources/jquery/1.4.2/jquery.min.js.dec': true,
'resources/jquery/1.4.3/jquery.min.js.dec': true,
'resources/jquery/1.4.4/jquery.min.js.dec': true,
'resources/jquery/1.5.0/jquery.min.js.dec': true,
'resources/jquery/1.5.1/jquery.min.js.dec': true,
'resources/jquery/1.5.2/jquery.min.js.dec': true,
'resources/jquery/1.6.0/jquery.min.js.dec': true,
'resources/jquery/1.6.1/jquery.min.js.dec': true,
'resources/jquery/1.6.2/jquery.min.js.dec': true,
'resources/jquery/1.6.3/jquery.min.js.dec': true,
'resources/jquery/1.6.4/jquery.min.js.dec': true,
'resources/jquery/1.7.0/jquery.min.js.dec': true,
'resources/jquery/1.7.1/jquery.min.js.dec': true,
'resources/jquery/1.7.2/jquery.min.js.dec': true,
'resources/jquery/1.8.0/jquery.min.js.dec': true,
'resources/jquery/1.8.1/jquery.min.js.dec': true,
'resources/jquery/1.8.2/jquery.min.js.dec': true,
'resources/jquery/1.8.3/jquery.min.js.dec': true,
'resources/jquery/1.9.0/jquery.min.js.dec': true,
'resources/jquery/1.9.1/jquery.min.js.dec': true,
'resources/jquery/1.10.0/jquery.min.js.dec': true,
'resources/jquery/1.10.1/jquery.min.js.dec': true,
'resources/jquery/1.10.2/jquery.min.js.dec': true,
'resources/jquery/1.11.0/jquery.min.js.dec': true,
'resources/jquery/1.11.1/jquery.min.js.dec': true,
'resources/jquery/1.11.2/jquery.min.js.dec': true,
'resources/jquery/1.11.3/jquery.min.js.dec': true,
'resources/jquery/1.12.0/jquery.min.js.dec': true,
'resources/jquery/1.12.1/jquery.min.js.dec': true,
'resources/jquery/1.12.2/jquery.min.js.dec': true,
'resources/jquery/1.12.3/jquery.min.js.dec': true,
'resources/jquery/1.12.4/jquery.min.js.dec': true,
'resources/jquery/2.0.0/jquery.min.js.dec': true,
'resources/jquery/2.0.1/jquery.min.js.dec': true,
'resources/jquery/2.0.2/jquery.min.js.dec': true,
'resources/jquery/2.0.3/jquery.min.js.dec': true,
'resources/jquery/2.1.0/jquery.min.js.dec': true,
'resources/jquery/2.1.1/jquery.min.js.dec': true,
'resources/jquery/2.1.3/jquery.min.js.dec': true,
'resources/jquery/2.1.4/jquery.min.js.dec': true,
// jQuery UI
'resources/jqueryui/1.5.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.6.0/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.7.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.8.24/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.9.2/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.10.4/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.0/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.1/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.2/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.3/jquery-ui.min.js.dec': true,
'resources/jqueryui/1.11.4/jquery-ui.min.js.dec': true,
// Modernizr
'resources/modernizr/2.6.2/modernizr.min.js.dec': true,
'resources/modernizr/2.7.1/modernizr.min.js.dec': true,
'resources/modernizr/2.7.2/modernizr.min.js.dec': true,
'resources/modernizr/2.8.2/modernizr.min.js.dec': true,
'resources/modernizr/2.8.3/modernizr.min.js.dec': true,
// MooTools
'resources/mootools/1.1.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.1.2/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.3/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.4/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.2.5/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.0/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.3.2/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.4.1/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.4.5/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.5.0/mootools-yui-compressed.js.dec': true,
'resources/mootools/1.5.1/mootools-yui-compressed.js.dec': true,
// Prototype
'resources/prototype/1.6.0.2/prototype.js.dec': true,
'resources/prototype/1.6.0.3/prototype.js.dec': true,
'resources/prototype/1.6.1.0/prototype.js.dec': true,
'resources/prototype/1.7.0.0/prototype.js.dec': true,
'resources/prototype/1.7.1.0/prototype.js.dec': true,
'resources/prototype/1.7.2.0/prototype.js.dec': true,
'resources/prototype/1.7.3.0/prototype.js.dec': true,
// Scriptaculous
'resources/scriptaculous/1.8.1/scriptaculous.js.dec': true,
'resources/scriptaculous/1.8.2/scriptaculous.js.dec': true,
'resources/scriptaculous/1.8.3/scriptaculous.js.dec': true,
'resources/scriptaculous/1.9.0/scriptaculous.js.dec': true,
// SWFObject
'resources/swfobject/2.1/swfobject.js.dec': true,
'resources/swfobject/2.2/swfobject.js.dec': true,
// Underscore.js
'resources/underscore.js/1.3.0/underscore-min.js.dec': true,
'resources/underscore.js/1.3.1/underscore-min.js.dec': true,
'resources/underscore.js/1.3.3/underscore-min.js.dec': true,
'resources/underscore.js/1.4.0/underscore-min.js.dec': true,
'resources/underscore.js/1.4.1/underscore-min.js.dec': true,
'resources/underscore.js/1.4.2/underscore-min.js.dec': true,
'resources/underscore.js/1.4.3/underscore-min.js.dec': true,
'resources/underscore.js/1.4.4/underscore-min.js.dec': true,
'resources/underscore.js/1.5.0/underscore-min.js.dec': true,
'resources/underscore.js/1.5.1/underscore-min.js.dec': true,
'resources/underscore.js/1.5.2/underscore-min.js.dec': true,
'resources/underscore.js/1.6.0/underscore-min.js.dec': true,
'resources/underscore.js/1.7.0/underscore-min.js.dec': true,
'resources/underscore.js/1.8.0/underscore-min.js.dec': true,
'resources/underscore.js/1.8.1/underscore-min.js.dec': true,
'resources/underscore.js/1.8.2/underscore-min.js.dec': true,
'resources/underscore.js/1.8.3/underscore-min.js.dec': true,
// Web Font Loader
'resources/webfont/1.0.0/webfont.js.dec': true,
'resources/webfont/1.0.1/webfont.js.dec': true,
'resources/webfont/1.0.2/webfont.js.dec': true,
'resources/webfont/1.0.3/webfont.js.dec': true,
'resources/webfont/1.0.4/webfont.js.dec': true,
'resources/webfont/1.0.5/webfont.js.dec': true,
'resources/webfont/1.0.6/webfont.js.dec': true,
'resources/webfont/1.0.9/webfont.js.dec': true,
'resources/webfont/1.0.10/webfont.js.dec': true,
'resources/webfont/1.0.11/webfont.js.dec': true,
'resources/webfont/1.0.12/webfont.js.dec': true,
'resources/webfont/1.0.13/webfont.js.dec': true,
'resources/webfont/1.0.14/webfont.js.dec': true,
'resources/webfont/1.0.15/webfont.js.dec': true,
'resources/webfont/1.0.16/webfont.js.dec': true,
'resources/webfont/1.0.17/webfont.js.dec': true,
'resources/webfont/1.0.18/webfont.js.dec': true,
'resources/webfont/1.0.19/webfont.js.dec': true,
'resources/webfont/1.0.21/webfont.js.dec': true,
'resources/webfont/1.0.22/webfont.js.dec': true,
'resources/webfont/1.0.23/webfont.js.dec': true,
'resources/webfont/1.0.24/webfont.js.dec': true,
'resources/webfont/1.0.25/webfont.js.dec': true,
'resources/webfont/1.0.26/webfont.js.dec': true,
'resources/webfont/1.0.27/webfont.js.dec': true,
'resources/webfont/1.0.28/webfont.js.dec': true,
'resources/webfont/1.0.29/webfont.js.dec': true,
'resources/webfont/1.0.30/webfont.js.dec': true,
'resources/webfont/1.0.31/webfont.js.dec': true,
'resources/webfont/1.1.0/webfont.js.dec': true,
'resources/webfont/1.1.1/webfont.js.dec': true,
'resources/webfont/1.1.2/webfont.js.dec': true,
'resources/webfont/1.3.0/webfont.js.dec': true,
'resources/webfont/1.4.2/webfont.js.dec': true,
'resources/webfont/1.4.6/webfont.js.dec': true,
'resources/webfont/1.4.7/webfont.js.dec': true,
'resources/webfont/1.4.8/webfont.js.dec': true,
'resources/webfont/1.4.10/webfont.js.dec': true,
'resources/webfont/1.5.0/webfont.js.dec': true,
'resources/webfont/1.5.2/webfont.js.dec': true,
'resources/webfont/1.5.3/webfont.js.dec': true,
'resources/webfont/1.5.6/webfont.js.dec': true,
'resources/webfont/1.5.10/webfont.js.dec': true,
'resources/webfont/1.5.18/webfont.js.dec': true
};
/**
* 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);
/**
* Entry Point
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2016-04-04
* @license MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Main
*/
var main = {};
/**
* Private Methods
*/
main._initializeOptions = function () {
let optionDefaults = {
'showIconBadge': true,
'blockMissing': false,
'disablePrefetch': true,
'stripMetadata': true,
'whitelistedDomains': {}
};
chrome.storage.local.get(optionDefaults, function (options) {
if (options === null) {
options = optionDefaults;
}
if (options.disablePrefetch !== false) {
chrome.privacy.network.networkPredictionEnabled.set({
'value': false
});
}
chrome.storage.local.set(options);
});
};
/**
* Initializations
*/
main._initializeOptions();
chrome.runtime.getPlatformInfo(function (information) {
main.operatingSystem = information.os;
});
if (typeof chrome.browserAction.setBadgeBackgroundColor !== 'function') {
chrome.browserAction.setBadgeBackgroundColor = function () {};
chrome.browserAction.setBadgeText = function () {};
chrome.browserAction.onClicked.addListener(function () {
chrome.tabs.create({
'url': chrome.extension.getURL('pages/popup/popup.html'),
'active': false
});
});
}
chrome.browserAction.setBadgeBackgroundColor({
'color': [74, 130, 108, 255]
});
/**
* Mappings
* 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';
/**
* Mappings
*/
var mappings = {
// Google Hosted Libraries
'ajax.googleapis.com': {
'/ajax/libs/': {
'angularjs/{version}/angular.': resources.angular,
'dojo/{version}/dojo/dojo.': resources.dojo,
'ext-core/{version}/ext-core.': resources.extCore,
'ext-core/{version}/ext-core-debug.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'webfont/{version}/webfont.': resources.webfont,
// Common Shorthand Notations [Deprecated]
'dojo/1/dojo/dojo.': {
path: 'resources/dojo/1.6.1/dojo/dojo.js.dec',
type: 'application/javascript'
},
'jquery/1/jquery.': {
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
type: 'application/javascript'
},
'jqueryui/1/jquery-ui.js': {
path: 'resources/jqueryui/1.10.4/jquery-ui.min.js.dec',
type: 'application/javascript'
},
'jqueryui/1/jquery-ui.min.js': {
path: 'resources/jqueryui/1.10.4/jquery-ui.min.js.dec',
type: 'application/javascript'
},
'mootools/1/mootools-yui-compressed.': {
path: 'resources/mootools/1.1.2/mootools-yui-compressed.js.dec',
type: 'application/javascript'
},
'prototype/1/prototype.': {
path: 'resources/prototype/1.7.1.0/prototype.js.dec',
type: 'application/javascript'
},
'scriptaculous/1/scriptaculous.': {
path: 'resources/scriptaculous/1.9.0/scriptaculous.js.dec',
type: 'application/javascript'
},
'swfobject/2/swfobject.': {
path: 'resources/swfobject/2.2/swfobject.js.dec',
type: 'application/javascript'
},
'webfont/1/webfont.': {
path: 'resources/webfont/1.5.18/webfont.js.dec',
type: 'application/javascript'
}
}
},
// Microsoft Ajax CDN
'ajax.aspnetcdn.com': {
'/ajax/': {
'jquery/jquery-{version}.': resources.jQuery,
'modernizr/modernizr-{version}.': resources.modernizr
}
},
// Microsoft Ajax CDN [Deprecated]
'ajax.microsoft.com': {
'/ajax/': {
'jquery/jquery-{version}.': resources.jQuery,
'modernizr/modernizr-{version}.': resources.modernizr
}
},
// CDNJS (Cloudflare)
'cdnjs.cloudflare.com': {
'/ajax/libs/': {
'angular.js/{version}/angular.': resources.angular,
'backbone.js/{version}/backbone.': resources.backbone,
'backbone.js/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo.': resources.dojo,
'ember.js/{version}/ember.': resources.ember,
'ext-core/{version}/ext-core.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'mootools/{version}/mootools-core': resources.mootools,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscore.js/{version}/underscore.': resources.underscore,
'underscore.js/{version}/underscore-min.': resources.underscore,
'webfont/{version}/webfont': resources.webfont
}
},
// jQuery CDN (MaxCDN)
'code.jquery.com': {
'/': {
'jquery-{version}.': resources.jQuery,
'ui/{version}/jquery-ui.js': resources.jQueryUI,
'ui/{version}/jquery-ui.min.js': resources.jQueryUI,
// Common Shorthand Notations [Deprecated]
'jquery-latest.': {
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery.': {
path: 'resources/jquery/1.11.1/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.3.min.js': {
path: 'resources/jquery/1.3.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.3.js': {
path: 'resources/jquery/1.3.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.4.min.js': {
path: 'resources/jquery/1.4.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.4.js': {
path: 'resources/jquery/1.4.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.5.min.js': {
path: 'resources/jquery/1.5.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.5.js': {
path: 'resources/jquery/1.5.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.6.min.js': {
path: 'resources/jquery/1.6.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.6.js': {
path: 'resources/jquery/1.6.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.7.min.js': {
path: 'resources/jquery/1.7.0/jquery.min.js.dec',
type: 'application/javascript'
},
'jquery-1.7.js': {
path: 'resources/jquery/1.7.0/jquery.min.js.dec',
type: 'application/javascript'
}
}
},
// jsDelivr (MaxCDN)
'cdn.jsdelivr.net': {
'/': {
'angularjs/{version}/angular.': resources.angular,
'backbonejs/{version}/backbone.': resources.backbone,
'backbonejs/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo.': resources.dojo,
'emberjs/{version}/ember.': resources.ember,
'jquery/{version}/jquery.': resources.jQuery,
'jquery.ui/{version}/jquery-ui.js': resources.jQueryUI,
'jquery.ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'mootools/{version}/mootools-': resources.mootools,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscorejs/{version}/underscore.': resources.underscore,
'underscorejs/{version}/underscore-min.': resources.underscore,
'webfontloader/{version}/webfont': resources.webfont
}
},
// Yandex CDN
'yastatic.net': {
'/': {
'angularjs/{version}/angular.': resources.angular,
'backbone/{version}/backbone.': resources.backbone,
'backbone/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo/dojo.': resources.dojo,
'ext-core/{version}/ext-core.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jquery-ui/{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscore/{version}/underscore.': resources.underscore,
'underscore/{version}/underscore-min.': resources.underscore
}
},
// Yandex CDN [Deprecated]
'yandex.st': {
'/': {
'angularjs/{version}/angular.': resources.angular,
'backbone/{version}/backbone.': resources.backbone,
'backbone/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo/dojo.': resources.dojo,
'ext-core/{version}/ext-core.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jquery-ui/{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'modernizr/{version}/modernizr.': resources.modernizr,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscore/{version}/underscore.': resources.underscore,
'underscore/{version}/underscore-min.': resources.underscore
}
},
// Baidu CDN
'libs.baidu.com': {
'/': {
'backbone/{version}/backbone.': resources.backbone,
'backbone/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo.': resources.dojo,
'ext-core/{version}/ext-core.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscore/{version}/underscore.': resources.underscore,
'underscore/{version}/underscore-min.': resources.underscore,
'webfont/{version}/webfont.': resources.webfont,
'webfont/{version}/webfont_debug.': resources.webfont
}
},
// Sina Public Resources
'lib.sinaapp.com': {
'/js/': {
'angular.js/angular-{version}/angular.': resources.angular,
'backbone/{version}/backbone.': resources.backbone,
'dojo/{version}/dojo.': resources.dojo,
'ext-core/{version}/ext-core.': resources.extCore,
'ext-core/{version}/ext-core-debug.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jquery-ui/{version}/jquery-ui.js': resources.jQueryUI,
'jquery-ui/{version}/jquery-ui.min.js': resources.jQueryUI,
'mootools/{version}/mootools.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'underscore/{version}/underscore.': resources.underscore,
'underscore/{version}/underscore-min.': resources.underscore,
'webfont/{version}/webfont.': resources.webfont,
'webfont/{version}/webfont_debug.': resources.webfont
}
},
// UpYun Library
'upcdn.b0.upaiyun.com': {
'/libs/': {
'dojo/dojo-{version}.': resources.dojo,
'emberjs/emberjs-{version}.': resources.ember,
'jquery/jquery-{version}.': resources.jQuery,
'jqueryui/jquery.ui-{version}.js': resources.jQueryUI,
'jqueryui/jquery.ui-{version}.min.js': resources.jQueryUI,
'modernizr/modernizr-{version}.': resources.modernizr,
'mootoolscore/mootools.core-{version}.': resources.mootools
}
}
};
/**
* Request Analyzer
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2016-04-11
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Request Analyzer
*/
var requestAnalyzer = {};
/**
* Constants
*/
const MAPPING_FILE_EXPRESSION = new RegExp('\.map$', 'i');
const VERSION_EXPRESSION = /(?:\d{1,2}\.){1,3}\d{1,2}/;
const VERSION_PLACEHOLDER = '{version}';
const WEB_DOMAIN_EXPRESSION = /:\/\/(.[^\/]+)(.*)/;
const WEB_PREFIX_VALUE = 'www.';
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
/**
* Public Methods
*/
requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
let initiatorHost;
try {
initiatorHost = tabDetails.url.match(WEB_DOMAIN_EXPRESSION)[1];
} catch (exception) {
initiatorHost = 'example.org';
}
if (initiatorHost && requestAnalyzer.whitelistedDomains[requestAnalyzer._normalizeDomain(initiatorHost)]) {
return false;
}
// Only requests of type GET can be valid candidates.
return requestDetails.method === 'GET';
};
requestAnalyzer.getLocalTarget = function (requestDetails) {
let destinationHost, destinationPath, hostMappings, basePath, resourceMappings;
destinationHost = requestDetails.url.match(WEB_DOMAIN_EXPRESSION)[1];
destinationPath = requestDetails.url.match(WEB_DOMAIN_EXPRESSION)[2];
// Use the proper mappings for the targeted host.
hostMappings = mappings[destinationHost];
// Resource mapping files are never locally available.
if (MAPPING_FILE_EXPRESSION.test(destinationPath)) {
return false;
}
basePath = requestAnalyzer._matchBasePath(hostMappings, destinationPath);
resourceMappings = hostMappings[basePath];
if (!resourceMappings) {
return false;
}
// Return either the local target's path or false.
return requestAnalyzer._findLocalTarget(resourceMappings, basePath, destinationHost, destinationPath);
};
/**
* Private Methods
*/
requestAnalyzer._matchBasePath = function (hostMappings, channelPath) {
for (let basePath of Object.keys(hostMappings)) {
if (channelPath.startsWith(basePath)) {
return basePath;
}
}
return false;
};
requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channelHost, channelPath) {
var resourcePath, versionNumber, resourcePattern;
resourcePath = channelPath.replace(basePath, '');
versionNumber = resourcePath.match(VERSION_EXPRESSION);
resourcePattern = resourcePath.replace(versionNumber, VERSION_PLACEHOLDER);
for (let resourceMold of Object.keys(resourceMappings)) {
if (resourcePattern.startsWith(resourceMold)) {
let targetPath, version;
targetPath = resourceMappings[resourceMold].path;
targetPath = targetPath.replace(VERSION_PLACEHOLDER, versionNumber);
version = versionNumber && versionNumber[0] || targetPath.match(VERSION_EXPRESSION);
// Prepare and return a local target.
return {
source: channelHost,
version: version,
path: targetPath
};
}
}
return false;
};
requestAnalyzer._applyWhitelistedDomains = function () {
//noinspection JSUnresolvedVariable
chrome.storage.local.get('whitelistedDomains', function (items) {
requestAnalyzer.whitelistedDomains = items.whitelistedDomains || {};
});
};
requestAnalyzer._normalizeDomain = function (domain) {
domain = domain.toLowerCase().trim();
if (domain.startsWith(WEB_PREFIX_VALUE)) {
domain = domain.slice(WEB_PREFIX_LENGTH);
}
return domain;
};
/**
* Initializations
*/
requestAnalyzer.whitelistedDomains = {};
requestAnalyzer._applyWhitelistedDomains();
/**
* Event Handlers
*/
chrome.storage.onChanged.addListener(requestAnalyzer._applyWhitelistedDomains);
/**
* Resources
* 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';
/**
* Resources
*/
var resources = {
// AngularJS
angular: {
path: 'resources/angularjs/{version}/angular.min.js.dec',
type: 'application/javascript'
},
// Backbone.js
backbone: {
path: 'resources/backbone.js/{version}/backbone-min.js.dec',
type: 'application/javascript'
},
// Dojo
dojo: {
path: 'resources/dojo/{version}/dojo/dojo.js.dec',
type: 'application/javascript'
},
// Ember.js
ember: {
path: 'resources/ember.js/{version}/ember.min.js.dec',
type: 'application/javascript'
},
// Ext Core
extCore: {
path: 'resources/ext-core/{version}/ext-core.js.dec',
type: 'application/javascript'
},
// jQuery
jQuery: {
path: 'resources/jquery/{version}/jquery.min.js.dec',
type: 'application/javascript'
},
// jQuery UI
jQueryUI: {
path: 'resources/jqueryui/{version}/jquery-ui.min.js.dec',
type: 'application/javascript'
},
// Modernizr
modernizr: {
path: 'resources/modernizr/{version}/modernizr.min.js.dec',
type: 'application/javascript'
},
// MooTools
mootools: {
path: 'resources/mootools/{version}/mootools-yui-compressed.js.dec',
type: 'application/javascript'
},
// Prototype
prototypeJS: {
path: 'resources/prototype/{version}/prototype.js.dec',
type: 'application/javascript'
},
// Scriptaculous
scriptaculous: {
path: 'resources/scriptaculous/{version}/scriptaculous.js.dec',
type: 'application/javascript'
},
// SWFObject
swfobject: {
path: 'resources/swfobject/{version}/swfobject.js.dec',
type: 'application/javascript'
},
// Underscore.js
underscore: {
path: 'resources/underscore.js/{version}/underscore-min.js.dec',
type: 'application/javascript'
},
// Web Font Loader
webfont: {
path: 'resources/webfont/{version}/webfont.js.dec',
type: 'application/javascript'
}
};
/**
* 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 REQUEST_HEADERS = 'requestHeaders';
/**
* 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 (stateManager.showIconBadge === true) {
if (injectionCount > 0) {
chrome.browserAction.setBadgeText({
tabId: tabIdentifier,
text: injectionCount.toString()
});
} else {
chrome.browserAction.setBadgeText({
tabId: tabIdentifier,
text: ''
});
}
}
if (isNaN(interceptor.amountInjected)) {
chrome.storage.local.get('amountInjected', function (items) {
interceptor.amountInjected = items.amountInjected;
chrome.storage.local.set({
'amountInjected': ++interceptor.amountInjected
});
});
} else {
chrome.storage.local.set({
'amountInjected': ++interceptor.amountInjected
});
}
};
stateManager.addDomainToWhitelist = function (domain) {
return new Promise((resolve) => {
let whitelistedDomains = requestAnalyzer.whitelistedDomains;
whitelistedDomains[domain] = true;
chrome.storage.local.set({whitelistedDomains}, resolve);
});
};
stateManager.deleteDomainFromWhitelist = function (domain) {
return new Promise((resolve) => {
let whitelistedDomains = requestAnalyzer.whitelistedDomains;
delete whitelistedDomains[domain];
chrome.storage.local.set({whitelistedDomains}, resolve);
});
};
/**
* Private Methods
*/
stateManager._createTab = function (tab) {
let tabIdentifier, requestFilters;
tabIdentifier = tab.id;
stateManager.tabs[tabIdentifier] = {
'injections': {}
};
requestFilters = {
'tabId': tabIdentifier,
'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;
}
if (stateManager.showIconBadge === true) {
chrome.browserAction.setBadgeText({
tabId: tabIdentifier,
text: ''
});
}
if (stateManager.tabs[tabIdentifier]) {
stateManager.tabs[tabIdentifier].injections = {};
}
};
stateManager._stripMetadata = 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
};
};
stateManager._handleStorageChanged = function (changes) {
if ('showIconBadge' in changes) {
stateManager.showIconBadge = changes.showIconBadge.newValue;
if (changes.showIconBadge.newValue !== true) {
chrome.tabs.query({}, function (tabs) {
tabs.forEach(stateManager._removeIconBadgeFromTab);
});
}
}
if ('stripMetadata' in changes) {
let onBeforeSendHeaders;
onBeforeSendHeaders = chrome.webRequest.onBeforeSendHeaders;
onBeforeSendHeaders.removeListener(stateManager._stripMetadata, {
'urls': stateManager.validHosts
}, [BLOCKING_ACTION, REQUEST_HEADERS]);
if (changes.stripMetadata.newValue !== false) {
onBeforeSendHeaders.addListener(stateManager._stripMetadata, {
'urls': stateManager.validHosts
}, [BLOCKING_ACTION, REQUEST_HEADERS]);
}
}
};
stateManager._removeIconBadgeFromTab = function (tab) {
chrome.browserAction.setBadgeText({
tabId: tab.id,
text: ''
});
};
/**
* Initializations
*/
stateManager.requests = {};
stateManager.tabs = {};
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);
});
chrome.storage.local.get('showIconBadge', function (items) {
stateManager.showIconBadge = items.showIconBadge || true;
});
/**
* 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(stateManager._stripMetadata, {
'urls': stateManager.validHosts
}, [BLOCKING_ACTION, REQUEST_HEADERS]);
chrome.storage.onChanged.addListener(stateManager._handleStorageChanged);
"project_identifier": "decentraleyes"
"preserve_hierarchy": true
"files":
-
"source": "/_locales/en_US/messages.json"
"translation": "/_locales/%locale_with_underscore%/messages.json"
"languages_mapping":
"locale_with_underscore":
"ar": "ar"
"bg": "bg"
"da": "da"
"de": "de"
"el": "el"
"eo": "eo"
"es-ES": "es"
"fi": "fi"
"fr": "fr"
"he": "he"
"hu": "hu"
"id": "id"
"is": "is"
"it": "it"
"ja": "ja"
"nl": "nl"
"pl": "pl"
"ro": "ro"
"ru": "ru"
"sv-SE": "sv"
"tr": "tr"