Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit a93dbd8

Browse files
committed
Change the open URL link to a button
1 parent 6016aad commit a93dbd8

File tree

4 files changed

+55
-18
lines changed

4 files changed

+55
-18
lines changed

chromium/pages/cancel/index.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@
88
<link rel="stylesheet" href="style.css" type="text/css" />
99
</head>
1010
<body>
11-
<h1 id="https-everywhere"><img src="../../images/banner-red.png" alt="HTTPS Everywhere" /></h1>
12-
<p data-i18n="cancel_he_blocking_explainer"></p>
13-
<p id="url-paragraph"><span id="url-label">URL: </span><a href="#" id="originURL"></a></p>
14-
<script src="../translation.js"></script>
15-
<script src="../util.js"></script>
16-
<script src="ux.js"></script>
11+
<div class="content">
12+
<h1 id="https-everywhere"><img src="../../images/banner-red.png" alt="HTTPS Everywhere" /></h1>
13+
<p data-i18n="cancel_he_blocking_explainer"></p>
14+
15+
<p id="url-paragraph">
16+
<span id="url-label">URL: </span><a href="#" id="url-value">PLACEHOLDER</a>
17+
</p>
18+
19+
<form method="get" action="#" id="url-actions-form">
20+
<button type="button" name="open" formaction="#" id="open-url-button" data-i18n="cancel_open_page">Open insecure page</button>
21+
</form>
22+
23+
<script src="../translation.js"></script>
24+
<script src="../util.js"></script>
25+
<script src="ux.js"></script>
26+
</div>
1727
</body>
1828
</html>

chromium/pages/cancel/style.css

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
body{
22
margin-top: 6em;
3-
left: 50%;
43
position: relative;
5-
overflow: hidden;
4+
text-align: center;
65
}
76

8-
h1 img{
9-
position: relative;
10-
left: -289px;
7+
.content{
8+
width: 600px;
9+
margin: auto;
10+
text-align: left;
1111
}
1212

13-
p{
14-
width: 600px;
15-
position: relative;
16-
left: -300px;
13+
h1{
14+
text-align: center;
15+
}
16+
17+
form, button, p{
1718
font-size: 12pt;
1819
font-family: sans-serif;
1920
line-height: 150%;
2021
}
22+
23+
form{
24+
overflow: auto;
25+
margin-bottom: 1em;
26+
}
27+
28+
form button{
29+
padding: .5em 1em;
30+
background-color: #aaa;
31+
color: #fff;
32+
border: none;
33+
border-radius: 4px;
34+
cursor: pointer;
35+
}
36+
37+
#open-url-button{
38+
display: inline-block;
39+
float: left;
40+
background-color: #ec1e1e;
41+
}

chromium/pages/cancel/ux.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@ function replaceLink(explainer) {
2828
function displayURL() {
2929
const cancelURL = new URL(window.location.href);
3030
const originURL = decodeURI(cancelURL.searchParams.get('originURL'));
31-
const originURLLink = document.getElementById('originURL');
32-
originURLLink.innerText = originURL;
31+
const originURLLink = document.getElementById('url-value');
32+
const openURLButton = document.getElementById('open-url-button');
3333

34-
originURLLink.addEventListener("click", function() {
34+
originURLLink.innerHTML = originURL;
35+
originURLLink.href = originURL;
36+
37+
openURLButton.addEventListener("click", function() {
3538
if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) {
3639
const url = new URL(originURL);
3740
sendMessage("disable_on_site", url.host, () => {
3841
window.location = originURL;
3942
});
4043
}
44+
45+
return false;
4146
});
4247
}

src/chrome/locale/en/https-everywhere.dtd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
<!ENTITY https-everywhere.cancel.he_blocking_explainer "HTTPS Everywhere noticed you were navigating to a non-HTTPS page, and tried to send you to the HTTPS version instead. The HTTPS version is unavailable. Most likely this site does not support HTTPS, but it is also possible that an attacker is blocking the HTTPS version. If you wish to view the unencrypted version of this page, you can still do so by disabling the 'Block all unencrypted requests' option in your HTTPS Everywhere extension. Be aware that disabling this option could make your browser vulnerable to network-based downgrade attacks on websites you visit.">
3737
<!ENTITY https-everywhere.cancel.he_blocking_network "network-based downgrade attacks">
38+
<!ENTITY https-everywhere.cancel.open_page "Open insecure page">
3839

3940
<!ENTITY https-everywhere.chrome.stable_rules "Stable rules">
4041
<!ENTITY https-everywhere.chrome.stable_rules_description "Force encrypted connections to these websites:">

0 commit comments

Comments
 (0)