On this page
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
- Constructors - API calls which return an object, typically one that offers API methods
- Methods - API calls which can only be made on an object returned by a constructor
API Documentation
Functions
websiteDataTypes
Signature | hs.webview.datastore.websiteDataTypes() -> table |
---|---|
Type | Function |
Description | Returns a list of the currently available data types within a datastore. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 20 |
Constructors
default
Signature | hs.webview.datastore.default() -> datastoreObject |
---|---|
Type | Constructor |
Description | Returns an object representing the default datastore for Hammerspoon |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 47 |
fromWebview
Signature | hs.webview.datastore.fromWebview(webview) -> datastoreObject |
---|---|
Type | Constructor |
Description | Returns an object representing the datastore for the specified |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 87 |
newPrivate
Signature | hs.webview.datastore.newPrivate() -> datastoreObject |
---|---|
Type | Constructor |
Description | Returns an object representing a newly created non-persistent (private) datastore for use with a Hammerspoon |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 66 |
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 |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 117 |
persistent
Signature | hs.webview.datastore:persistent() -> bool |
---|---|
Type | Method |
Description | Returns whether or not the datastore is persistent. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 381 |
removeRecordsAfter
Signature | hs.webview.datastore:removeRecordsAfter(date, dataTypes, [callback]) -> datastoreObject |
---|---|
Type | Method |
Description | Removes the specified types of data from the datastore if the data was added or changed since the given date. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 287 |
removeRecordsFor
Signature | hs.webview.datastore:removeRecordsFor(displayNames, dataTypes, [callback]) -> datastoreObject |
---|---|
Type | Method |
Description | Remove data from the datastore of the specified type(s) for the specified site(s). |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/webview/libwebview_datastore.m line 186 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.webview.datastore.html