minor: UI changes

This commit is contained in:
Andrei O 2022-03-27 18:36:48 +03:00
parent bb966b603c
commit aa3dc44707
No known key found for this signature in database
GPG Key ID: B961E5B68389457E
3 changed files with 17 additions and 105 deletions

View File

@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"release": "yarn config set version-tag-prefix brave-detection-blocker@v && yarn config set version-git-message 'brave-detection-blocker@v%s' && yarn version --patch && yarn postversion", "release": "yarn config set version-tag-prefix brave-detection-blocker@v && yarn config set version-git-message 'brave-detection-blocker@v%s' && yarn version --patch && yarn postversion",
"postversion": "git push", "postversion": "git push",
"pub": "node ./scripts/create-release.js" "pub": "yarn release && node ./scripts/create-release.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -81,6 +81,21 @@
.container--tabs .tab-content > .active { .container--tabs .tab-content > .active {
display: block; display: block;
} }
/* GitHub Link */
.github-link {
color: #e6e6e6;
text-decoration: none;
font-size: 0.85rem;
font-weight: bold;
}
.github-link:hover {
color: #f44336;
transform: scale(1.1);
transition: all 0.2s ease-in-out;
}
</style> </style>
</head> </head>
<body> <body>
@ -121,7 +136,7 @@
(Don't know why you would employ such effort but I'm just trying to be techincal.) (Don't know why you would employ such effort but I'm just trying to be techincal.)
<br /><br /> <br /><br />
<h3>Check source at:</h3> <h3>Check source at:</h3>
<a href="https://https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension"> <a class="github-link" href="https://https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension">
https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension https://github.com/andrei0x309/Brave-Detection-Blocker-Chrome-Extension
</a> </a>
</div> </div>

103
popup.js
View File

@ -1,6 +1,5 @@
'use strict'; 'use strict';
window.addEventListener( window.addEventListener(
'message', 'message',
(event) => { (event) => {
@ -11,108 +10,6 @@ window.addEventListener(
false, false,
); );
// let btn_close_alert = document.getElementById('closeAlertBtn');
// const btnProxyStop = document.getElementById('btnProxyStop');
// const btnProxyStart = document.getElementById('btnProxyStart');
// const proxyTypeGroup = document.getElementById('proxyTypeGroup');
// const btnProxyType = [
// document.getElementById('btnProxyTypeHttp'),
// document.getElementById('btnProxyTypeHttps'),
// document.getElementById('btnProxyTypeSocks4'),
// document.getElementById('btnProxyTypeSocks5'),
// ];
// for (const btn of btnProxyType) {
// if (btn) {
// btn.onclick = async function () {
// const active = proxyTypeGroup.querySelector('.btn-green');
// if (active) {
// active.classList.remove('btn-green');
// }
// this.classList.add('btn-green');
// bgP.window.extOptions.activeProxy.type = this.id.replace('btnProxyType', '').toLowerCase();
// await bgP.window.setOptions(bgP.window.extOptions);
// };
// }
// }
// const spanProxyStatusOn = document.getElementById('spanProxyStatusOn');
// const spanProxyStatusOff = document.getElementById('spanProxyStatusOff');
// const inputproxyHost = document.getElementById('proxyHost');
// const inputproxyPort = document.getElementById('proxyPort');
// const updatePopup = function (options) {
// if (options.proxyEnabled) {
// spanProxyStatusOff.classList.add('hidden');
// spanProxyStatusOn.classList.remove('hidden');
// btnProxyStart.classList.add('hidden');
// btnProxyStop.classList.remove('hidden');
// } else {
// spanProxyStatusOn.classList.add('hidden');
// spanProxyStatusOff.classList.remove('hidden');
// btnProxyStart.classList.remove('hidden');
// btnProxyStop.classList.add('hidden');
// }
// if (options.activeProxy) {
// const types = ['http', 'https', 'socks4', 'socks5'];
// if (options.activeProxy.type) btnProxyType[types.indexOf(options.activeProxy.type)].classList.add('btn-green');
// inputproxyHost.value = options.activeProxy.host;
// inputproxyPort.value = options.activeProxy.port;
// }
// };
// updatePopup(bgP.window.extOptions);
// btnProxyStop.onclick = function () {
// bgP.window.extOptions.proxyEnabled = false;
// bgP.window.setOptions(bgP.window.extOptions);
// bgP.window.disableProxy();
// updatePopup(bgP.window.extOptions);
// };
// btnProxyStart.onclick = function () {
// bgP.window.extOptions.activeProxy.host = inputproxyHost.value;
// bgP.window.extOptions.activeProxy.port = inputproxyPort.value;
// bgP.window.extOptions.proxyEnabled = true;
// bgP.window.setOptions(bgP.window.extOptions);
// bgP.window.setProxy(bgP.window.extOptions.activeProxy);
// updatePopup(bgP.window.extOptions);
// };
// let displayAlert = (type, msg) => {
// if (type === 'error') {
// document.getElementById('exAlertBox').classList.remove('alert-success');
// document.getElementById('exAlertBox').classList.add('alert-warning');
// } else if (type === 'success') {
// document.getElementById('exAlertBox').classList.remove('alert-warning');
// document.getElementById('exAlertBox').classList.add('alert-success');
// }
// document.getElementById('alertMsg').innerHTML = msg;
// document.getElementById('exAlert').classList.remove('hidden');
// };
// let closeAlert = () => {
// const alert = document.getElementById('exAlert');
// if (alert) {
// document.getElementById('exAlert').classList.add('hidden');
// }
// };
// closeAlert();
// btn_close_alert.addEventListener('click', function () {
// closeAlert();
// });
const myTabs = document.querySelectorAll('ul.nav-tabs > li'); const myTabs = document.querySelectorAll('ul.nav-tabs > li');
function myTabClicks(tabClickEvent) { function myTabClicks(tabClickEvent) {
for (let i = 0; i < myTabs.length; i++) { for (let i = 0; i < myTabs.length; i++) {