Merge pull request #3905 from manfrommedan/fix/promise-withresolvers-polyfill

Add Promise.withResolvers polyfill for older WebViews (Chrome < 119)
This commit is contained in:
Timo
2026-06-02 19:43:12 +08:00
committed by GitHub

View File

@@ -16,6 +16,19 @@
<script>
window.global = window;
</script>
<!-- Polyfill for Chrome < 119 (Huawei WebView, etc.) -->
<script>
if (!Promise.withResolvers) {
Promise.withResolvers = function () {
var resolve, reject;
var promise = new Promise(function (a, b) {
resolve = a;
reject = b;
});
return { promise: promise, resolve: resolve, reject: reject };
};
}
</script>
<% if (packageType === "full") { %>
<!-- Open graph meta tags -->