Bug 948889 - Move the inline script in aboutTabCrashed.xhtml into a separate file; r=ttaubert

This commit is contained in:
Georgiana Chelu 2013-12-24 15:32:55 +01:00
parent 09bd68bda3
commit 6956ed9628
3 changed files with 22 additions and 18 deletions

View File

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function parseQueryString() {
let url = document.documentURI;
let queryString = url.replace(/^about:tabcrashed?e=tabcrashed/, "");
let urlMatch = queryString.match(/u=([^&]+)/);
let url = urlMatch && urlMatch[1] ? decodeURIComponent(urlMatch[1]) : "";
let titleMatch = queryString.match(/d=([^&]*)/);
title = titleMatch && titleMatch[1] ? decodeURIComponent(titleMatch[1]) : "";
return [url, title];
}
let [url, title] = parseQueryString();
document.title = title;
document.getElementById("tryAgain").setAttribute("url", url);

View File

@ -42,22 +42,5 @@
</div>
</body>
<script type="text/javascript;version=1.8"><![CDATA[
function parseQueryString() {
let url = document.documentURI;
let queryString = url.replace(/^about:tabcrashed?e=tabcrashed/, "");
let urlMatch = queryString.match(/u=([^&]+)/);
let url = urlMatch && urlMatch[1] ? decodeURIComponent(urlMatch[1]) : "";
let titleMatch = queryString.match(/d=([^&]*)/);
title = titleMatch && titleMatch[1] ? decodeURIComponent(titleMatch[1]) : "";
return [url, title];
}
let [url, title] = parseQueryString();
document.title = title;
document.getElementById("tryAgain").setAttribute("url", url);
]]></script>
<script type="text/javascript;version=1.8" src="chrome://browser/content/aboutTabCrashed.js"/>
</html>

View File

@ -56,6 +56,7 @@ browser.jar:
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/aboutSocialError.xhtml (content/aboutSocialError.xhtml)
content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js)
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
* content/browser/browser.css (content/browser.css)
* content/browser/browser.js (content/browser.js)