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 707 additions and 67 deletions
<!ENTITY options.addNotice.title "Добавить комментарии к локальным файлам">
<!ENTITY options.addNotice.description "Автоматически добавляет комментарий к скачанным «документам» для обозначения локальной «доставки».">
<!ENTITY options.blockMissing.title "Блокировать запросы недостающих ресурсов">
<!ENTITY options.blockMissing.description "Отменить перехваченный запрос, если требуемый ресурс не доступен локально (может «ломать» сайты).">
<!ENTITY options.domainWhitelist.title "Исключить домены из проверки">
<!ENTITY options.domainWhitelist.description "«Белый список» доменов. Контент, расположенный на них не будет фильтроваться. Записи (при количестве более одной) разделяются точкой с запятой (;).">
<!ENTITY options.amountInjected.title "Счётчик файлов «доставленных» локально">
<!ENTITY options.amountInjected.description "Количество локально «доставленных» файлов с момента установки.">
<!ENTITY options.addNotice.title "Kommentera hämtade filer">
<!ENTITY options.addNotice.description "Lägg automatiskt in en notis i böjan av hämtade filer för att påvisa att de finns lokalt.">
<!ENTITY options.blockMissing.title "Blockera förfrågningar när resurs saknas">
<!ENTITY options.blockMissing.description "Avbryt uppsnappning om resurs inte finns lokalt.">
<!ENTITY options.domainWhitelist.title "Utelämna domäner från uppsnappningar">
<!ENTITY options.domainWhitelist.description "Ange domäner för vitlistning. Spearera domänerna med semikolon (;).">
<!ENTITY options.amountInjected.title "Räknare för lokalt insatta resurser">
<!ENTITY options.amountInjected.description "Antalet insatta Content Delivery Network-resurser sedan installationen.">
<!ENTITY options.addNotice.title "添加注释到从本地获取的文件">
<!ENTITY options.addNotice.description "自动预置一个通知到获取的文档以标记从本地交付。">
<!ENTITY options.blockMissing.title "阻止缺失资源的请求">
<!ENTITY options.blockMissing.description "取消被拦截的请求,如果请求的资源在本地不可用。">
<!ENTITY options.domainWhitelist.title "排除要检查的域名">
<!ENTITY options.domainWhitelist.description "输入白名单的域名。用分号 (;) 分隔多项。">
<!ENTITY options.amountInjected.title "本地发送资源的计数器">
<!ENTITY options.amountInjected.description "自安装以来,从本地的“内容交付网络”发送的资源总量。">
<!ENTITY options.addNotice.title "在從本機取得的檔案中加入註解">
<!ENTITY options.addNotice.description "自動在取回的文件前方加入提示,以表示這是從本機提供的檔案。">
<!ENTITY options.blockMissing.title "封鎖缺少資源時的連線請求">
<!ENTITY options.blockMissing.description "若本機沒有所請求的資源,就取消該請求。">
<!ENTITY options.domainWhitelist.title "要排除檢查的網域">
<!ENTITY options.domainWhitelist.description "輸入網域即可將其加入白名單。使用分號(;)分隔多個網域。">
<!ENTITY options.amountInjected.title "由本機提供的資源計數器">
<!ENTITY options.amountInjected.description "安裝以來,由本機檔案所取代的 CDN 資源數量。">
{
"locales": []
}
{
"manifest_version": 2,
"name": "Decentraleyes",
"version": "1.3.7.5",
"author": "Thomas Rientjes",
"default_locale": "en_US",
"description": "__MSG_extensionDescription__",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"96": "icons/icon96.png",
"128": "icons/icon128.png"
},
"permissions": [
"*://*/*",
"privacy",
"storage",
"tabs",
"webRequest",
"webRequestBlocking"
],
"background": {
"page": "pages/background/background.html"
},
"browser_action": {
"default_icon": {
"18": "icons/action/icon18.png",
"19": "icons/action/icon19.png",
"32": "icons/action/icon32.png",
"36": "icons/action/icon36.png",
"38": "icons/action/icon38.png",
"64": "icons/action/icon64.png"
},
"default_popup": "pages/popup/popup.html"
},
"options_ui": {
"page": "pages/options/options.html",
"chrome_style": true
},
"web_accessible_resources": [
"resources/*"
]
}
<?xml version="1.0" ?>
<!DOCTYPE vbox SYSTEM "chrome://decentraleyes/locale/options.dtd">
<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.addNotice" pref-name="addNotice" title="&options.addNotice.title;" type="bool">&options.addNotice.description;</setting>
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.blockMissing" pref-name="blockMissing" title="&options.blockMissing.title;" type="bool">&options.blockMissing.description;</setting>
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.domainWhitelist" pref-name="domainWhitelist" title="&options.domainWhitelist.title;" type="string">&options.domainWhitelist.description;</setting>
<setting data-jetpack-id="jid1-BoFifL9Vbdl2zQ@jetpack" pref="extensions.jid1-BoFifL9Vbdl2zQ@jetpack.amountInjected" pref-name="amountInjected" title="&options.amountInjected.title;" type="integer">&options.amountInjected.description;</setting>
</vbox>
{
"description": "Local emulation of Content Delivery Networks.",
"author": "Thomas Rientjes",
"license": "MPL-2.0",
"title": "Decentraleyes",
"version": "1.3.7",
"main": "lib/main.js",
"homepage": "https://addons.mozilla.org/firefox/addon/decentraleyes",
"name": "decentraleyes",
"id": "jid1-BoFifL9Vbdl2zQ@jetpack",
"permissions": {
"multiprocess": true
},
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1",
"seamonkey": ">=2.0a1 <=2.46",
"{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}": ">=27.1.0b1"
}
}
<!DOCTYPE html>
<html>
<head>
<title>Decentraleyes Background</title>
</head>
<body>
<script src="../../core/files.js"></script>
<script src="../../core/resources.js"></script>
<script src="../../core/mappings.js"></script>
<script src="../../core/state-manager.js"></script>
<script src="../../core/request-analyzer.js"></script>
<script src="../../core/interceptor.js"></script>
<script src="../../core/main.js"></script>
</body>
</html>
section {
padding-left: 32px;
}
section .title {
-webkit-margin-start: -32px;
font-weight: bold;
}
section .description {
font-style: italic;
margin-bottom: 16px;
}
.button-panel {
text-align: right;
}
<!DOCTYPE html>
<html>
<head>
<title>Decentraleyes Options</title>
<link rel="stylesheet" type="text/css" href="options.css">
</head>
<body>
<script src="options.js"></script>
<section>
<label class="title">
<input data-option="blockMissing" type="checkbox">
<span data-i18n-content="blockMissingTitle"></span>
</label>
<div class="description" data-i18n-content="blockMissingDescription"></div>
</section>
<section>
<div class="title" data-i18n-content="domainWhitelistTitle"></div>
<input data-option="domainWhitelist" type="text">
<div class="description" data-i18n-content="domainWhitelistDescription"></div>
</section>
</body>
</html>
/**
* Main Options Page
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2016-08-09
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Constants
*/
const WEB_PREFIX_VALUE = 'www.';
const WEB_PREFIX_LENGTH = WEB_PREFIX_VALUE.length;
const VALUE_SEPARATOR = ';';
/**
* Initializations
*/
document.addEventListener('DOMContentLoaded', function () {
let i18nElements, saveButtonElement, blockMissingElement, domainWhitelistElement;
i18nElements = document.querySelectorAll('[data-i18n-content]');
saveButtonElement = document.getElementById('save-button');
i18nElements.forEach(function (i18nElement) {
let i18nMessageName = i18nElement.getAttribute('data-i18n-content');
i18nElement.innerHTML = chrome.i18n.getMessage(i18nMessageName);
});
blockMissingElement = document.querySelector('[data-option=blockMissing]');
domainWhitelistElement = document.querySelector('[data-option=domainWhitelist]');
chrome.storage.local.get(['blockMissing', 'whitelistedDomains'], function (items) {
let whitelistedDomains = items.whitelistedDomains || {};
let domainWhitelist = '';
Object.keys(whitelistedDomains).forEach(function (domain) {
domainWhitelist = domainWhitelist + domain + ';';
});
domainWhitelist = domainWhitelist.slice(0, -1);
blockMissingElement.checked = items.blockMissing || false;
domainWhitelistElement.value = domainWhitelist || '';
});
let optionChangedHandler = function () {
let whitelistedDomains = {};
domainWhitelistElement.value.split(VALUE_SEPARATOR).forEach(function (domain) {
whitelistedDomains[_normalizeDomain(domain)] = true;
});
chrome.storage.local.set({
'blockMissing': blockMissingElement.checked,
'whitelistedDomains': whitelistedDomains
});
};
blockMissingElement.addEventListener('change', optionChangedHandler);
domainWhitelistElement.addEventListener('keyup', optionChangedHandler);
});
/**
* Private Methods
*/
function _normalizeDomain(domain) {
domain = domain.toLowerCase().trim();
if (domain.startsWith(WEB_PREFIX_VALUE)) {
domain = domain.slice(WEB_PREFIX_LENGTH);
}
return domain;
}
pages/popup/icon.png

3.74 KiB

body {
background-color: #f0f0f0;
color: #555;
cursor: default;
font-family: Noto Sans, Arial, sans-serif !important;
font-size: 75%;
margin: 0;
padding: 0;
user-select: none;
width: 350px;
}
h1 {
font-size: 36px;
margin: 0;
text-align: center;
}
.title {
font-weight: bold;
margin-bottom: 2px;
text-align: center;
}
.description {
color: #777;
font-style: italic;
margin-bottom: 18px;
text-align: center;
}
.popup-content {
padding: 0;
}
.list {
border-bottom: 1px solid #d8d8d8;
margin: 0;
padding: 10px 8px;
}
.list-item {
background-color: #f7f7f7;
border-bottom: none !important;
border: 1px solid #e4e4e4;
color: #737373;
font-weight: 600;
list-style: none;
margin: 0;
padding: 10px;
}
.sub-list {
align-items: center;
background-color: #ececec;
border-bottom: none !important;
border: 1px solid #e0e0e0;
box-shadow: inset 0px 2px 10px #e2e2e2;
list-style: none;
padding-left: 8px;
padding: 0;
}
.sub-list:last-child {
border-bottom: 1px solid #e0e0e0 !important;
}
.sub-list-item {
border-bottom: 1px solid #e0e0e0;
color: #737373;
font-weight: bold;
padding: 10px;
}
.sub-list-item:last-child {
border-bottom: none;
}
.side-note {
color: #a5a5a5;
font-style: italic;
font-weight: normal;
}
.badge {
background-color: #6bb798;
border-radius: 10px;
color: #fff;
font-family: monospace;
font-size: 13px;
font-weight: bold;
margin-right: 8px;
padding: 3px 15px;
}
.button-panel {
padding: 6px;
text-align: right;
}
.btn-sm {
font-size: 12px !important;
}
.text-link {
color: #bdbdbd;
float: left;
font-size: 13px;
padding-left: 4px;
padding-top: 2px;
text-decoration: none;
}
.text-link:hover {
color: #777;
text-decoration: underline;
}
#injection-counter {
padding-top: 14px;
}
#extension-options-overlay-header {
align-items: center;
border-bottom: solid lightgray 1px;
display: flex;
padding: 4px 0;
position: relative;
}
#extension-options-overlay-icon {
padding: 8px;
}
#extension-options-overlay-icon {
height: 32px;
width: 32px;
}
#extension-options-overlay-title {
font-size: 14px;
font-weight: bold;
padding-left: 0;
}
:enabled:hover:-webkit-any(
select,
input[type='checkbox'],
input[type='radio'],
:-webkit-any(
button,
input[type='button'],
input[type='submit']):not(.custom-appearance)) {
background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
border-color: rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
inset 0 1px 2px rgba(255, 255, 255, 0.95);
color: black;
}
:enabled:active:-webkit-any(
select,
input[type='checkbox'],
input[type='radio'],
:-webkit-any(
button,
input[type='button'],
input[type='submit']):not(.custom-appearance)) {
background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
box-shadow: none;
text-shadow: none;
}
:enabled:focus:-webkit-any(
select,
input[type='checkbox'],
input[type='number'],
input[type='password'],
input[type='radio'],
input[type='search'],
input[type='text'],
input[type='url'],
input:not([type]),
:-webkit-any(
button,
input[type='button'],
input[type='submit']):not(.custom-appearance)) {
/* OVERRIDE */
-webkit-transition: border-color 200ms;
/* We use border color because it follows the border radius (unlike outline).
* This is particularly noticeable on mac. */
border-color: rgb(77, 144, 254);
outline: none;
}
:-webkit-any(button,
input[type='button'],
input[type='submit']):not(.custom-appearance),
select,
input[type='checkbox'],
input[type='radio'] {
-webkit-appearance: none;
-webkit-user-select: none;
background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 2px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
inset 0 1px 2px rgba(255, 255, 255, 0.75);
color: #444;
font: inherit;
margin: 0 1px 0 0;
outline: none;
text-shadow: 0 1px 0 rgb(240, 240, 240);
}
:-webkit-any(button,
input[type='button'],
input[type='submit']):not(.custom-appearance),
select {
min-height: 2em;
min-width: 4em;
padding-top: 1px;
padding-bottom: 1px;
}
:-webkit-any(button,
input[type='button'],
input[type='submit']):not(.custom-appearance) {
-webkit-padding-end: 10px;
-webkit-padding-start: 10px;
}
<!DOCTYPE html>
<html>
<head>
<title>Decentraleyes Popup</title>
<link rel="stylesheet" type="text/css" href="popup.css">
</head>
<body>
<script src="popup.js"></script>
<div id="extension-options-overlay-header">
<img id="extension-options-overlay-icon" src="icon.png">
<div id="extension-options-overlay-title">Decentraleyes</div>
</div>
<section id="popup-content" class="popup-content">
<h1 id="injection-counter">3</h1>
<div class="title" data-i18n-content="amountInjectedTitle"></div>
<div class="description" data-i18n-content="amountInjectedDescription"></div>
</section>
<section class="button-panel">
<a href="https://decentraleyes.org/test" target="_blank" class="text-link">decentraleyes.org/test</a>
<button id="options-button" class="btn-sm">Options</button>
</section>
</body>
</html>
/**
* Main Popup Page
* Belongs to Decentraleyes.
*
* @author Thomas Rientjes
* @since 2016-08-09
* @license MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
/**
* Initializations
*/
document.addEventListener('DOMContentLoaded', function () {
let i18nElements, saveButtonElement, blockMissingElement, domainWhitelistElement;
i18nElements = document.querySelectorAll('[data-i18n-content]');
i18nElements.forEach(function (i18nElement) {
let i18nMessageName = i18nElement.getAttribute('data-i18n-content');
i18nElement.innerHTML = chrome.i18n.getMessage(i18nMessageName);
});
chrome.storage.local.get('amountInjected', function (items) {
let amountInjected = items.amountInjected || 0;
document.getElementById('injection-counter').innerHTML = amountInjected;
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.runtime.getBackgroundPage(function (backgroundPage) {
let injections, injectionOverview;
injections = backgroundPage.stateManager.tabs[tabs[0].id].injections;
injectionOverview = {};
for (let injection in injections) {
let injectionSource, libraryName;
injection = injections[injection];
injectionSource = injection.source;
injectionOverview[injectionSource] = injectionOverview[injectionSource] || [];
injectionOverview[injectionSource].push({
'path': injection.path,
'version': injection.version,
'source': injection.source
});
}
let listElement = document.createElement('ul');
listElement.setAttribute('class', 'list');
for (let injectionSource in injectionOverview) {
let cdn, listItemElement, badgeElement, badgeTextNode, cdnName, cdnNameTextNode, subListElement;
cdn = injectionOverview[injectionSource];
listItemElement = document.createElement('li');
listItemElement.setAttribute('class', 'list-item');
badgeElement = document.createElement('span');
badgeElement.setAttribute('class', 'badge');
badgeTextNode = document.createTextNode(cdn.length);
badgeElement.appendChild(badgeTextNode);
switch (injectionSource) {
case 'ajax.googleapis.com':
cdnName = 'Google Hosted Libraries';
break;
case 'ajax.aspnetcdn.com':
cdnName = 'Microsoft Ajax CDN';
break;
case 'ajax.microsoft.com':
cdnName = 'Microsoft Ajax CDN [Deprecated]';
break;
case 'cdnjs.cloudflare.com':
cdnName = 'CDNJS (Cloudflare)';
break;
case 'code.jquery.com':
cdnName = 'jQuery CDN (MaxCDN)';
break;
case 'cdn.jsdelivr.net':
cdnName = 'jsDelivr (MaxCDN)';
break;
case 'yastatic.net':
cdnName = 'Yandex CDN';
break;
case 'yandex.st':
cdnName = 'Yandex CDN [Deprecated]';
break;
case 'libs.baidu.com':
cdnName = 'Baidu CDN';
break;
case 'lib.sinaapp.com':
cdnName = 'Sina Public Resources';
break;
case 'upcdn.b0.upaiyun.com':
cdnName = 'UpYun Library';
break;
}
cdnNameTextNode = document.createTextNode(cdnName);
listItemElement.appendChild(badgeElement);
listItemElement.appendChild(cdnNameTextNode);
listElement.appendChild(listItemElement);
subListElement = document.createElement('ul');
subListElement.setAttribute('class', 'sub-list');
listElement.appendChild(subListElement);
cdn.forEach(function (injection) {
let subListItemElement, resourcePathDetails, resourceFilename, resourceName,
resourceNameTextNode, sideNoteElement, sideNoteTextNode;
subListItemElement = document.createElement('li');
subListItemElement.setAttribute('class', 'sub-list-item');
resourcePathDetails = injection.path.split('/');
resourceFilename = resourcePathDetails[resourcePathDetails.length - 1];
switch (resourceFilename) {
case 'angular.min.js.dec':
resourceName = 'AngularJS';
break;
case 'backbone-min.js.dec':
resourceName = 'Backbone.js';
break;
case 'dojo.js.dec':
resourceName = 'Dojo';
break;
case 'ember.min.js.dec':
resourceName = 'Ember.js';
break;
case 'ext-core.js.dec':
resourceName = 'Ext Core';
break;
case 'jquery.min.js.dec':
resourceName = 'jQuery';
break;
case 'jquery-ui.min.js.dec':
resourceName = 'jQuery UI';
break;
case 'modernizr.min.js.dec':
resourceName = 'Modernizr';
break;
case 'mootools-yui-compressed.js.dec':
resourceName = 'MooTools';
break;
case 'prototype.js.dec':
resourceName = 'Prototype';
break;
case 'scriptaculous.js.dec':
resourceName = 'Scriptaculous';
break;
case 'swfobject.js.dec':
resourceName = 'SWFObject';
break;
case 'underscore-min.js.dec':
resourceName = 'Underscore.js';
break;
case 'webfont.js.dec':
resourceName = 'Web Font Loader';
break;
}
resourceNameTextNode = document.createTextNode('- ' + resourceName);
subListItemElement.appendChild(resourceNameTextNode);
sideNoteElement = document.createElement('span');
sideNoteElement.setAttribute('class', 'side-note');
sideNoteTextNode = document.createTextNode(' v' + injection.version);
sideNoteElement.appendChild(sideNoteTextNode);
subListItemElement.appendChild(sideNoteElement);
subListElement.appendChild(subListItemElement);
});
}
if (Object.keys(injectionOverview).length > 0) {
let popupContentElement = document.getElementById('popup-content');
let injectionCounterElement = document.getElementById('injection-counter');
popupContentElement.insertBefore(listElement, injectionCounterElement);
}
});
});
});
document.getElementById('options-button').addEventListener('click', function () {
chrome.runtime.openOptionsPage();
});
});
@/*
/*
AngularJS v1.0.1
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......
@/*
/*
AngularJS v1.0.2
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......
@/*
/*
AngularJS v1.0.3
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......
@/*
/*
AngularJS v1.0.4
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......