-
-
-
-
-
+
+

+
-
- URL:
-
+
-
+
+
+
+
+
+
+
diff --git a/chromium/pages/cancel/style.css b/chromium/pages/cancel/style.css
index b3324e1aa28b..aeba151a0749 100644
--- a/chromium/pages/cancel/style.css
+++ b/chromium/pages/cancel/style.css
@@ -1,13 +1,33 @@
+@import "../main.css";
+
body {
- margin-top: 6em;
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ margin: 2% auto;
font-size: 12pt;
font-family: sans-serif;
line-height: 150%;
+ row-gap: 16px;
}
-.content {
- margin: auto;
- max-width: 600px;
+/*---------
+# GRID LAYOUT
+---------*/
+.banner {
+ grid-column: 2;
+ grid-row: 1;
+}
+.explainer {
+ grid-column: 2;
+ grid-row: 2;
+}
+.copy_block {
+ grid-column: 2;
+ grid-row: 3;
+}
+.button_options {
+ grid-column: 2;
+ grid-row: 4;
}
h1 {
@@ -20,38 +40,91 @@ h1 img {
}
#url-paragraph {
- display: block;
+ display: inline-flex;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
-button {
+.ease_button {
background-color: #ec1e1e;
border: 1px solid #ec1e1e;
border-radius: 4px;
color: #fff;
cursor: pointer;
padding: 0.5em 1em;
- display: block;
float: none;
font-size: 12pt;
+ font-weight: normal;
margin: 8px 0;
line-height: 150%;
}
-button:hover {
- background-color: #fff;
- color: #ec1e1e;
-}
-
button:last-child {
margin: 0;
}
-@media screen and (max-width: 550px) {
- button {
+#url-value{
+ float: left;
+ font-weight: bold;
+ margin: 2% 2% 0 0;
+}
+#copy-url, #open-url-button{
+ background-color: var(--light-grey) !important;
+ border: 1px solid var(--text-secondary) !important;
+}
+#copy-url {
+ color: var(--text-secondary) !important;
+ font-size: 14px;
+}
+#open-url-button {
+ color: #666666 !important;
+}
+#copy-url:hover, #open-url-button:hover {
+ background-color: var(--text-secondary) !important;
+ border: 1px solid var(--text-secondary) !important;
+ color: var(--light-grey) !important;
+}
+
+@media screen and (max-width: 800px) {
+ body {
+ grid-template-columns: 1fr;
+ margin: 5%;
+ }
+ .banner {
+ grid-row: 1;
+ }
+ .explainer {
+ grid-row: 2;
+ }
+ .copy_block {
+ grid-row: 3;
+ }
+ .button_options {
+ grid-row: 4;
+ }
+ .ease_button {
width: 100%;
margin: 8px 0;
}
}
+
+@media (prefers-color-scheme: dark) {
+ body {
+ background-color: #202023;
+ color: #f9f9fa;
+ }
+
+ a {
+ color: #45a1ff;
+ }
+
+ .ease_button {
+ color: #202023;
+ }
+
+ .ease_button:hover {
+ background-color: #202023;
+ border-color: #ec1e1e;
+ }
+}
diff --git a/chromium/pages/cancel/ux.js b/chromium/pages/cancel/ux.js
index 7e6199ac861e..d13dfdfb711a 100644
--- a/chromium/pages/cancel/ux.js
+++ b/chromium/pages/cancel/ux.js
@@ -6,7 +6,7 @@ let observer;
document.addEventListener("DOMContentLoaded", () => {
const explainer = document.querySelector("[data-i18n=cancel_he_blocking_explainer]");
observer = new MutationObserver(() => {
- replaceLink(explainer)
+ replaceLink(explainer);
});
if (explainer.innerText.length > 0) {
replaceLink(explainer);
@@ -45,27 +45,79 @@ function displayURL() {
const originURLLink = document.getElementById('url-value');
const openURLButton = document.getElementById('open-url-button');
const openHttpOnce = document.getElementById('http-once-button');
+ const copyButton = document.getElementById('copy-url');
const url = new URL(originURL);
originURLLink.innerText = originURL;
originURLLink.href = originURL;
openURLButton.addEventListener("click", function() {
- if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) {
- sendMessage("disable_on_site", url.host, () => {
- window.location = originURL;
- });
- }
+ sendMessage("disable_on_site", url.host, () => {
+ window.location = originURL;
+ });
return false;
});
- openHttpOnce.addEventListener("click", function() {
- if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) {
- sendMessage("disable_on_site_once", url.host, () => {
- window.location = originURL;
- });
+ // Copy URL Feature on EASE
+
+ function copyLinkAlternate() {
+ let isSuccessful = false;
+
+ const sel = window.getSelection();
+
+ try {
+ sel.removeAllRanges();
+
+ const range = document.createRange();
+ range.selectNode(originURLLink);
+
+ sel.addRange(range);
+
+ isSuccessful = document.execCommand("copy");
+
+ sel.removeAllRanges();
+
+ return isSuccessful;
+ } catch (err) {
+ console.error(err);
+
+ sel.removeAllRanges();
+
+ return false;
}
+ }
+
+ async function copyLink() {
+ try {
+ await navigator.clipboard.writeText(originURL);
+ return true;
+ } catch (err) {
+ return copyLinkAlternate();
+ }
+ }
+
+ let restoreTimeout = null;
+
+ copyButton.addEventListener("click", async () => {
+ if (await copyLink()) {
+ copyButton.innerText = chrome.i18n.getMessage("cancel_copied_url");
+
+ if (restoreTimeout !== null) {
+ clearTimeout(restoreTimeout);
+ }
+
+ restoreTimeout = setTimeout(() => {
+ copyButton.innerText = chrome.i18n.getMessage("cancel_copy_url");
+ restoreTimeout = null;
+ }, 1500);
+ }
+ });
+
+ openHttpOnce.addEventListener("click", function() {
+ sendMessage("disable_on_site_once", url.host, () => {
+ window.location = originURL;
+ });
return false;
});
diff --git a/chromium/pages/debugging-rulesets/ux.js b/chromium/pages/debugging-rulesets/ux.js
index 49b9c7e69df7..0df93d8dd080 100644
--- a/chromium/pages/debugging-rulesets/ux.js
+++ b/chromium/pages/debugging-rulesets/ux.js
@@ -35,7 +35,7 @@ document.getElementById("save-button").addEventListener("click", e => {
sendMessage("set_option", { debugging_rulesets: cm.getValue() }, () => {
savedTextElement.style.display = "block";
setTimeout(() => {
- savedTextElement.style.display = "none"
+ savedTextElement.style.display = "none";
}, 1000);
valueHasChanged = false;
diff --git a/chromium/pages/main.css b/chromium/pages/main.css
new file mode 100644
index 000000000000..2772c46141e7
--- /dev/null
+++ b/chromium/pages/main.css
@@ -0,0 +1,21 @@
+/*--------------------------------------------------------------
+>>> TABLE OF CONTENTS:
+----------------------------------------------------------------
+# Base
+ - Layout
+ - Typography
+ - Elements
+ - Links
+# Utilities
+ - Accessibility
+
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+# Base
+--------------------------------------------------------------*/
+@import "base.css";
+
+/* Utilities - TBA
+--------------------------------------------- */
+
diff --git a/chromium/pages/options/index.html b/chromium/pages/options/index.html
index 917f309ad653..b6bdc337cfb3 100644
--- a/chromium/pages/options/index.html
+++ b/chromium/pages/options/index.html
@@ -2,15 +2,16 @@
-
+
-
-
-
-
-
+
+
@@ -45,7 +51,7 @@
-
+
diff --git a/chromium/pages/options/style.css b/chromium/pages/options/style.css
index b4d91c5bcdc6..032a7bad7a44 100644
--- a/chromium/pages/options/style.css
+++ b/chromium/pages/options/style.css
@@ -1,18 +1,30 @@
+@import "../main.css";
+
body{
- min-width: 500px;
- display: block;
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
}
-a.settings{
- background-color: #1c87c9;
- border: none;
- color: white;
- padding: 20px 34px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 20px;
- margin: 4px 2px;
+/*---------
+# GRID LAYOUT
+---------*/
+.header-wrapper, .section-wrapper {
+ margin: auto;
+}
+.header-wrapper {
+ display: inline-flex;
+ grid-column: 2;
+ grid-row: 1;
+}
+.section-wrapper {
+ grid-column: 2;
+ grid-row: 2;
+}
+#add-disabled-site-wrapper {
+ float: left;
+}
+#add-update-channel-wrapper {
+ display: inline-block;
}
.settings-wrapper{
@@ -46,6 +58,11 @@ a.settings{
}
/** Disabled Sites Option**/
+#add-disabled-site-invalid-host {
+ font-weight: bold;
+ color: red;
+ display: none;
+}
.disabled-rules-wrapper-header {
font-weight: bold;
padding-left: 5px;
@@ -54,7 +71,7 @@ img.remove{
cursor: pointer;
float: right;
height: 15px;
- margin: 10px 0 0 8%;
+ margin-top: -34px;
width: 15px;
}
.disabled-rule-list-item:last-of-type {
@@ -62,12 +79,11 @@ img.remove{
}
.disabled-rule-list-item {
border-bottom: 1px solid #ccc;
- display: inline-flex;
- margin-left: 5%;
- width: 80%;
+ clear: both;
}
.disabled-rule-list-item p {
- width: 100%;
+ width: 80%;
+ word-wrap: anywhere;
}
.section-header{
@@ -84,28 +100,30 @@ img.remove{
}
.section-header-span{
- font-size: 15px;
- border: 0px;
- border-radius: 13px;
+ cursor: pointer;
padding: 8px;
- margin-right: 10px;
+ margin-left: 0 !important;
+ margin-right: var(--space) !important;
display: inline-block;
}
.section-header-span.active{
- background-color: #66ccff;
+ background-color: var(--darker-blue);
+ color: #FFF;
}
-
.section-header-span.inactive{
- background-color: #ddd;
+ background-color: var(--light-grey);
+}
+.section-header-span.inactive:hover {
+ background-color: var(--darker-blue);
}
.update-channel{
- margin-top: 30px;
- margin-bottom: 30px;
border: 1px solid grey;
border-radius: 20px;
- width: 498px;
+ margin-top: 30px;
+ margin-bottom: 30px;
+ padding: 6px;
}
.update-channel-name{
@@ -129,8 +147,9 @@ img.remove{
}
textarea.update-channel-jwk {
- width: 380px;
+ width: 367px;
height: 250px;
+ resize: vertical;
}
input.update-channel-path-prefix, input.update-channel-scope {
@@ -147,13 +166,14 @@ div.update-channel-row-scope {
border-radius: 7px;
}
-button#add-update-channel{
+button#add-update-channel, button#add-disabled-site {
float: right;
+ height: 30px;
margin: 0px 10px 10px 10px;
- border-radius: 7px;
+ padding: 6px;
}
-input#update-channel-name{
+input#update-channel-name, input#disabled-site {
float: right;
}
@@ -201,8 +221,8 @@ div#update-channels-last-checked {
font-size: 10px;
}
-#update-channels-wrapper{
- width: 500px;
+#update-channels-list {
+ display: inline-block;
}
@keyframes flash {
@@ -226,3 +246,19 @@ div#update-channels-last-checked {
.flash {
animation: flash 1s ease-out;
}
+
+@media (prefers-color-scheme: dark) {
+ body {
+ background-color: #202023;
+ color: #f9f9fa;
+ }
+
+ .section-header-span, div#update-channels-warning {
+ color: #000;
+ }
+
+ textarea, input[type=text] {
+ background-color: #202023;
+ color: #f9f9fa;
+ }
+}
diff --git a/chromium/pages/options/ux.js b/chromium/pages/options/ux.js
index 8381c9c7625c..07d94dc9928d 100644
--- a/chromium/pages/options/ux.js
+++ b/chromium/pages/options/ux.js
@@ -1,47 +1,33 @@
/* global sendMessage */
/* global getOption_ */
/* global e */
-/* global hide */
+/* global show, hide */
"use strict";
-if (navigator.userAgent.includes("Android")) {
- const url = new URL(window.location.href);
- if (!url.searchParams.get('redirected')) {
- url.searchParams.set('redirected', true);
- document.body.innerText = "";
- let link = document.createElement("a");
- link.href = url.href;
- link.target = "_blank";
- link.className = "settings";
- link.innerText = chrome.i18n.getMessage("options_settings");
- document.body.appendChild(link);
- }
-}
-
document.addEventListener("DOMContentLoaded", () => {
- const secretArea = document.getElementById('secretArea')
+ const secretArea = document.getElementById('secretArea');
const onKeyDownHandler = evt => {
if (evt.ctrlKey && evt.key === 'z') {
- secretArea.classList.remove('hidden')
- secretArea.classList.add('flash')
+ secretArea.classList.remove('hidden');
+ secretArea.classList.add('flash');
- sendMessage('set_option', { developerMode: true })
+ sendMessage('set_option', { developerMode: true });
- document.removeEventListener('keydown', onKeyDownHandler)
+ document.removeEventListener('keydown', onKeyDownHandler);
- evt.preventDefault()
+ evt.preventDefault();
}
- }
+ };
sendMessage('get_option', { developerMode: false }, item => {
if (item.developerMode) {
- secretArea.classList.remove('hidden')
+ secretArea.classList.remove('hidden');
} else {
- document.addEventListener('keydown', onKeyDownHandler)
+ document.addEventListener('keydown', onKeyDownHandler);
}
- })
+ });
const autoUpdateRulesets = document.getElementById("autoUpdateRulesets");
const enableMixedRulesets = document.getElementById("enableMixedRulesets");
@@ -91,7 +77,7 @@ document.addEventListener("DOMContentLoaded", () => {
});
});
- function create_update_channel_element(update_channel, last_updated, pinned) {
+ function create_update_channel_element(update_channel, last_updated, locked) {
let ruleset_version_string;
if(last_updated) {
@@ -113,6 +99,33 @@ document.addEventListener("DOMContentLoaded", () => {
update_channel_last_updated.innerText = chrome.i18n.getMessage("options_storedRulesetsVersion") + ruleset_version_string;
update_channel_name.appendChild(update_channel_last_updated);
+ const update_channel_row_format = document.createElement('div');
+ update_channel_row_format.className = "update-channel-row-format";
+ update_channel_div.appendChild(update_channel_row_format);
+ const update_channel_format_column_left = document.createElement('div');
+ update_channel_format_column_left.className = "update-channel-column-left";
+ update_channel_format_column_left.innerText = "Format:";
+ update_channel_row_format.appendChild(update_channel_format_column_left);
+ const update_channel_format_column_right = document.createElement('div');
+ update_channel_format_column_right.className = "update-channel-column-right";
+ update_channel_row_format.appendChild(update_channel_format_column_right);
+ const update_channel_format = document.createElement('select');
+ update_channel_format.className = "update-channel-format";
+ update_channel_format.setAttribute("data-name", update_channel.name);
+ update_channel_format.disabled = locked;
+ update_channel_format_column_right.appendChild(update_channel_format);
+ const update_channel_format_option_ruleset = document.createElement('option');
+ update_channel_format_option_ruleset.value = "ruleset";
+ update_channel_format_option_ruleset.innerText = "ruleset";
+ update_channel_format_option_ruleset.defaultSelected = true;
+ update_channel_format_option_ruleset.selected = (update_channel.format == "ruleset");
+ update_channel_format.appendChild(update_channel_format_option_ruleset);
+ const update_channel_format_option_bloom = document.createElement('option');
+ update_channel_format_option_bloom.value = "bloom";
+ update_channel_format_option_bloom.innerText = "bloom";
+ update_channel_format_option_bloom.selected = (update_channel.format == "bloom");
+ update_channel_format.appendChild(update_channel_format_option_bloom);
+
const update_channel_row_jwk = document.createElement('div');
update_channel_row_jwk.className = "update-channel-row-jwk";
update_channel_div.appendChild(update_channel_row_jwk);
@@ -126,7 +139,7 @@ document.addEventListener("DOMContentLoaded", () => {
const update_channel_jwk = document.createElement('textarea');
update_channel_jwk.className = "update-channel-jwk";
update_channel_jwk.setAttribute("data-name", update_channel.name);
- update_channel_jwk.disabled = pinned;
+ update_channel_jwk.disabled = locked;
update_channel_jwk.innerText = JSON.stringify(update_channel.jwk);
update_channel_jwk_column_right.appendChild(update_channel_jwk);
@@ -144,7 +157,7 @@ document.addEventListener("DOMContentLoaded", () => {
update_channel_path_prefix.setAttribute("type", "text");
update_channel_path_prefix.className = "update-channel-path-prefix";
update_channel_path_prefix.setAttribute("data-name", update_channel.name);
- update_channel_path_prefix.disabled = pinned;
+ update_channel_path_prefix.disabled = locked;
update_channel_path_prefix.value = update_channel.update_path_prefix;
update_channel_path_prefix_column_right.appendChild(update_channel_path_prefix);
@@ -153,6 +166,9 @@ document.addEventListener("DOMContentLoaded", () => {
update_channel_div.appendChild(clearer);
const update_channel_row_scope = document.createElement('div');
+ if(update_channel.format == "bloom") {
+ update_channel_row_scope.style.display = "none";
+ }
update_channel_row_scope.className = "update-channel-row-scope";
update_channel_div.appendChild(update_channel_row_scope);
const update_channel_scope_column_left = document.createElement('div');
@@ -166,7 +182,7 @@ document.addEventListener("DOMContentLoaded", () => {
update_channel_scope.setAttribute("type", "text");
update_channel_scope.className = "update-channel-scope";
update_channel_scope.setAttribute("data-name", update_channel.name);
- update_channel_scope.disabled = pinned;
+ update_channel_scope.disabled = locked;
update_channel_scope.value = update_channel.scope;
update_channel_scope_column_right.appendChild(update_channel_scope);
@@ -183,13 +199,13 @@ document.addEventListener("DOMContentLoaded", () => {
const update_channel_update = document.createElement('button');
update_channel_update.className = "update-channel-update";
update_channel_update.setAttribute("data-name", update_channel.name);
- update_channel_update.disabled = pinned;
+ update_channel_update.disabled = locked;
update_channel_update.innerText = chrome.i18n.getMessage("options_update");
update_channel_controls_column_right.appendChild(update_channel_update);
const update_channel_delete = document.createElement('button');
update_channel_delete.className = "update-channel-update";
update_channel_delete.setAttribute("data-name", update_channel.name);
- update_channel_delete.disabled = pinned;
+ update_channel_delete.disabled = locked;
update_channel_delete.innerText = chrome.i18n.getMessage("options_delete");
update_channel_controls_column_right.appendChild(update_channel_delete);
@@ -197,6 +213,13 @@ document.addEventListener("DOMContentLoaded", () => {
clearer.className = "clearer";
update_channel_div.appendChild(clearer);
+ update_channel_format.addEventListener("change", () => {
+ if(update_channel_format.value == "bloom") {
+ update_channel_row_scope.style.display = "none";
+ } else {
+ update_channel_row_scope.style.display = "block";
+ }
+ });
update_channel_delete.addEventListener("click", () => {
sendMessage("delete_update_channel", update_channel.name, () => {
render_update_channels();
@@ -206,6 +229,7 @@ document.addEventListener("DOMContentLoaded", () => {
update_channel_update.addEventListener("click", () => {
sendMessage("update_update_channel", {
name: update_channel.name,
+ format: update_channel_format.value,
jwk: JSON.parse(update_channel_jwk.value),
update_path_prefix: update_channel_path_prefix.value,
scope: update_channel_scope.value
@@ -229,7 +253,7 @@ document.addEventListener("DOMContentLoaded", () => {
create_update_channel_element(
update_channel,
item.last_updated[update_channel.name],
- true
+ true,
)
);
@@ -242,7 +266,7 @@ document.addEventListener("DOMContentLoaded", () => {
create_update_channel_element(
update_channel,
item.last_updated[update_channel.name],
- false
+ update_channel.locked === true,
)
);
}
@@ -295,16 +319,12 @@ document.addEventListener("DOMContentLoaded", () => {
sendMessage("remove_rule", { ruleset: userRule, src: 'options' });
});
}
- })
+ });
// HTTPS Everywhere Sites Disabled section in General Settings module
getOption_("disabledList", [], function(item) {
let rule_host_parent = e("disabled-rules-wrapper");
- if( 0 === item.disabledList.length ) {
- hide(rule_host_parent);
- return;
- }
// img element "remove button"
let templateRemove = document.createElement("img");
templateRemove.src = chrome.runtime.getURL("images/remove.png");
@@ -331,6 +351,33 @@ document.addEventListener("DOMContentLoaded", () => {
}
});
+ const add_disabled_site = document.getElementById("add-disabled-site");
+ const disabled_site_input = document.getElementById("disabled-site");
+ const add_disabled_site_invalid_host = document.getElementById('add-disabled-site-invalid-host');
+ disabled_site_input.setAttribute("placeholder", chrome.i18n.getMessage("options_enterDisabledSite"));
+ function isValidHost(host) {
+ try {
+ new URL(`http://${host}/`);
+ return true;
+ } catch {
+ return false;
+ }
+ }
+ add_disabled_site.addEventListener("click", function() {
+ const host = disabled_site_input.value;
+
+ if (isValidHost(host)) {
+ hide(add_disabled_site_invalid_host);
+ sendMessage("disable_on_site", disabled_site_input.value, okay => {
+ if (okay) {
+ chrome.tabs.reload();
+ }
+ });
+ } else {
+ show(add_disabled_site_invalid_host);
+ }
+ });
+
add_update_channel.addEventListener("click", () => {
const update_channel_name = update_channel_name_div.value;
if(update_channel_name.trim() == "") {
diff --git a/chromium/pages/popup/index.html b/chromium/pages/popup/index.html
index 911628031258..d9441f2d3e9d 100644
--- a/chromium/pages/popup/index.html
+++ b/chromium/pages/popup/index.html
@@ -88,12 +88,11 @@