Skip to content

Commit 2dfdea1

Browse files
authored
Merge pull request #2959 from emilio/no-aboutneterror
Bug 2091681 - Don't depend on Firefox's aboutNetError.css
2 parents b2dc360 + 7cbc3be commit 2dfdea1

4 files changed

Lines changed: 68 additions & 67 deletions

File tree

‎.stylelintrc‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
"/(min[-]|max[-])height/",
1919
"/width/",
2020
"/top/",
21-
"/bottom/",
22-
"padding",
23-
"margin"
21+
"/bottom/"
2422
]
2523
}
2624
}

‎src/confirm-page.html‎

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,34 @@
1-
<html>
2-
<head>
3-
<meta http-equiv="content-type" content="text/html; charset=utf-8">
4-
<title data-i18n-message-id="confirmNavigationTitle"></title>
5-
<link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="chrome://browser/skin/aboutNetError.css" type="text/css" media="all" />
6-
<link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="chrome://global/skin/aboutNetError.css" type="text/css" media="all" />
7-
<script type="text/javascript" src="./js/i18n.js"></script>
8-
<link rel="stylesheet" href="/css/confirm-page.css" />
9-
</head>
10-
<body>
11-
<main>
12-
<div class="title">
13-
<h1 class="title-text" data-i18n-message-id="openThisSiteConfirmation"></h1>
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<meta name="color-scheme" content="light dark">
4+
<title data-i18n-message-id="confirmNavigationTitle"></title>
5+
<script src="js/i18n.js"></script>
6+
<link rel="stylesheet" href="css/confirm-page.css" />
7+
<main>
8+
<div class="title">
9+
<h1 class="title-text" data-i18n-message-id="openThisSiteConfirmation"></h1>
10+
</div>
11+
<form id="redirect-form">
12+
<p data-message-id="youAskedFireFox" data-message-arg="container-name"></p>
13+
<div id="redirect-url"></div>
14+
<p data-i18n-message-id="wouldYouStillLikeToOpenConfirmation"></p>
15+
<br>
16+
<br>
17+
<label for="never-ask" class="check-label">
18+
<input id="never-ask" type="checkbox" />
19+
<span data-i18n-message-id="rememberMyDecision"></span>
20+
</label>
21+
<br>
22+
<div class="button-container">
23+
<button id="deny" class="button" data-message-id="openInContainer" data-message-arg="current-container-name">
24+
</button>
25+
<button id="deny-no-container" class="button" data-message-id="openInNoContainer">
26+
</button>
27+
<button id="confirm" class="button primary" autofocus data-message-id="openInContainer"
28+
data-message-arg="container-name">
29+
</button>
1430
</div>
15-
<form id="redirect-form">
16-
<p data-message-id="youAskedFireFox" data-message-arg="container-name"></p>
17-
<div id="redirect-url"></div>
18-
<p data-i18n-message-id="wouldYouStillLikeToOpenConfirmation"></p>
19-
<br />
20-
<br />
21-
<label for="never-ask" class="check-label">
22-
<input id="never-ask" type="checkbox" />
23-
<span data-i18n-message-id="rememberMyDecision"></span>
24-
</label>
25-
<br />
26-
<div class="button-container">
27-
<button id="deny"
28-
class="button"
29-
data-message-id="openInContainer"
30-
data-message-arg="current-container-name">
31-
</button>
32-
<button id="deny-no-container"
33-
class="button"
34-
data-message-id="openInNoContainer">
35-
</button>
36-
<button id="confirm"
37-
class="button primary"
38-
autofocus
39-
data-message-id="openInContainer"
40-
data-message-arg="container-name">
41-
</button>
42-
</div>
43-
</form>
44-
</main>
45-
46-
<script src="js/utils.js"></script>
47-
<script src="js/confirm-page.js"></script>
48-
</body>
49-
</html>
31+
</form>
32+
</main>
33+
<script src="js/utils.js"></script>
34+
<script src="js/confirm-page.js"></script>

‎src/css/confirm-page.css‎

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
/* General Rules and Resets */
2-
.title {
3-
background-image: none;
1+
:root {
2+
font: message-box;
3+
font-size: 15px;
4+
}
5+
6+
body {
7+
margin: 0;
8+
display: flex;
9+
flex-direction: column;
10+
box-sizing: border-box;
11+
min-block-size: 100vh;
12+
padding: 40px 48px;
13+
align-items: center;
14+
justify-content: center;
415
}
516

617
main {
@@ -27,15 +38,10 @@ button .container-name,
2738

2839
/* for a mid sized window we have enough for this but not our image */
2940
.title {
30-
background-image: url('chrome://global/skin/icons/info.svg');
41+
background-image: url(/img/info.svg);
3142
}
3243
}
3344

34-
html {
35-
box-sizing: border-box;
36-
font: message-box;
37-
}
38-
3945
#redirect-url,
4046
#redirect-origin {
4147
font-weight: bold;
@@ -53,16 +59,12 @@ html {
5359
padding-block-start: 0.5rem;
5460
padding-inline-end: 0.5rem;
5561
padding-inline-start: 0.5rem;
56-
}
5762

58-
/* stylelint-disable media-feature-name-no-unknown */
59-
@media (prefers-color-scheme: dark) {
60-
#redirect-url {
63+
@media (prefers-color-scheme: dark) {
6164
background: #38383d; /* Grey 70 */
6265
color: #eee; /* White 20 */
6366
}
6467
}
65-
/* stylelint-enable */
6668

6769
#redirect-url img {
6870
block-size: 16px;
@@ -81,8 +83,18 @@ dfn {
8183
flex-grow: 1;
8284
}
8385

84-
.button-container > button {
85-
min-inline-size: 240px;
86+
.button-container {
87+
display: flex;
88+
flex-flow: row wrap;
89+
justify-content: end;
90+
margin-block-start: 1rem;
91+
92+
> button {
93+
min-block-size: 32px;
94+
min-inline-size: 240px;
95+
padding: 0 1.5rem;
96+
margin-inline: 0.25rem;
97+
}
8698
}
8799

88100
.check-label {

‎test/common.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ const nextTick = () => {
1818
});
1919
};
2020

21+
// Work around https://github.com/stoically/webextensions-jsdom/pull/6
22+
if (process.env.NYC_CONFIG) {
23+
const {tempDir} = JSON.parse(process.env.NYC_CONFIG);
24+
require("fs").mkdirSync(path.join(tempDir, "instruments"), {recursive: true});
25+
}
26+
2127
const webExtensionsJSDOM = require("webextensions-jsdom");
2228
const manifestPath = path.resolve(path.join(__dirname, "../src/manifest.json"));
2329

0 commit comments

Comments
 (0)