Merge pull request #773 from wabbajack-tools/no-more-ads

Fixes the popups from MediaFire
This commit is contained in:
Timothy Baldridge 2020-04-29 10:38:16 -06:00 committed by GitHub
commit ad74084e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,9 @@ namespace Wabbajack.Lib.WebAutomation
public CefSharpWrapper(IWebBrowser browser)
{
_browser = browser;
_browser.DownloadHandler = new DownloadHandler(this);
_browser.LifeSpanHandler = new PopupBlocker(this);
}
public Task NavigateTo(Uri uri)
@ -33,11 +36,9 @@ namespace Wabbajack.Lib.WebAutomation
tcs.SetResult(true);
}
};
_browser.LoadingStateChanged += handler;
_browser.Load(uri.ToString());
_browser.DownloadHandler = new DownloadHandler(this);
_browser.LifeSpanHandler = new PopupBlocker(this);
return tcs.Task;
}
@ -80,7 +81,7 @@ namespace Wabbajack.Lib.WebAutomation
IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser? newBrowser)
{
// Block popups
newBrowser = null;
newBrowser = chromiumWebBrowser;
return true;
}
@ -90,7 +91,7 @@ namespace Wabbajack.Lib.WebAutomation
public bool DoClose(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
return true;
return false;
}
public void OnBeforeClose(IWebBrowser chromiumWebBrowser, IBrowser browser)