I am developing customized gecko browser. How to get source code of visited page from the given below code.
function onPageLoad(event) {
let contentDocument = event.target;
let browser = BrowserApp.getBrowserForDocument(contentDocument);
console.log("Page loaded: " + browser.contentTitle);
}
This is mozilla gecko browser code. I am getting the output of browser.contentTitle for webpage title. But i want to know how to get full html code. what is the code for getting the source code from getBrowserForDocument();