diff options
Diffstat (limited to 'data/extensions/https-everywhere@eff.org/pages/options')
3 files changed, 0 insertions, 751 deletions
diff --git a/data/extensions/https-everywhere@eff.org/pages/options/index.html b/data/extensions/https-everywhere@eff.org/pages/options/index.html deleted file mode 100644 index b6bdc33..0000000 --- a/data/extensions/https-everywhere@eff.org/pages/options/index.html +++ /dev/null @@ -1,65 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title></title> - <link href="style.css" rel="stylesheet"> - </head> - <body class="font"> - <section class="header-wrapper"> - <span class="button section-header-span active" data-show="general-settings-wrapper" data-i18n="options_generalSettings"></span> - <span class="button section-header-span inactive" data-show="advanced-settings-wrapper" data-i18n="options_advancedSettings"></span> - <span class="button section-header-span inactive" data-show="update-channels-wrapper" data-i18n="options_updateChannels"></span> - </section> - <div class="section-wrapper" id="general-settings-wrapper"> - <div id="update-wrapper" class="settings-wrapper"> - <input type="checkbox" id="autoUpdateRulesets"> - <label for="autoUpdateRulesets" data-i18n="options_autoUpdateRulesets"></label> - </div> - <div id="user-rules-wrapper"> - <p class="user-rules-wrapper-header" data-i18n="options_userRulesListed"></p> - </div> - <div id="disabled-rules-wrapper"> - <p class="disabled-rules-wrapper-header" data-i18n="options_disabledUrlsListed"></p> - <div id="add-disabled-site-wrapper"> - <button class="button" id="add-disabled-site" data-i18n="options_addDisabledSite"></button> - <input type="text" id="disabled-site" /> - </div> - <div id="add-disabled-site-invalid-host" data-i18n="options_hostNotFormattedCorrectly"></div> - </div> - </div> - - <div class="section-wrapper" id="advanced-settings-wrapper"> - <div id="mixed-rulesets-wrapper" class="settings-wrapper"> - <input type="checkbox" id="enableMixedRulesets"> - <label for="enableMixedRulesets" data-i18n="options_enableMixedRulesets"></label> - </div> - <div id="show-devtools-tab-wrapper" class="settings-wrapper"> - <input type="checkbox" id="showDevtoolsTab"> - <label for="showDevtoolsTab" data-i18n="options_showDevtoolsTab"></label> - </div> - </div> - - <div class="section-wrapper" id="update-channels-wrapper"> - <div id="update-channels-error"> - <span id="update-channels-error-text"></span> - <img id="update-channels-error-hide" src="/images/remove.png"> - </div> - <div id="update-channels-warning" data-i18n="options_updateChannelsWarning"></div> - <div id="update-channels-last-checked"></div> - <div class="clearer"></div> - <div id="update-channels-list"></div> - <div id="add-update-channel-wrapper"> - <button class="button" id="add-update-channel" data-i18n="options_addUpdateChannel"></button> - <input type="text" id="update-channel-name" /> - </div> - </div> - - <a id="secretArea" href="/pages/debugging-rulesets/index.html" target="_blank" class="hidden" data-i18n="options_debuggingRulesets"></a> - - <script src="ux.js"></script> - <script src="../translation.js"></script> - <script src="../util.js"></script> - </body> -</html> diff --git a/data/extensions/https-everywhere@eff.org/pages/options/style.css b/data/extensions/https-everywhere@eff.org/pages/options/style.css deleted file mode 100644 index 032a7ba..0000000 --- a/data/extensions/https-everywhere@eff.org/pages/options/style.css +++ /dev/null @@ -1,264 +0,0 @@ -@import "../main.css"; - -body{ - display: grid; - grid-template-columns: 1fr 1fr 1fr; -} - -/*--------- -# 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{ - margin: 10px 0 0 0; -} - -.settings-wrapper#update-wrapper{ - margin-bottom: 20px; -} - -.settings-wrapper#show-devtools-tab-wrapper{ - margin-bottom: 20px; -} - -/** User rules Option**/ -.user-rules-wrapper-header { - font-weight: bold; - padding-left: 5px; -} -.user-rules-list-item:last-of-type { - border-bottom: none; -} -.user-rules-list-item { - border-bottom: 1px solid #ccc; - display: inline-flex; - margin-left: 5%; - width: 80%; -} -.user-rules-list-item p { - width: 100%; -} - -/** 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; -} -img.remove{ - cursor: pointer; - float: right; - height: 15px; - margin-top: -34px; - width: 15px; -} -.disabled-rule-list-item:last-of-type { - border-bottom: none; -} -.disabled-rule-list-item { - border-bottom: 1px solid #ccc; - clear: both; -} -.disabled-rule-list-item p { - width: 80%; - word-wrap: anywhere; -} - -.section-header{ - margin-bottom: 10px; -} - -#import{ - margin-bottom: 10px; - float: right; -} - -#import-confirmed{ - display: none; -} - -.section-header-span{ - cursor: pointer; - padding: 8px; - margin-left: 0 !important; - margin-right: var(--space) !important; - display: inline-block; -} - -.section-header-span.active{ - background-color: var(--darker-blue); - color: #FFF; -} -.section-header-span.inactive{ - background-color: var(--light-grey); -} -.section-header-span.inactive:hover { - background-color: var(--darker-blue); -} - -.update-channel{ - border: 1px solid grey; - border-radius: 20px; - margin-top: 30px; - margin-bottom: 30px; - padding: 6px; -} - -.update-channel-name{ - font-weight: bold; - font-size: 14px; - margin: 10px; -} - -.update-channel-column-left { - width: 89px; - float: left; - font-size: 13px; - text-align: right; - margin-right: 10px; - min-height: 1px; -} - -.update-channel-column-right { - float: left; - width: 380px; -} - -textarea.update-channel-jwk { - width: 367px; - height: 250px; - resize: vertical; -} - -input.update-channel-path-prefix, input.update-channel-scope { - width: 367px; -} - -div.update-channel-row-scope { - margin-top: 3px; -} - -.update-channel-column-right button { - float: right; - margin: 10px; - border-radius: 7px; -} - -button#add-update-channel, button#add-disabled-site { - float: right; - height: 30px; - margin: 0px 10px 10px 10px; - padding: 6px; -} - -input#update-channel-name, input#disabled-site { - float: right; -} - -.clearer{ - clear: both; -} - -.update-channel-last-updated { - float: right; - font-weight: lighter; - font-size: 10px; -} - -div#update-channels-error, div#update-channels-warning { - margin-top: 20px; - font-weight: bold; - padding: 10px; - border-radius: 10px; -} - -div#update-channels-error { - background-color: #CC3333; - display: none; - color: white; -} - -div#update-channels-warning { - background-color: #FFCC00; - font-color: black; -} - -#update-channels-error-text{ - display: inline-block; - width: 460px; -} - -img#update-channels-error-hide { - float: right; -} - -div#update-channels-last-checked { - margin-top: 10px; - float: right; - font-weight: bold; - font-size: 10px; -} - -#update-channels-list { - display: inline-block; -} - -@keyframes flash { - from { - background: #fc0; - } - to { - background: transparent; - } -} - -#secretArea { - border-radius: 5px; - padding: 5px; -} - -.hidden { - display: none -} - -.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/data/extensions/https-everywhere@eff.org/pages/options/ux.js b/data/extensions/https-everywhere@eff.org/pages/options/ux.js deleted file mode 100644 index 02ad39d..0000000 --- a/data/extensions/https-everywhere@eff.org/pages/options/ux.js +++ /dev/null @@ -1,422 +0,0 @@ -/* global sendMessage */ -/* global getOption_ */ -/* global e */ -/* global show, hide */ - -"use strict"; - -document.addEventListener("DOMContentLoaded", () => { - const secretArea = document.getElementById('secretArea'); - - const onKeyDownHandler = evt => { - if (evt.ctrlKey && evt.key === 'z') { - secretArea.classList.remove('hidden'); - secretArea.classList.add('flash'); - - sendMessage('set_option', { developerMode: true }); - - document.removeEventListener('keydown', onKeyDownHandler); - - evt.preventDefault(); - } - }; - - sendMessage('get_option', { developerMode: false }, item => { - if (item.developerMode) { - secretArea.classList.remove('hidden'); - } else { - document.addEventListener('keydown', onKeyDownHandler); - } - }); - - const autoUpdateRulesets = document.getElementById("autoUpdateRulesets"); - const enableMixedRulesets = document.getElementById("enableMixedRulesets"); - const showDevtoolsTab = document.getElementById("showDevtoolsTab"); - - const defaultOptions = { - autoUpdateRulesets: false, - enableMixedRulesets: false, - showDevtoolsTab: true - }; - - sendMessage("get_option", defaultOptions, item => { - autoUpdateRulesets.checked = item.autoUpdateRulesets; - enableMixedRulesets.checked = item.enableMixedRulesets; - showDevtoolsTab.checked = item.showDevtoolsTab; - - autoUpdateRulesets.addEventListener("change", () => { - sendMessage("set_option", { autoUpdateRulesets: autoUpdateRulesets.checked }); - }); - - enableMixedRulesets.addEventListener("change", () => { - sendMessage("set_option", { enableMixedRulesets: enableMixedRulesets.checked }); - }); - - showDevtoolsTab.addEventListener("change", () => { - sendMessage("set_option", { showDevtoolsTab: showDevtoolsTab.checked }); - }); - }); - - function onlyShowSection(sectionId) { - document.querySelectorAll('.section-wrapper').forEach(sw => { - sw.style.display = "none"; - }); - document.getElementById(sectionId).style.display = "block"; - } - onlyShowSection('general-settings-wrapper'); - - document.querySelectorAll('.section-header-span').forEach(shs => { - shs.addEventListener("click", () => { - document.querySelectorAll('.section-header-span').forEach(shs => { - shs.classList.remove("active"); - shs.classList.add("inactive"); - }); - shs.classList.remove("inactive"); - shs.classList.add("active"); - onlyShowSection(shs.dataset.show); - }); - }); - - function create_update_channel_element(update_channel, last_updated, locked) { - let ruleset_version_string; - - if(last_updated) { - const ruleset_date = new Date(last_updated * 1000); - ruleset_version_string = ruleset_date.getUTCFullYear() + "." + (ruleset_date.getUTCMonth() + 1) + "." + ruleset_date.getUTCDate(); - } else { - ruleset_version_string = "n/a"; - } - - const update_channel_div = document.createElement('div'); - update_channel_div.className = "update-channel"; - - const update_channel_name = document.createElement('div'); - update_channel_name.className = "update-channel-name"; - update_channel_name.innerText = update_channel.name; - update_channel_div.appendChild(update_channel_name); - const update_channel_last_updated = document.createElement('div'); - update_channel_last_updated.className = "update-channel-last-updated"; - 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); - const update_channel_jwk_column_left = document.createElement('div'); - update_channel_jwk_column_left.className = "update-channel-column-left"; - update_channel_jwk_column_left.innerText = "JWK:"; - update_channel_row_jwk.appendChild(update_channel_jwk_column_left); - const update_channel_jwk_column_right = document.createElement('div'); - update_channel_jwk_column_right.className = "update-channel-column-right"; - update_channel_row_jwk.appendChild(update_channel_jwk_column_right); - 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 = locked; - update_channel_jwk.innerText = JSON.stringify(update_channel.jwk); - update_channel_jwk_column_right.appendChild(update_channel_jwk); - - const update_channel_row_path_prefix = document.createElement('div'); - update_channel_row_path_prefix.className = "update-channel-row-path-prefix"; - update_channel_div.appendChild(update_channel_row_path_prefix); - const update_channel_path_prefix_column_left = document.createElement('div'); - update_channel_path_prefix_column_left.className = "update-channel-column-left"; - update_channel_path_prefix_column_left.innerText = "Path Prefix:"; - update_channel_row_path_prefix.appendChild(update_channel_path_prefix_column_left); - const update_channel_path_prefix_column_right = document.createElement('div'); - update_channel_path_prefix_column_right.className = "update-channel-column-right"; - update_channel_row_path_prefix.appendChild(update_channel_path_prefix_column_right); - const update_channel_path_prefix = document.createElement('input'); - 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 = locked; - update_channel_path_prefix.value = update_channel.update_path_prefix; - update_channel_path_prefix_column_right.appendChild(update_channel_path_prefix); - - let clearer = document.createElement('div'); - clearer.className = "clearer"; - 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'); - update_channel_scope_column_left.className = "update-channel-column-left"; - update_channel_scope_column_left.innerText = "Scope:"; - update_channel_row_scope.appendChild(update_channel_scope_column_left); - const update_channel_scope_column_right = document.createElement('div'); - update_channel_scope_column_right.className = "update-channel-column-right"; - update_channel_row_scope.appendChild(update_channel_scope_column_right); - const update_channel_scope = document.createElement('input'); - 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 = locked; - update_channel_scope.value = update_channel.scope; - update_channel_scope_column_right.appendChild(update_channel_scope); - - const update_channel_row_controls = document.createElement('div'); - update_channel_row_controls.className = "update-channel-row-controls"; - update_channel_div.appendChild(update_channel_row_controls); - const update_channel_controls_column_left = document.createElement('div'); - update_channel_controls_column_left.className = "update-channel-column-left"; - update_channel_controls_column_left.innerText = " "; - update_channel_row_controls.appendChild(update_channel_controls_column_left); - const update_channel_controls_column_right = document.createElement('div'); - update_channel_controls_column_right.className = "update-channel-column-right"; - update_channel_row_controls.appendChild(update_channel_controls_column_right); - 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 = 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 = locked; - update_channel_delete.innerText = chrome.i18n.getMessage("options_delete"); - update_channel_controls_column_right.appendChild(update_channel_delete); - - clearer = document.createElement('div'); - 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(); - }); - }); - - 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 - }, () => { - render_update_channels(); - }); - }); - - return update_channel_div; - } - - function render_update_channels() { - const update_channels_list = document.getElementById("update-channels-list"); - while(update_channels_list.firstChild) { - update_channels_list.removeChild(update_channels_list.firstChild); - } - - sendMessage("get_pinned_update_channels", null, item => { - for(const update_channel of item.update_channels) { - update_channels_list.appendChild( - create_update_channel_element( - update_channel, - item.last_updated[update_channel.name], - true, - ) - ); - - } - }); - - sendMessage("get_stored_update_channels", null, item => { - for(const update_channel of item.update_channels) { - update_channels_list.appendChild( - create_update_channel_element( - update_channel, - item.last_updated[update_channel.name], - update_channel.locked === true, - ) - ); - } - }); - } - render_update_channels(); - - const add_update_channel = document.getElementById("add-update-channel"); - const update_channel_name_div = document.getElementById("update-channel-name"); - const update_channels_error_text = document.getElementById("update-channels-error-text"); - const update_channels_error = document.getElementById("update-channels-error"); - update_channel_name_div.setAttribute("placeholder", chrome.i18n.getMessage("options_enterUpdateChannelName")); - - function displayError(text) { - update_channels_error_text.innerText = text; - update_channels_error.style.display = "block"; - window.scrollTo(0,0); - } - - // Get a list of user Rules - sendMessage("get_user_rules", null, userRules => { - let user_rules_parent = e("user-rules-wrapper"); - - if ( 0 === userRules.length) { - hide(user_rules_parent); - return ; - } - - // img element "remove button" - let templateRemove = document.createElement("img"); - templateRemove.src = chrome.runtime.getURL("images/remove.png"); - templateRemove.className = "remove"; - - for (const userRule of userRules) { - let user_rule_host = document.createElement("div"); - let user_rule_name = document.createElement("p"); - let remove = templateRemove.cloneNode(true); - - user_rule_host.className = "user-rules-list-item"; - user_rule_name.className = "user-rules-list-item-single"; - user_rule_name.innerText = userRule.name; - user_rule_host.appendChild(user_rule_name); - user_rules_parent.appendChild(user_rule_host); - user_rule_host.appendChild(remove); - - remove.addEventListener("click", () => { - // assume the removal is successful and hide ui element - hide( user_rule_host ); - // remove the user rule - 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"); - - // img element "remove button" - let templateRemove = document.createElement("img"); - templateRemove.src = chrome.runtime.getURL("images/remove.png"); - templateRemove.className = "remove"; - - if( item ) { - for (const key of item.disabledList) { - let rule_host = document.createElement("div"); - let remove = templateRemove.cloneNode(true); - let rule_host_site_name = document.createElement("p"); - - rule_host.className = "disabled-rule-list-item"; - rule_host_site_name.className = "disabled-rule-list-item_single"; - rule_host_site_name.innerText = key; - rule_host.appendChild( rule_host_site_name); - rule_host_parent.appendChild(rule_host); - rule_host.appendChild(remove); - - remove.addEventListener("click", () => { - hide( rule_host ); - sendMessage("enable_on_site", key); - }); - } - } - }); - - 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() == "") { - displayError("Error: The update channel name is blank. Please enter another name."); - } else { - update_channel_name_div.value = ""; - sendMessage("create_update_channel", update_channel_name, result => { - if(result == true) { - render_update_channels(); - } else { - displayError("Error: There already exists an update channel with this name."); - } - }); - } - }); - - const update_channels_error_hide = document.getElementById("update-channels-error-hide"); - update_channels_error_hide.addEventListener("click", () => { - update_channels_error.style.display = "none"; - }); - - const update_channels_last_checked = document.getElementById("update-channels-last-checked"); - sendMessage("get_last_checked", null, last_checked => { - let last_checked_string; - if(last_checked) { - const last_checked_date = new Date(last_checked * 1000); - const options = { - year: '2-digit', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - timeZoneName: 'short' - }; - const customDateTime = new Intl.DateTimeFormat('default', options).format; - last_checked_string = customDateTime(last_checked_date); - } else { - last_checked_string = chrome.i18n.getMessage("options_updatesLastCheckedNever"); - } - update_channels_last_checked.innerText = chrome.i18n.getMessage("options_updatesLastChecked") + last_checked_string; - }); -}); |