Skip to content

Commit

Permalink
download source maps for external js files (#5)
Browse files Browse the repository at this point in the history
External dependencies were made locally available through:
#3
On opening Dev console, the external JS libraries attempt to fetch
source maps. This PR brings them in too.

Also noticed that `wss` is used first and then once it fails, `ws`
protocol is used. For this, a simpler fix by directly checking
[location.protocol](https://developer.mozilla.org/en-US/docs/Web/API/Location/protocol#browser_compatibility).
  • Loading branch information
vrsandeep authored Dec 15, 2024
1 parent cab532c commit 92cf107
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ gulp.task('copy-files', () => {
'public/img/**',
'public/webfonts/*',
'public/js/*.min.js',
'public/ext/js/*.min.js',
'public/ext/js/*.js',
'public/ext/map/*.map',
'public/ext/css/*.min.css',
],
{
Expand Down
2 changes: 1 addition & 1 deletion public/ext/js/alpine-v2.8.0-ie11.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/ext/js/alpine-v2.8.0.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/ext/js/redoc.standalone.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/ext/map/redoc.standalone.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/js/download-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const component = () => {
ws: undefined,

wsConnect(secure = true) {
if (location.protocol !== 'https:') {
secure = false;
}
const url = `${secure ? 'wss' : 'ws'}://${
location.host
}${base_url}api/admin/mangadex/queue`;
Expand Down
2 changes: 1 addition & 1 deletion src/util/util.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ IMGS_PER_PAGE = 5
ENTRIES_IN_HOME_SECTIONS = 8
UPLOAD_URL_PREFIX = "/uploads"
STATIC_DIRS = %w(/css /ext/css /js /ext/js /img /webfonts
/favicon.ico /robots.txt /manifest.json)
/ext/map /favicon.ico /robots.txt /manifest.json)
SUPPORTED_FILE_EXTNAMES = [".zip", ".cbz", ".rar", ".cbr"]
SUPPORTED_IMG_TYPES = %w(
image/jpeg
Expand Down

0 comments on commit 92cf107

Please sign in to comment.