Storage

Set Storage

Store data in browser storage.

Store data in browser storage.

Writes or updates values in different browser storage types based on the requested storageType (cookies, localStorage, sessionStorage, cache, or IndexedDB).

TIP

<table border="1" cellspacing="0" cellpadding="8"> <thead> <tr> <th>Storage Type</th> <th>Domain filtering / scoping</th> <th>Path filtering / scoping</th> <th>StoreName filtering / scoping</th> <th>Key filtering / scoping</th> <th>Wildcard allowed? (on which fields)</th> <th>Required for Set?</th> </tr> </thead> <tbody> <tr> <td>Cookies</td> <td><code>action.Domain</code></td> <td><code>action.Path</code> (cookie path)</td> <td>(unused)</td> <td><code>action.Key</code> (cookie name)</td> <td>Domain, Path, Key</td> <td>Key + Data; Domain/Path optional</td> </tr> <tr> <td>LocalStorage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td>(unused)</td> <td><code>action.Key</code></td> <td>Key only</td> <td>Key + Data</td> </tr> <tr> <td>SessionStorage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td>(unused)</td> <td><code>action.Key</code></td> <td>Key only</td> <td>Key + Data</td> </tr> <tr> <td>Cache Storage</td> <td>(implicit current origin)</td> <td>(unused)</td> <td><code>action.StoreName</code> (cache name)</td> <td><code>action.Key</code> (cache name / request)</td> <td>StoreName, Key</td> <td>StoreName, Key + Data</td> </tr> <tr> <td>IndexedDB</td> <td>(unused — IndexedDB is origin-scoped)</td> <td><code>action.Path</code> (database name)</td> <td><code>action.StoreName</code> (object store)</td> <td><code>action.Key</code> (record key)</td> <td>Path, StoreName, Key</td> <td>Path + StoreName + Key + Data (exact)</td> </tr> </tbody> </table>

Examples

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.SetStorage(WebsiteStorageType storage type, string data, string domain, string path, string key, string storeName);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.SetStorage(WebsiteStorageType.localStorage).WithStorageDomain("ebay.com").WithStorageKey("u_sclid").WithStorageData(string data).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.SetStorage(string storageType, string sessionId, string domain, string key, string data, string storeName, string path);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.SetStorage).WithStorageType(WebsiteStorageType.localStorage).WithStorageDomain("ebay.com").WithStorageKey("u_sclid").WithValue(string value).Execute();