Skip to content

Commit

Permalink
REFACTOR: Use a <script src> tag to start the app (#12401)
Browse files Browse the repository at this point in the history
This is to help with potential CSP issues.
  • Loading branch information
eviltrout committed Mar 16, 2021
1 parent dc3af28 commit 1c82ed9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 1 addition & 9 deletions app/assets/javascripts/discourse/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,10 @@
<div id='offscreen-content'>
</div>

<script>
document.addEventListener("discourse-booted", (e) => {
const config = e.detail;
const app = require(`${config.modulePrefix}/app`)["default"].create(
config
);
app.start();
});
</script>
{{bootstrap-content-for "hidden-login-form"}}
{{bootstrap-content-for "preloaded"}}

<script src="{{rootURL}}assets/scripts/start-app.js"></script>
<script src="{{rootURL}}assets/scripts/discourse-boot.js"></script>

{{bootstrap-content-for "body-footer"}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
document.addEventListener("discourse-booted", (e) => {
const config = e.detail;
const app = require(`${config.modulePrefix}/app`)["default"].create(config);
app.start();
});

1 comment on commit 1c82ed9

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916/211

Please sign in to comment.