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

Commit 75ddf2f

Browse files
committed
Add a button to open the URL
1 parent 6016aad commit 75ddf2f

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

chromium/pages/cancel/index.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
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+
<p id="url-paragraph">
15+
<span id="url-label">URL: </span><a href="#" id="url-value">PLACEHOLDER</a>
16+
</p>
17+
<p class="actions">
18+
<a href="#" id="open-url-button" data-i18n="cancel_add_rule_and_open_insecurely">Open insecurely and do not ask again</a>
19+
</p>
20+
<script src="../translation.js"></script>
21+
<script src="../util.js"></script>
22+
<script src="ux.js"></script>
23+
</div>
1724
</body>
1825
</html>

chromium/pages/cancel/style.css

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
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;
11+
}
12+
13+
h1{
14+
text-align: center;
1115
}
1216

1317
p{
14-
width: 600px;
15-
position: relative;
16-
left: -300px;
1718
font-size: 12pt;
1819
font-family: sans-serif;
1920
line-height: 150%;
2021
}
22+
23+
#open-url-button{
24+
cursor: pointer;
25+
display: inline-block;
26+
margin: 0;
27+
padding: 1em 1em;
28+
background: repeating-linear-gradient( 45deg, red, red 7.5px, salmon 7.5px, salmon 15px );
29+
color: #fff;
30+
font-weight: bold;
31+
text-decoration: none;
32+
text-align: center;
33+
vertical-align: middle;
34+
-moz-user-select: none;
35+
user-select: none;
36+
border: 0;
37+
border-radius: 5px;
38+
}

chromium/pages/cancel/ux.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,23 @@ 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');
33+
34+
originURLLink.innerHTML = originURL;
35+
originURLLink.href = originURL;
36+
openURLButton.href = originURL;
37+
38+
openURLButton.addEventListener("click", function(event) {
39+
event.preventDefault();
3340

34-
originURLLink.addEventListener("click", function() {
3541
if (confirm(chrome.i18n.getMessage("chrome_disable_on_this_site") + '?')) {
3642
const url = new URL(originURL);
3743
sendMessage("disable_on_site", url.host, () => {
3844
window.location = originURL;
3945
});
4046
}
47+
48+
return false;
4149
});
4250
}

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.add_rule_and_open_insecurely "Open insecurely and do not ask again">
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)