gecko clear cache history & cookies

后端 未结 2 912
隐瞒了意图╮
隐瞒了意图╮ 2021-02-10 03:53

Help! I use GeckoFx-Windows-10.0-0.6 for browser and xulrunner-10.0.en-US.win32. ( Visual Studio 2010 c# ) everything works well. But i need to

2条回答
  •  伪装坚强ぢ
    2021-02-10 04:30

    For what its worth and since I looked a while for this, on GeckoFX 29 at least history follows the same pattern:

    nsIBrowserHistory historyMan = Xpcom.GetService(Gecko.Contracts.NavHistoryService);
    historyMan = Xpcom.QueryInterface(historyMan);
    historyMan.RemoveAllPages();
    

    For Cache without being sure is the correct way:

    // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/imgICache
    Gecko.Cache.ImageCache.ClearCache(true);
    Gecko.Cache.ImageCache.ClearCache(false);
    // Defaults to all devices(0) - https://bitbucket.org/geckofx/geckofx-9.0/issue/7/idl-translation-bug-for-enums
    Gecko.Cache.CacheService.Clear(new CacheStoragePolicy());
    

提交回复
热议问题