How to clear the cache data in Electron(atom shell)?

后端 未结 8 877
有刺的猬
有刺的猬 2020-12-13 18:48

I want to clear cache data in Electron(atom-shell). I don\'t find any api like gui.App.clearCache()(node-webkit api to clear cache data) in Electron. If you find an

8条回答
  •  盖世英雄少女心
    2020-12-13 19:21

    You can use session.clearCache api.

    var remote = require('remote'); 
    var win = remote.getCurrentWindow();
    win.webContents.session.clearCache(function(){
    //some callback.
    });
    

提交回复
热议问题