github.com/MontFerret/ferret@v0.18.0/pkg/drivers/cdp/dom/loader.go (about) 1 package dom 2 3 import ( 4 "context" 5 6 "github.com/mafredri/cdp/protocol/page" 7 "github.com/mafredri/cdp/protocol/runtime" 8 9 "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" 10 "github.com/MontFerret/ferret/pkg/runtime/core" 11 ) 12 13 type NodeLoader struct { 14 dom *Manager 15 } 16 17 func NewNodeLoader(dom *Manager) eval.ValueLoader { 18 return &NodeLoader{dom} 19 } 20 21 func (n *NodeLoader) Load(ctx context.Context, frameID page.FrameID, _ eval.RemoteObjectType, _ eval.RemoteClassName, id runtime.RemoteObjectID) (core.Value, error) { 22 return n.dom.ResolveElement(ctx, frameID, id) 23 }