Cache

Manage the browser cache. This class provides methods to clear the cache and cookies in different browsers.

Classes

Cache

Methods

(async) clear() → {Promise.<void>}

Clears the browser cache. This includes both cache and cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) commands. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache and cookies are cleared.
Type: 
Promise.<void>
Example
await commands.cache.clear();

(async) clearKeepCookies() → {Promise.<void>}

Clears the browser cache while keeping the cookies. For Firefox, it uses the extensionServer setup with specific options. For Chrome and Edge, it uses the Chrome DevTools Protocol (CDP) command to clear the cache. If the browser is not supported, logs an error message.
Throws:
Will throw an error if the browser is not supported.
Returns:
A promise that resolves when the cache is cleared but cookies are kept.
Type: 
Promise.<void>
Example
await commands.cache.clearKeepCookies();