Skip to content

Commit

Permalink
Version 249:
Browse files Browse the repository at this point in the history
* Chrome on iOS and all browsers on Android are no longer prevented from dynamically updating the URL parameters in the current URL, however these browsers shall still not push new history states when opening single cameras.
  • Loading branch information
bp2008 committed Jun 22, 2023
1 parent 668ae8f commit bd28f72
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ui3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
};
</script>
<script type="text/javascript">
var ui_version = "248";
var ui_version = "249";
var bi_version = "%%VERSION%%";
var appPath_raw = "%%VIRTDIR%%";
var local_bi_session = "%%SESSION%%";
Expand Down
30 changes: 21 additions & 9 deletions ui3/ui3.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ var web_workers_supported = false;
var export_blob_supported = false;
var exporting_clips_to_avi_supported = false;
var html5HistorySupported = false;
var html5HistoryPushEnabled = false;
var fetch_supported = false;
var readable_stream_supported = false;
var webgl_supported = false;
Expand Down Expand Up @@ -256,7 +257,8 @@ function DoUIFeatureDetection()
fullscreen_supported = ((document.documentElement.requestFullscreen || document.documentElement.msRequestFullscreen || document.documentElement.mozRequestFullScreen || document.documentElement.webkitRequestFullscreen) && (document.exitFullscreen || document.msExitFullscreen || document.mozCancelFullScreen || document.webkitExitFullscreen)) ? true : false;
audio_playback_supported = any_h264_playback_supported && web_audio_supported && web_audio_buffer_source_supported && web_audio_buffer_copyToChannel_supported;
exporting_clips_to_avi_supported = any_h264_playback_supported && export_blob_supported;
html5HistorySupported = isHtml5HistorySupported()
html5HistorySupported = isHtml5HistorySupported();
html5HistoryPushEnabled = shouldHtml5HistoryPushBeEnabled();
flac_supported = isFlacSupported();
speech_synthesis_supported = isSpeechSupported();

Expand Down Expand Up @@ -337,7 +339,7 @@ function DoUIFeatureDetection()
{
ul_root.append('<li>Fullscreen mode is not supported.</li>');
}
if (!html5HistorySupported)
if (!html5HistoryPushEnabled)
{
ul_root.append('<li>The back button will not close the current clip or camera, like it does on most other platforms.</li>');
}
Expand Down Expand Up @@ -435,10 +437,6 @@ function isHtml5HistorySupported()
{
try
{
if (BrowserIsIOSChrome())
return false; // Chrome on iOS has too many history bugs.
if (BrowserIsAndroid())
return false; // If the back button is overridden on Android, it can't be used to close the browser while UI3 is the first item in history.
if (window.history && typeof window.history.state == "object" && typeof window.history.pushState == "function" && typeof window.history.replaceState == "function")
return true;
return false;
Expand All @@ -447,6 +445,19 @@ function isHtml5HistorySupported()
return false;
}
}
function shouldHtml5HistoryPushBeEnabled()
{
try
{
if (BrowserIsIOSChrome())
return false; // Chrome on iOS has too many history bugs.
if (BrowserIsAndroid())
return false; // If the back button is overridden on Android, it can't be used to close the browser while UI3 is the first item in history.
if (isHtml5HistorySupported())
return true;
} catch (e) { }
return false;
}
function requestAnimationFramePolyFill()
{
try
Expand Down Expand Up @@ -5119,7 +5130,7 @@ function DropdownBoxes()
streamingProfileUI.open();
break;
case "copy_current_url":
clipboardHelper.CopyText(location.href);
clipboardHelper.CopyText(UpdateCurrentURL());
break;
case "system_log":
systemLog.open();
Expand Down Expand Up @@ -27819,7 +27830,7 @@ function AjaxHistoryManager()
return false;
return true;
}
if (html5HistorySupported)
if (html5HistoryPushEnabled)
buttonOverride = new HistoryButtonOverride(BackButtonPressed);
}
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -27857,7 +27868,7 @@ function GetCleanUrlSearchParams()
function UpdateCurrentURL()
{
if (!html5HistorySupported || !loadingHelper.DidLoadingFinish())
return;
return location.href;
var search = GetCleanUrlSearchParams();

search.set("t", currentPrimaryTab);
Expand Down Expand Up @@ -27912,6 +27923,7 @@ function UpdateCurrentURL()
console.error(ex);
}
}
return newUrl;
}
BindEventsPassive(document, "mouseleave", UpdateCurrentURL);
/**
Expand Down

0 comments on commit bd28f72

Please sign in to comment.