Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ Recap: Mastodon v4.3 features (https://github.com/mastodon/mastodon/releases/tag
- 🙈 Handle Mastodon's upcoming `blur` filter https://mastodon.social/@cheeaun/114301571477875063
- 🐛 Bug fixes

## Next
## June 8, 2025

📢 https://mastodon.social/@cheeaun/114647753143423772

- 🌟 Featured profiles (for upcoming Mastodon v4.4)
- 🔑 Revoke access token when logging out
Expand Down
30 changes: 30 additions & 0 deletions src/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,36 @@ if ('AbortSignal' in window) {
});
}

// AbortSignal.any polyfill
// Based on https://github.com/mozilla/pdf.js/pull/19681/files
if ('AbortSignal' in window && !AbortSignal.any) {
AbortSignal.any = function (iterable) {
const ac = new AbortController();
const { signal } = ac;

// Return immediately if any of the signals are already aborted.
for (const s of iterable) {
if (s.aborted) {
ac.abort(s.reason);
return signal;
}
}

// Register "abort" listeners for all signals.
for (const s of iterable) {
s.addEventListener(
'abort',
() => {
ac.abort(s.reason);
},
{ signal }, // Automatically remove the listener.
);
}

return signal;
};
}

// URL.parse() polyfill
if ('URL' in window && typeof URL.parse !== 'function') {
URL.parse = function (url, base) {
Expand Down