How do I make an extension that retrieves the source code of a web page?

You can directly instantiate the Web component and call the Get function inside your extension code like this

  1. Declare a field
private Web myWebComponent;
  1. Instantiate the Web component inside the constructor
myWebComponent = new Web(...);
  1. Register a GotText callback inside your extension class
@Override void GotText(...) {
    // Receive the text from here
}
  1. Use the Get function from Web component like this
myWebComponent.Get(...);
5 Likes