Skip to content

fix: Replace ES6+ syntax with ES5-compatible JS for IE compatibility#12

Merged
scanfing merged 3 commits intomainfrom
copilot/fix-ie-upload-plugin-error
Apr 28, 2026
Merged

fix: Replace ES6+ syntax with ES5-compatible JS for IE compatibility#12
scanfing merged 3 commits intomainfrom
copilot/fix-ie-upload-plugin-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

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.html

  • class ConcurrentUploadQueue / class UploadManager → prototype-based constructors
  • async/await → Promise chains with .then(onFulfilled, onRejected) (avoids .finally() which IE also lacks)
  • Arrow functions, template literals, for...of, Array.from(), .flat(), .includes() → ES5 equivalents
  • Optional catch binding catch {}catch(e) {}
  • Added null guard on webkitGetAsEntry (WebKit-only, absent in IE)

HtmlTemplate.html

  • All let/const, arrow functions, template literals → ES5
  • Array.from(...).map(b => ...) → explicit for loop
  • .includes()arrayIncludes() helper using .indexOf()
  • Multi-arg classList.add('a', 'b') → separate single-arg calls (IE doesn't support multiple tokens)
  • Default parameters → explicit if (x === undefined) guards
  • window.matchMedia → null-checked; .addEventListener.addListener fallback for older IE
  • requestAnimationFramemsRequestAnimationFrame / setTimeout(cb, 16) fallback
  • fetch calls → guarded with typeof fetch === 'function'
  • e.keye.keyCode / e.which fallback for IE keyboard events
  • Added Element.prototype.closest polyfill (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+.

Copilot AI linked an issue Apr 28, 2026 that may be closed by this pull request
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
Copilot AI requested a review from scanfing April 28, 2026 09:06
@scanfing scanfing marked this pull request as ready for review April 28, 2026 09:27
@scanfing scanfing merged commit d3afcc0 into main Apr 28, 2026
@scanfing scanfing deleted the copilot/fix-ie-upload-plugin-error branch April 28, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ie加载上传插件时会提示错误。

2 participants