5#ifndef MOLYBDEN_FRAME_HPP
6#define MOLYBDEN_FRAME_HPP
12#include "molybden/js/js_value.hpp"
28 virtual ~Frame() =
default;
33 virtual std::shared_ptr<Browser>
browser() = 0;
52 virtual std::string
name() = 0;
60 virtual std::string
html() = 0;
82 virtual std::string
text() = 0;
90 virtual void loadUrl(
const std::string& url) = 0;
103 virtual std::shared_ptr<Frame>
parent() = 0;
131 std::function<
void(
JsValue)> callback) = 0;
137 virtual std::vector<std::shared_ptr<Frame>>
children() = 0;
A web frame that provides access to DOM and JavaScript.
Definition frame.hpp:26
virtual JsValue executeJavaScript(const std::string &script)=0
Executes the given script in the frame and returns the result of the execution.
virtual std::string text()=0
Returns content of the frame and its sub-frames as plain text or an empty string if the frame does no...
virtual std::string name()=0
Returns the name of the frame or an empty string if the frame does not have a name.
virtual std::shared_ptr< Browser > browser()=0
The browser instance of the frame.
virtual bool isMain()=0
Checks if it is a main frame.
virtual std::shared_ptr< RenderProcess > renderProcess()=0
Returns the render process associated with this frame.
virtual void loadUrl(const std::string &url)=0
Navigates the frame to a resource identified by the given URL.
virtual std::vector< std::shared_ptr< Frame > > children()=0
Returns a list of child frames or an empty list if this frame does not have any children.
virtual void print()=0
Requests printing of the currently loaded web page in this frame.
virtual std::string html()=0
Returns content of the frame in the HTML format or an empty string if the frame does not have a conte...
virtual std::shared_ptr< Frame > parent()=0
Returns the parent frame instance or nullptr if the frame is a main (top-level) frame that doesn't ha...
virtual void executeJavaScript(const std::string &script, std::function< void(JsValue)> callback)=0
Executes the given script in the frame and returns the result of the execution.
A JavaScript value.
Definition js_value.hpp:44