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 459 additions and 46 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 "安裝以來,由本機檔案所取代的 CDN 資源數量。">
{
"locales": []
}
{
"manifest_version": 2,
"name": "Decentraleyes",
"version": "1.3.7",
"author": "Thomas Rientjes",
"default_locale": "en_US",
"description": "__MSG_extensionDescription__",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"96": "icons/icon96.png",
"128": "icons/icon128.png"
},
"permissions": [
"*://*/*",
"storage",
"webRequest",
"tabs",
"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/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;
font-family: Noto Sans, Arial, sans-serif !important;
font-size: 75%;
margin: 0;
padding: 0;
width: 350px;
}
h1 {
font-size: 36px;
margin: 12px 0 0 0;
text-align: center;
}
.title {
font-weight: bold;
margin-bottom: 2px;
text-align: center;
}
.description {
color: #777;
font-style: italic;
margin-bottom: 16px;
text-align: center;
}
.popup-content {
padding: 10px;
}
.button-panel {
padding: 6px;
text-align: right;
}
.text-link {
color: #adadad;
float: left;
padding-left: 4px;
padding-top: 5px;
text-decoration: none;
}
.text-link:hover {
color: #777;
text-decoration: underline;
}
#extension-options-overlay-header {
align-items: center;
border-bottom: solid lightgray 1px;
display: flex;
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 class="popup-content">
<h1 id="injection-counter"></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"><span class="fa"></span></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;
});
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
......
@/*
/*
AngularJS v1.0.5
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......
@/*
/*
AngularJS v1.0.6
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......
@/*
/*
AngularJS v1.0.8
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
......