Classes
Methods
(async) clear() → {Promise.<void>}
Clears the browser cache. This includes both cache and cookies. 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 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();