It would be nice if Surf had a built in mechanism for middleware/plugins. It would be nice if developers could set plugin modules that perform common tasks and/or add functionality. For example:
OAuth support
Logging into popular sites (Github, Reddit, GMail, etc)
Possible syntax:
// GithubLogin implements a Surf plugin for Github authentication.
// When requests are made to the github.com domain, the plugin
// performs user authentication automatically if the user isn't
// logged in already.
type GithubLogin struct {
username string
password string
}
... implement methods
func main() {
bow := NewBrowser()
login := middleware.NewGithubLogin("username", "password")
bow.AddMiddleWare(login)
err := bow.Open("https://github.com")
if err != nil {
panic(err)
}
}
It would be nice if Surf had a built in mechanism for middleware/plugins. It would be nice if developers could set plugin modules that perform common tasks and/or add functionality. For example:
Possible syntax: