github.com/MontFerret/ferret@v0.18.0/pkg/drivers/cdp/templates/document.go (about) 1 package templates 2 3 import "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" 4 5 const domReady = `() => { 6 if (document.readyState === 'complete') { 7 return true; 8 } 9 10 return null; 11 }` 12 13 func DOMReady() *eval.Function { 14 return eval.F(domReady) 15 } 16 17 const getTitle = `() => document.title` 18 19 func GetTitle() *eval.Function { 20 return eval.F(getTitle) 21 } 22 23 const getDocument = `() => document` 24 25 func GetDocument() *eval.Function { 26 return eval.F(getDocument) 27 }