diff --git a/CefSharp.Core/WebBrowserExtensionsEx.cs b/CefSharp.Core/WebBrowserExtensionsEx.cs index 537f7cba33..d6d770f189 100644 --- a/CefSharp.Core/WebBrowserExtensionsEx.cs +++ b/CefSharp.Core/WebBrowserExtensionsEx.cs @@ -99,9 +99,15 @@ public static void DownloadUrl(this IFrame frame, string url, Action /// valid frame /// url to download + /// control caching policy /// A task that can be awaited to get the representing the Url - public static Task DownloadUrlAsync(this IFrame frame, string url) + public static Task DownloadUrlAsync(this IFrame frame, string url, UrlRequestFlags urlRequestFlags = UrlRequestFlags.None) { + if (frame == null) + { + throw new ArgumentNullException(nameof(frame)); + } + if (!frame.IsValid) { throw new Exception("Frame is invalid, unable to continue."); @@ -116,6 +122,7 @@ public static Task DownloadUrlAsync(this IFrame frame, string url) request.Method = "GET"; request.Url = url; + request.Flags = urlRequestFlags; var memoryStream = new MemoryStream();