chore(browser): sync current working implementation

Rollback tag: pre-current-browser-sync-20260818
This commit is contained in:
2026-08-18 14:30:23 +08:00
parent 6b78bbbf04
commit d3587a16f1
17 changed files with 133 additions and 437 deletions
-39
View File
@@ -126,45 +126,6 @@ namespace Lskj.Control
cefBrowserSettings.GetMainFrame().LoadUrl(webResponse.ResponseUri.AbsoluteUri);
}
}
internal bool BrowserClosing(CefBrowser browser)
{
return false;
}
internal void BrowserClosed(CefBrowser browser)
{
var currentBrowser = cefBrowserSettings;
if (currentBrowser == null || browser == null)
return;
bool sameBrowser = ReferenceEquals(currentBrowser, browser);
if (!sameBrowser)
{
try
{
sameBrowser = currentBrowser.IsSame(browser);
}
catch (Exception)
{
}
}
if (sameBrowser)
Interlocked.CompareExchange(ref cefBrowserSettings, null, currentBrowser);
}
internal void CloseBrowser()
{
var browser = cefBrowserSettings;
if (browser != null)
browser.GetHost().CloseBrowser();
}
private void CloseBrowserForDispose()
{
}
public static string ToEnUrl(string url)
{
string[] urlParams = url.Split('?');