0

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();

fazil tm
  • 299
  • 1
  • 5
  • 23
  • are you tried document.body.innerHTML – Karthi Aug 19 '16 at 06:44
  • I want to get the source code of current running page. – fazil tm Aug 19 '16 at 06:47
  • Try this one http://stackoverflow.com/questions/680562/can-javascript-read-the-source-of-any-web-page – Karthi Aug 19 '16 at 06:48
  • I think it is not possible. I am developing gecko browser. i want to redesign the view web pages where visited in my browser. The source code is https://github.com/ncalexan/geckobrowser-gradle – fazil tm Aug 19 '16 at 06:55
  • try http://stackoverflow.com/questions/2423498/how-to-get-the-html-source-of-a-page-from-a-html-link-in-android – Karthi Aug 19 '16 at 07:14

0 Answers0