Skip to content

Commit

Permalink
remove elements from index.html when loading script or stylesheet fil…
Browse files Browse the repository at this point in the history
…es fails
  • Loading branch information
khassel committed Sep 13, 2024
1 parent 78a6220 commit af1d732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ _This release is scheduled to be released on 2024-10-01._

### Added

- [core] removed `config.paths.vendor` (could not work because `vendor` is hardcoded in `index.html`), renamed `config.paths.modules` to `config.foreignModulesDir`
- [core] add variable `MM_CUSTOMCSS_FILE` which - if set - overrides `config.customCss`
- [core] add variable `MM_MODULES_DIR` which - if set - overrides `config.foreignModulesDir`
- [core] removed `config.paths.vendor` (could not work because `vendor` is hardcoded in `index.html`), renamed `config.paths.modules` to `config.foreignModulesDir`, added variable `MM_CUSTOMCSS_FILE` which - if set - overrides `config.customCss`, added variable `MM_MODULES_DIR` which - if set - overrides `config.foreignModulesDir`
- [core] elements are now removed from index.html when loading script or stylesheet files fails

### Removed

Expand Down
2 changes: 2 additions & 0 deletions js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ const Loader = (function () {
};
script.onerror = function () {
Log.error("Error on loading script:", fileName);
script.remove();
resolve();
};
document.getElementsByTagName("body")[0].appendChild(script);
Expand All @@ -193,6 +194,7 @@ const Loader = (function () {
};
stylesheet.onerror = function () {
Log.error("Error on loading stylesheet:", fileName);
stylesheet.remove();
resolve();
};
document.getElementsByTagName("head")[0].appendChild(stylesheet);
Expand Down

0 comments on commit af1d732

Please sign in to comment.