#
hs.webview.datastore
Provides methods to list and purge the various types of data used by websites visited with hs.webview
.
This module is only available under OS X 10.11 and later.
This module allows you to list and selectively purge the types of data stored locally for the websites visited with the hs.webview
module. It also adds support for non-persistent datastores to hs.webview
(private browsing) and allows a non-persistent datastore to be shared among multiple instances of hs.webview
objects.
The datastore for a webview contains various types of data including cookies, disk and memory caches, and persistent data such as WebSQL, IndexedDB databases, and local storage. You can use methods in this module to selectively or completely purge the common datastore (used by all Hammerspoon hs.webview
instances that do not use a non-persistent datastore).
#
API Overview
Functions - API calls offered directly by the extension
websiteDataTypes
Constructors - API calls which return an object, typically one that offers API methods
default fromWebview newPrivate
Methods - API calls which can only be made on an object returned by a constructor
fetchRecords persistent removeRecordsAfter removeRecordsFor
#
API Documentation
#
Functions
#
websiteDataTypes
#
Constructors
#
default
#
fromWebview
#
newPrivate
#
Methods
#
fetchRecords
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.webview.datastore:fetchRecords([dataTypes], callback) -> datastoreObject
|
| Type | Method |
| Description | Generates a list of the datastore records of the specified type, and invokes the callback function with the list. |
| Parameters |
dataTypes
- an optional string or table specifying the data types to fetch from the datastore. If this parameter is not specified, it defaults to the list returned byhs.webview.datastore.websiteDataTypes .callback
- a function which accepts as it's argument an array-table containing tables with the following key-value pairs:displayName
- a string containing the site's display name. Typically, the display name is the domain name with suffix taken from the resource’s security origin (website name).dataTypes
- a table containing strings representing the types of data stored for the website specified bydisplayName
.
- the datastore object
- only those sites with one or more of the specified data types are returned
- for the sites returned, only those data types that were present in the query will be included in the list, even if the site has data of another type in the datastore.