From 6ae05462a8781b797cd84bc7c232007cda057f9a Mon Sep 17 00:00:00 2001 From: "huayong.xu" Date: Fri, 19 Jan 2024 15:09:31 +0800 Subject: [PATCH] [NUI][API10] Create Context/CookieManager when WebView is created. --- src/Tizen.NUI/src/public/WebView/WebView.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Tizen.NUI/src/public/WebView/WebView.cs b/src/Tizen.NUI/src/public/WebView/WebView.cs index 62bce76..4a10a3c 100755 --- a/src/Tizen.NUI/src/public/WebView/WebView.cs +++ b/src/Tizen.NUI/src/public/WebView/WebView.cs @@ -29,9 +29,6 @@ namespace Tizen.NUI.BaseComponents /// 9 public partial class WebView : View { - private static readonly WebContext context = new WebContext(Interop.WebView.GetWebContext(), false); - private static readonly WebCookieManager cookieManager = new WebCookieManager(Interop.WebView.GetWebCookieManager(), false); - private Color contentBackgroundColor; private bool tilesClearedWhenHidden; private float tileCoverAreaMultiplier; @@ -989,13 +986,25 @@ namespace Tizen.NUI.BaseComponents /// Context. /// [EditorBrowsable(EditorBrowsableState.Never)] - public WebContext Context => context; + public WebContext Context + { + get + { + return new WebContext(Interop.WebView.GetWebContext(), false); + } + } /// /// CookieManager. /// [EditorBrowsable(EditorBrowsableState.Never)] - public WebCookieManager CookieManager => cookieManager; + public WebCookieManager CookieManager + { + get + { + return new WebCookieManager(Interop.WebView.GetWebCookieManager(), false); + } + } /// /// BackForwardList. -- 2.7.4