Bug 1499357 - Move inline script out of new aboutdebugging index.html;r=ladybenko

This preparatory work will be necessary to enable CSP for the new about
debugging.

Differential Revision: https://phabricator.services.mozilla.com/D8854

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2018-10-18 16:10:35 +00:00
Родитель 2e01221c07
Коммит 8193ff5493
3 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -7,17 +7,7 @@
<meta charset="utf-8" />
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/content/aboutdebugging-new/aboutdebugging.css"/>
<script>
"use strict";
const { BrowserLoader } =
ChromeUtils.import("resource://devtools/client/shared/browser-loader.js", {});
const { require } = BrowserLoader({
baseURI: "resource://devtools/client/aboutdebugging-new/",
window,
});
require("./aboutdebugging");
</script>
<script type="application/javascript" src="resource://devtools/client/aboutdebugging-new/initializer.js"></script>
</head>
<body>
<div id="mount"></div>

Просмотреть файл

@ -0,0 +1,22 @@
/* 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/. */
"use strict";
const { BrowserLoader } =
ChromeUtils.import("resource://devtools/client/shared/browser-loader.js", {});
const { require } = BrowserLoader({
baseURI: "resource://devtools/client/aboutdebugging-new/",
window,
});
// The only purpose of this module is to load the real aboutdebugging module via the
// BrowserLoader.
// This cannot be done using an inline script tag in index.html because we are applying
// CSP for about: pages in Bug 1492063.
// And this module cannot be merged with aboutdebugging.js because modules loaded with
// script tags are using Promises bound to the lifecycle of the document, while modules
// loaded with a devtools loader use Promises that will still resolve if the document is
// destroyed. This is particularly useful to ensure asynchronous destroy() calls succeed.
require("./aboutdebugging");

Просмотреть файл

@ -4,6 +4,7 @@
DevToolsModules(
'aboutdebugging.js',
'initializer.js',
)
DIRS += [