mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1017257 - Make loop code CSP-friendly (remove all inline script) r=Standard8
This commit is contained in:
parent
1c5f67f8c4
commit
772c1c9de0
@ -11,21 +11,14 @@
|
||||
<link rel="stylesheet" type="text/css" href="loop/shared/css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="loop/shared/css/conversation.css">
|
||||
</head>
|
||||
<body class="fx-embedded" onload="loop.conversation.init();">
|
||||
<body class="fx-embedded">
|
||||
|
||||
<div id="messages"></div>
|
||||
|
||||
<div id="main"></div>
|
||||
|
||||
<script type="text/javascript" src="loop/libs/l10n.js"></script>
|
||||
<script>
|
||||
window.OTProperties = {
|
||||
cdnURL: 'loop/',
|
||||
};
|
||||
window.OTProperties.assetURL = window.OTProperties.cdnURL + 'sdk-content/';
|
||||
window.OTProperties.configURL = window.OTProperties.assetURL + 'js/dynamic_config.min.js';
|
||||
window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
|
||||
</script>
|
||||
<script type="text/javascript" src="loop/js/otconfig.js"></script>
|
||||
<script type="text/javascript" src="loop/libs/sdk.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/react-0.11.1.js"></script>
|
||||
<script type="text/javascript" src="loop/shared/libs/jquery-2.1.0.js"></script>
|
||||
|
@ -431,3 +431,5 @@ loop.conversation = (function(OT, mozL10n) {
|
||||
init: init
|
||||
};
|
||||
})(window.OT, document.mozL10n);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loop.conversation.init);
|
||||
|
@ -431,3 +431,5 @@ loop.conversation = (function(OT, mozL10n) {
|
||||
init: init
|
||||
};
|
||||
})(window.OT, document.mozL10n);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loop.conversation.init);
|
||||
|
10
browser/components/loop/content/js/otconfig.js
Normal file
10
browser/components/loop/content/js/otconfig.js
Normal file
@ -0,0 +1,10 @@
|
||||
/* 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/. */
|
||||
|
||||
window.OTProperties = {
|
||||
cdnURL: 'loop/',
|
||||
};
|
||||
window.OTProperties.assetURL = window.OTProperties.cdnURL + 'sdk-content/';
|
||||
window.OTProperties.configURL = window.OTProperties.assetURL + 'js/dynamic_config.min.js';
|
||||
window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
|
@ -551,3 +551,5 @@ loop.panel = (function(_, mozL10n) {
|
||||
ToSView: ToSView
|
||||
};
|
||||
})(_, document.mozL10n);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loop.panel.init);
|
||||
|
@ -551,3 +551,5 @@ loop.panel = (function(_, mozL10n) {
|
||||
ToSView: ToSView
|
||||
};
|
||||
})(_, document.mozL10n);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', loop.panel.init);
|
||||
|
@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="loop/shared/css/common.css">
|
||||
<link rel="stylesheet" type="text/css" href="loop/shared/css/panel.css">
|
||||
</head>
|
||||
<body class="panel" onload="loop.panel.init();">
|
||||
<body class="panel">
|
||||
|
||||
<div id="main"></div>
|
||||
|
||||
|
@ -14,6 +14,7 @@ browser.jar:
|
||||
content/browser/loop/js/client.js (content/js/client.js)
|
||||
content/browser/loop/js/desktopRouter.js (content/js/desktopRouter.js)
|
||||
content/browser/loop/js/conversation.js (content/js/conversation.js)
|
||||
content/browser/loop/js/otconfig.js (content/js/otconfig.js)
|
||||
content/browser/loop/js/panel.js (content/js/panel.js)
|
||||
|
||||
# Shared styles
|
||||
|
@ -49,6 +49,9 @@
|
||||
<script src="conversation_test.js"></script>
|
||||
<script src="panel_test.js"></script>
|
||||
<script>
|
||||
// Stop the default init functions running to avoid conflicts in tests
|
||||
document.removeEventListener('DOMContentLoaded', loop.panel.init);
|
||||
document.removeEventListener('DOMContentLoaded', loop.conversation.init);
|
||||
mocha.run(function () {
|
||||
$("#mocha").append("<p id='complete'>Complete.</p>");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user