changed browser api to return pages that can be acted on, not strictly contents

This commit is contained in:
2024-12-17 23:16:13 -05:00
parent 23334991b1
commit 5e924eb3f9
5 changed files with 154 additions and 93 deletions

View File

@@ -18,3 +18,21 @@ type CookieJar interface {
Set(cookie Cookie) error
Delete(cookie Cookie) error
}
// ReadOnlyCookieJar is a wrapper for CookieJar that allows only read operations on cookies, but all
// write operations are no-ops.
type ReadOnlyCookieJar struct {
Jar CookieJar
}
func (r ReadOnlyCookieJar) GetAll() ([]Cookie, error) {
return r.Jar.GetAll()
}
func (r ReadOnlyCookieJar) Set(_ Cookie) error {
return nil
}
func (r ReadOnlyCookieJar) Delete(_ Cookie) error {
return nil
}