Add file protocol to status button

This commit is contained in:
Alice Gaudon 2020-05-19 07:23:27 +02:00
parent 7ffb60258a
commit 52cb434733
3 changed files with 8 additions and 3 deletions

View File

@ -28,6 +28,9 @@
<i class="fas fa-lock-open http"> <i class="fas fa-lock-open http">
<span class="tip">Vulnerable connection (http)</span> <span class="tip">Vulnerable connection (http)</span>
</i> </i>
<i class="fas fa-folder file">
<span class="tip">Local file</span>
</i>
</button> </button>
<button id="home" class="disabled"><i class="fas fa-home"></i></button> <button id="home" class="disabled"><i class="fas fa-home"></i></button>
<button id="back" class="disabled"><i class="fas fa-arrow-left"></i></button> <button id="back" class="disabled"><i class="fas fa-arrow-left"></i></button>

View File

@ -613,8 +613,9 @@ function updateNavigation() {
} }
function updateStatusButton() { function updateStatusButton() {
let protocol = services[selectedService].view.getURL().split('://')[0];
if (!protocol) protocol = 'unknown';
for (const c of statusButton.children) { for (const c of statusButton.children) {
const protocol = services[selectedService].view.getURL().split('://')[0];
if (c.classList.contains(protocol)) c.classList.add('active'); if (c.classList.contains(protocol)) c.classList.add('active');
else c.classList.remove('active'); else c.classList.remove('active');
} }

View File

@ -196,8 +196,9 @@ body {
background: transparent; background: transparent;
} }
#history #status .unknown { #history #status .unknown,
opacity: 0.4; #history #status .file {
color: #888;
} }
#history #status .https { #history #status .https {