Skip to content

Commit 2b48e04

Browse files
committed
Safari 26.2 blank page web socket workaround
1 parent bb9df9d commit 2b48e04

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

web/kiwi/kiwi_util.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ document.onreadystatechange = function() {
167167

168168
function kiwi_load2()
169169
{
170-
if (isDefined(kiwi_check_js_version)) {
170+
if (typeof(kiwi_check_js_version) !== 'undefined' /* declared */) {
171171
// done as an AJAX because needed long before any websocket available
172172
kiwi_ajax("/VER", 'kiwi_version_cb');
173173
} else {
174174
kiwi.conn_tstamp = (new Date()).getTime(); // fallback
175-
if (isDefined(kiwi_bodyonload))
175+
if (typeof(kiwi_bodyonload) !== 'undefined' /* declared */) {
176176
kiwi_bodyonload('');
177+
}
177178
}
178179
}
179180

@@ -257,6 +258,18 @@ function kiwi_version_cb(response_obj)
257258
//console.log('conn_tstamp='+ kiwi.conn_tstamp);
258259

259260
kiwi_bodyonload(s);
261+
262+
// Workaround for Safari 26.2 SND web socket hang problem.
263+
// Doing this /status XHR transaction clears the web socket hang.
264+
// However things still do not work in Private Relay mode.
265+
// Discovered by Philippe (Tremolat) on the Kiwi Forum.
266+
if (kiwi_isSafari()) {
267+
setTimeout(function() {
268+
kiwi_ajax("/status", function(o) {
269+
console.log(o);
270+
});
271+
}, 100);
272+
}
260273
}
261274

262275
function kiwi_version_continue_cb()
@@ -1676,13 +1689,15 @@ function kiwi_open_or_reload_page(obj) // { url, hp, path, qs, tab, delay }
16761689
url = kiwi_SSL() + host_port + pathname + query;
16771690
}
16781691
var delay = w3_opt(obj, 'delay', 0);
1679-
console.log('kiwi_open_or_reload_page: '+ url +' delay='+ delay);
1692+
//console.log('kiwi_open_or_reload_page: '+ url +' delay='+ delay);
16801693

16811694
var reload = function() {
16821695
var rv;
16831696
if (w3_opt(obj, 'tab', false)) {
1697+
//console.log('kiwi_open_or_reload_page: NEW TAB url='+ url);
16841698
rv = window.open(url, '_blank');
16851699
} else {
1700+
//console.log('kiwi_open_or_reload_page: NEW WIN url='+ url);
16861701
window.location.href = url;
16871702
rv = true;
16881703
}

web/kiwi/kiwi_util.min.js

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)