forked from kooksee/go-chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowsing_data.go
95 lines (75 loc) · 3.15 KB
/
browsing_data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package chrome
import "github.com/gopherjs/gopherjs/js"
type BrowsingData struct {
o *js.Object
}
/*
* Types
*/
type RemovalOptions struct {
*js.Object
Since float64 `js:"since"`
OriginTypes map[string]bool `js:"originTypes"`
}
type DataTypeSet map[string]bool
/*
* Methods:
*/
// Settings reports which types of data are currently selected in the 'Clear browsing data'
// settings UI. Note: some of the data types included in this API are not available in the
// settings UI, and some UI settings control more than one data type listed here.
func (b *BrowsingData) Settings(callback func(result Object)) {
b.o.Call("settings", callback)
}
// Remove clears various types of browsing data stored in a user's profile.
func (b *BrowsingData) Remove(options RemovalOptions, dataToRemove DataTypeSet, callback func()) {
b.o.Call("remove", options, dataToRemove, callback)
}
// RemoveAppCache clears websites' appcache data.
func (b *BrowsingData) RemoveAppCache(options RemovalOptions, callback func()) {
b.o.Call("removeAppCache", options, callback)
}
// RemoveCache clears the browser's cache.
func (b *BrowsingData) RemoveCache(options RemovalOptions, callback func()) {
b.o.Call("removeCache", options, callback)
}
// RemoveCookies clears the browser's cookies and server-bound certificates modified within a particular timeframe.
func (b *BrowsingData) RemoveCookies(options RemovalOptions, callback func()) {
b.o.Call("removeCookies", options, callback)
}
// RemoveDownloads clears the browser's list of downloaded files (not the downloaded files themselves).
func (b *BrowsingData) RemoveDownloads(options RemovalOptions, callback func()) {
b.o.Call("removeDownloads", options, callback)
}
// RemoveFileSystems clears websites' file system data.
func (b *BrowsingData) RemoveFileSystems(options RemovalOptions, callback func()) {
b.o.Call("removeFileSystems", options, callback)
}
// RemoveFormData clears the browser's stored form data (autofill).
func (b *BrowsingData) RemoveFormData(options RemovalOptions, callback func()) {
b.o.Call("removeFormData", options, callback)
}
// RemoveHistory clears the browser's history.
func (b *BrowsingData) RemoveHistory(options RemovalOptions, callback func()) {
b.o.Call("removeHistory", options, callback)
}
// RemoveIndexedDB clears websites' IndexedDB data.
func (b *BrowsingData) RemoveIndexedDB(options RemovalOptions, callback func()) {
b.o.Call("removeIndexedDB", options, callback)
}
// RemoveLocalStorage clears websites' local storage data.
func (b *BrowsingData) RemoveLocalStorage(options RemovalOptions, callback func()) {
b.o.Call("removeLocalStorage", options, callback)
}
// RemovePluginData clears plugins' data.
func (b *BrowsingData) RemovePluginData(options RemovalOptions, callback func()) {
b.o.Call("removePluginData", options, callback)
}
// RemovePasswords clears the browser's stored passwords.
func (b *BrowsingData) RemovePasswords(options RemovalOptions, callback func()) {
b.o.Call("removePasswords", options, callback)
}
// RemoveWebSQL clears websites' WebSQL data.
func (b *BrowsingData) RemoveWebSQL(options RemovalOptions, callback func()) {
b.o.Call("removeWebSQL", options, callback)
}