Exemple #1
0
        private void OnSecurityOriginListAcquired(WebSecurityOriginList list)
        {
            WebSecurityOrigin origin = list.GetItemAtIndex(0);

            tlog.Debug(tag, "security origin, Host : " + origin.Host);
            tlog.Debug(tag, "security origin, Protocol : " + origin.Protocol);
        }
Exemple #2
0
        private void OnSecurityOriginListAcquired(WebSecurityOriginList list)
        {
            Log.Info("WebView", $"------------security origin, count: {list.ItemCount}-------");
            for (uint i = 0; i < list.ItemCount; i++)
            {
                WebSecurityOrigin origin = list.GetItemAtIndex(i);
                Log.Info("WebView", $"------------security origin, Host: {origin.Host}-------");
                Log.Info("WebView", $"------------security origin, Protocol: {origin.Protocol}-------");
            }

            if (list.ItemCount > 0)
            {
                WebSecurityOrigin origin = list.GetItemAtIndex(0);
                simpleWebView.Context.GetWebStorageUsageForOrigin(origin, OnStorageUsageAcquired);
                simpleWebView.Context.DeleteApplicationCache(origin);
                simpleWebView.Context.DeleteWebDatabase(origin);
                simpleWebView.Context.DeleteWebStorage(origin);
            }
        }
        public void WebSecurityOriginListGetItemAtIndex()
        {
            tlog.Debug(tag, $"WebSecurityOriginListGetItemAtIndex START");

            using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
            {
                webview.LoadUrl("http://www.baidu.com");

                var testingTarget = new WebSecurityOriginList(webview.SwigCPtr.Handle, false);
                Assert.IsNotNull(testingTarget, "null handle");
                Assert.IsInstanceOf <WebSecurityOriginList>(testingTarget, "Should return WebSecurityOriginList instance.");

                var result = testingTarget.GetItemAtIndex(0);
                tlog.Debug(tag, "GetItemAtIndex : " + result);

                webview.ClearCache();
                webview.ClearCookies();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"WebSecurityOriginListGetItemAtIndex END (OK)");
        }