blob: 33eb8cd1a1d6ac89bf4e48245fc69d2f11ec63fd [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001<!DOCTYPE html>
2<html i18n-values="dir:textdirection">
3<head>
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +01004<meta name="viewport" content="width=device-width, initial-scale=1.0,
5 maximum-scale=1.0, user-scalable=no">
Torne (Richard Coles)58218062012-11-14 11:43:16 +00006<title i18n-content="title">
7</title>
8<style>
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +01009
Torne (Richard Coles)58218062012-11-14 11:43:16 +000010body {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010011 background-color: #E6E6E6;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000012 font-family: Helvetica, Arial, sans-serif;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010013 font-size: 10pt;
14 margin: 50px 40px 20px 40px;
15 text-align: center;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000016}
17
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010018#main-frame-error {
19 margin: auto;
20 max-width: 540px;
21 min-width: 200px;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000022}
23
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010024/* Don't use the main frame div when the error is in a subframe. */
25html[subframe] #main-frame-error {
26 display: none;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000027}
Torne (Richard Coles)58218062012-11-14 11:43:16 +000028
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010029/* Don't use the subframe error div when the error is in a main frame. */
30html:not([subframe]) #sub-frame-error {
31 display: none;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000032}
33
34#box {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010035 background-color: #fbfbfb;
36 border: 1px solid #AAA;
37 border-bottom: 1px solid #888;
38 border-radius: 3px;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000039 color: black;
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +010040<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010041 /* Not done on mobile for performance reasons. */
42 box-shadow: 0px 2px 2px #AAA;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000043</if>
Torne (Richard Coles)58218062012-11-14 11:43:16 +000044}
45
46h1 {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010047 color: #666;
48 margin: 10px 0px 25px 0px;
49 font-weight: normal;
50 font-size: 1.5em;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000051}
52
53a {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010054 color: #15c;
55 text-decoration: none;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000056}
57
Ben Murdoch58e6fbe2013-07-26 10:20:38 +010058.icon {
59 -webkit-user-select: none;
60}
61
62.icon-generic {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010063 /**
64 * Can't access chrome://theme/IDR_ERROR_NETWORK_GENERIC from an untrusted
65 * renderer process, so embed the resource manually.
66 */
67 content: -webkit-image-set(
68 url('../../app/theme/default_100_percent/common/error_network_generic.png') 1x,
69 url('../../app/theme/default_200_percent/common/error_network_generic.png') 2x);
Ben Murdoch58e6fbe2013-07-26 10:20:38 +010070}
71
72.icon-offline {
73 content: -webkit-image-set(
74 url('../../app/theme/default_100_percent/common/error_network_offline.png') 1x,
75 url('../../app/theme/default_200_percent/common/error_network_offline.png') 2x);
Torne (Richard Coles)58218062012-11-14 11:43:16 +000076}
77
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010078#content-top {
79 margin: 20px 20px 20px 25px;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000080}
81
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010082#help-box-outer {
83 overflow: hidden;
84 -webkit-transition: height ease-in 218ms;
85}
86
87#help-box-inner {
88 background-color: #f9f9f9;
89 border-top: 1px solid #EEE;
90 color: #444;
91 padding: 25px 20px;
92 text-align: start;
93}
94
95#suggestions {
Torne (Richard Coles)58218062012-11-14 11:43:16 +000096 margin-top: 15px;
97}
98
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +010099#sub-frame-error-details {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100100 color: #8F8F8F;
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100101<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100102 /* Not done on mobile for performance reasons. */
103 text-shadow: 0 1px 0 rgba(255,255,255,0.3);
104</if>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000105}
106
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100107[jscontent=failedUrl] {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100108 overflow-wrap: break-word;
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000109}
110
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100111button {
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100112 border: 1px solid rgba(0, 0, 0, 0.25);
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100113 border-radius: 2px;
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100114 color: #444;
115 margin: 0px 5px;
116 min-height: 29px;
117 min-width: 65px;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100118 -webkit-user-select: none;
119 padding: 8px 13px;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100120<if expr="not is_android">
121 /* iOS does not support linear-gradient without a prefix. */
122 background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
123 text-shadow: 0 1px 0 rgb(240, 240, 240);
124</if>
125<if expr="is_android">
126 /* Android uses flat background colors. */
127 background-color: #ededed;
128 font-weight: bold;
129</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100130<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100131 /* Not done on mobile for performance reasons. */
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100132 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.75);
133</if>
134}
135
136button:hover {
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100137 border: 1px solid rgba(0, 0, 0, 0.3);
138 color: #000;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100139<if expr="not is_android">
140 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
141</if>
142<if expr="is_android">
143 background-color: #f0f0f0;
144</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100145<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100146 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95);
147</if>
148}
149
150button:active {
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100151 border: 1px solid rgba(0, 0, 0, 0.3);
152 color: #444;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100153<if expr="not is_android">
154 background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
155</if>
156<if expr="is_android">
157 background-color: #e7e7e7;
158</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100159<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100160 box-shadow: none;
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100161</if>
162}
163
164#reload-button {
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100165 color: #fff;
166<if expr="not is_android">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100167 background-image: -webkit-linear-gradient(#5d9aff, #5d9aff 38%, #5891f0);
168 border: 1px solid rgba(45, 102, 195, 1);
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100169 text-shadow: 0 1px 0 rgba(0,0,0,0.5);
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100170</if>
171<if expr="is_android">
172 background-color: rgb(39, 180, 231);
173 border: 1px solid rgb(0, 152, 206);
174</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100175<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100176 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.2);
177</if>
178}
179
180#reload-button:hover {
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100181<if expr="not is_android">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100182 background-image: -webkit-linear-gradient(#659efd, #659efd 38%, #6097f1);
183 border: 1px solid rgba(45, 102, 195, 1);
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100184</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100185<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100186 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.2);
187</if>
188}
189
190#reload-button:active {
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100191<if expr="not is_android">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100192 background-image: -webkit-linear-gradient(#6095ed, #6095ed 38%, #6095ed);
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +0100193 border: 1px solid rgb(38, 84, 160);
194</if>
195<if expr="is_android">
196 background-color: rgb(0, 152, 206);
197</if>
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100198<if expr="not is_android and not pp_ifdef('ios')">
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100199 box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
200</if>
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100201}
202
203.hidden {
204 display: none;
205}
206
207.suggestions {
208 margin-top: 18px;
209}
210
211.suggestion-header {
212 font-weight: bold;
213 margin-bottom: 4px;
214}
215
216.suggestion-body {
217 color: #777;
218}
219
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100220.error-code {
221 color: #A0A0A0;
222 margin-top: 15px;
223}
224
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100225/* Increase line height at higher resolutions. */
226@media (min-width: 641px) and (min-height: 641px) {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100227 #help-box-inner {
228 line-height: 18px;
229 }
230}
231
232/* Decrease padding at low sizes. */
233@media (max-width: 640px), (max-height: 640px) {
234 body {
235 margin: 15px;
236 }
237 h1 {
238 margin: 10px 0px 15px 0px;
239 }
240 #content-top {
241 margin: 15px;
242 }
243 #help-box-inner {
244 padding: 20px;
245 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100246 .suggestions {
247 margin-top: 10px;
248 }
249 .suggestion-header {
250 margin-bottom: 0px;
251 }
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100252 .error-code {
253 margin-top: 10px;
254 }
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100255}
256
257/* Don't allow overflow when in a subframe. */
258html[subframe] body {
259 overflow: hidden;
260}
261
262#sub-frame-error {
263 -webkit-align-items: center;
264 background-color: #DDD;
265 display: -webkit-flex;
266 -webkit-flex-flow: column;
267 height: 100%;
268 -webkit-justify-content: center;
269 left: 0px;
270 position: absolute;
271 top: 0px;
272 width: 100%;
273}
274
275#sub-frame-error:hover {
276 background-color: #EEE;
277}
278
279#sub-frame-error-details {
280 margin: 0 10px;
281 visibility: hidden;
282}
283
284/* Show details only when hovering. */
285#sub-frame-error:hover #sub-frame-error-details {
286 visibility: visible;
287}
288
289/* If the iframe is too small, always hide the error code. */
290/* TODO(mmenke): See if overflow: no-display works better, once supported. */
291@media (max-width: 200px), (max-height: 95px) {
292 #sub-frame-error-details {
293 display: none;
294 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000295}
296
297</style>
298</head>
299
300<script>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000301
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100302function toggleHelpBox() {
303 var helpBoxOuter = document.getElementById('help-box-outer');
304 helpBoxOuter.classList.toggle('hidden');
305 var moreLessButton = document.getElementById('more-less-button');
306 if (helpBoxOuter.classList.contains('hidden')) {
307 moreLessButton.innerText = moreLessButton.moreText;
308 } else {
309 moreLessButton.innerText = moreLessButton.lessText;
310 }
311}
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000312
Ben Murdoch558790d2013-07-30 15:19:42 +0100313function diagnoseErrors() {
314 location = "chrome-extension://kodldpbjkkmmnilagfdheibampofhaom/index.html";
315}
316
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100317// Subframes use a different layout but the same html file. This is to make it
318// easier to support platforms that load the error page via different
319// mechanisms (Currently just iOS).
320if (window.top.location != window.location)
321 document.documentElement.setAttribute('subframe', '');
322
Ben Murdoch7dbb3d52013-07-17 14:55:54 +0100323function updateForDnsProbe(strings) {
324 var context = new JsEvalContext(strings);
325 jstProcess(context, document.getElementById('help-box-outer'));
326 jstProcess(context, document.getElementById('details'));
327}
328
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000329</script>
330
331<body id="t">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100332<div id="main-frame-error">
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000333 <div id="box">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100334 <div id="content-top">
335 <h1>
Ben Murdoch58e6fbe2013-07-26 10:20:38 +0100336 <div><img class="icon" jseval="this.classList.add(iconClass)"></div>
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100337 <span i18n-content="heading"></span>
338 </h1>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000339
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100340 <button id="reload-button" onclick="location = this.url" jsselect="reload" jsvalues=".url:reloadUrl" jscontent="msg"></button>
341 <button id="more-less-button" onclick="toggleHelpBox()" jsdisplay="more" jsvalues=".moreText:more; .lessText:less;" jscontent="more"></button>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000342 </div>
343
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100344 <!-- Outer and inner divs are needed both for margins and sizing. -->
345 <div id="help-box-outer" class="hidden">
346 <div id="help-box-inner">
347 <div jsselect="summary">
348 <span jsvalues=".innerHTML:msg"></span>
349 </div>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000350
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100351 <div class="suggestions" jsselect="suggestions">
352 <div class="suggestion-header" jsvalues=".innerHTML:header"></div>
353 <div class="suggestion-body" jsvalues=".innerHTML:body"></div>
354 </div>
Ben Murdoch558790d2013-07-30 15:19:42 +0100355 <button id="diagnose-button" onclick="diagnoseErrors()"
356 jscontent="diagnose" jsdisplay="diagnose"></button>
Torne (Richard Coles)a93a17c2013-05-15 11:34:50 +0100357 <div class="error-code" jscontent="errorCode"></div>
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100358 </div>
359 </div>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000360 </div>
Ben Murdocheb525c52013-07-10 11:40:50 +0100361</div>
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100362<div id="sub-frame-error">
363 <!-- Show details when hovering over the icon, in case the details are
364 hidden because they're too large. -->
Ben Murdoch58e6fbe2013-07-26 10:20:38 +0100365 <img class="icon" jseval="this.classList.add(iconClass)" jsvalues=".title:errorDetails">
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100366 <div id="sub-frame-error-details" jsvalues=".innerHTML:errorDetails"></div>
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000367</div>
368</body>
369</html>