fix: Replace ES6+ syntax with ES5-compatible JS for IE compatibility#12
Merged
fix: Replace ES6+ syntax with ES5-compatible JS for IE compatibility#12
Conversation
Closed
Agent-Logs-Url: https://github.com/scanfing/HttpFileServer/sessions/71571c95-165e-4cf6-856c-5a6464a6b298 Co-authored-by: scanfing <9262469+scanfing@users.noreply.github.com>
Agent-Logs-Url: https://github.com/scanfing/HttpFileServer/sessions/71571c95-165e-4cf6-856c-5a6464a6b298 Co-authored-by: scanfing <9262469+scanfing@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix upload plugin error in IE 8
fix: Replace ES6+ syntax with ES5-compatible JS for IE compatibility
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IE (8 through 11) throws parse errors on the upload plugin page due to extensive use of ES6+ syntax —
let/const, arrow functions, template literals,class,async/await,for...of, etc.UploadSection.htmlclass ConcurrentUploadQueue/class UploadManager→ prototype-based constructorsasync/await→ Promise chains with.then(onFulfilled, onRejected)(avoids.finally()which IE also lacks)for...of,Array.from(),.flat(),.includes()→ ES5 equivalentscatch {}→catch(e) {}webkitGetAsEntry(WebKit-only, absent in IE)HtmlTemplate.htmllet/const, arrow functions, template literals → ES5Array.from(...).map(b => ...)→ explicitforloop.includes()→arrayIncludes()helper using.indexOf()classList.add('a', 'b')→ separate single-arg calls (IE doesn't support multiple tokens)if (x === undefined)guardswindow.matchMedia→ null-checked;.addEventListener→.addListenerfallback for older IErequestAnimationFrame→msRequestAnimationFrame/setTimeout(cb, 16)fallbackfetchcalls → guarded withtypeof fetch === 'function'e.key→e.keyCode/e.whichfallback for IE keyboard eventsElement.prototype.closestpolyfill (IE has no native implementation)Note: drag-and-drop folder upload relies on
webkitGetAsEntry()which is WebKit-only and will remain non-functional in IE regardless of JS syntax fixes. Basic file listing and XHR-based upload will work in IE 10+.