javascript - How to clear cookies of WinRT webview? -
anyone knows how can clear cookies of winrt webview
? if there's no in-build method, can 1 have solution in javascript, can run via invokescript
method of webview
. android , ios having simple 1-5 line of coding clearing cookies, why not in winrt ?
in windows 8 this:
array<string^>^ arguments = ref new array<string^>(1); arguments->set(0, "var cookies = document.cookie.split(';');" + "for (var = 0; < cookies.length; i++) {" + " var cookie = cookies[i];" + " var eqpos = cookie.indexof('=');" + " var name = eqpos > -1 ? cookie.substr(0, eqpos) : cookie;" + " document.cookie = name + '=1;expires=thu, 01 jan 1970 00:00:00 gmt';" + "};"); string^ result = mywebview->invokescript("eval", arguments);
in windows 8.1 preview may use httpcookiemanager class.
Comments
Post a Comment