import win.ui; /*DSG{{*/ var winform = win.form(text="WebView2 - 清除指定站点数据") /*}}*/ import web.view; var wb = web.view(winform); /* 调用 CDP 命令清除指定站点数据 https://chromedevtools.github.io/devtools-protocol/tot/Storage/#method-clearDataForOrigin storageTypes 可指定的值如下: cookies, file_systems, indexeddb, local_storage, shader_cache, websql,service_workers, cache_storage, interest_groups, shared_storage, storage_buckets, all, other https://chromedevtools.github.io/devtools-protocol/tot/Storage/#type-StorageType */ wb.cdp("Storage.clearDataForOrigin", { "origin": "https://www.example.com", "storageTypes": "all" } ); wb.go("https://www.example.com"); winform.show(); win.loopMessage();