main
liutao 2 weeks ago
parent 75ab796a09
commit 5302b0f47d

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@ -147,6 +147,31 @@
</div>
</div>
</div>
<!-- Edge 兼容hiprint socket.io 连接添加 polling 降级策略,防止 WebSocket-only 连接在 Edge 下失败 -->
<script>
(function() {
var _io = window.io;
Object.defineProperty(window, 'io', {
configurable: true,
enumerable: true,
get: function() { return _io; },
set: function(fn) {
if (typeof fn === 'function' && fn !== _io && !fn.__hiprintPatched) {
var _orig = fn;
_io = function(url, opts) {
opts = Object.assign({}, opts || {});
opts.transports = ['websocket', 'polling'];
return _orig(url, opts);
};
_io.__hiprintPatched = true;
} else {
_io = fn;
}
}
});
})();
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

Loading…
Cancel
Save