0

I am creating a Google Chrome extension that collects details of the page loaded in active tab. I am getting the page title and URL correctly, but the page HTML source is not loading. This is the code I am using to get title and URL:

chrome.tabs.getSelected(null, function(tab) {
  u = tab.url;
  t = tab.title;
  document.write("Title: "+t+"<br>URL: "+u);
});

How can I get the HTML source of the tab page?

James Z
  • 12,209
  • 10
  • 24
  • 44
Susan
  • 13
  • 6
  • 1
    Does this answer your question? [Getting the source HTML of the current page from chrome extension](https://stackoverflow.com/questions/11684454/getting-the-source-html-of-the-current-page-from-chrome-extension) – wOxxOm Dec 29 '19 at 07:46
  • No sir, please help me on this issue. – Susan Jan 04 '20 at 08:03
  • That answer is the only thing I can think of based on the way your question is phrased. You should provide more details or rephrase the question so we can understand the problem. – wOxxOm Jan 04 '20 at 08:06
  • I am trying to create a Chrome extension that collects the HTML Source of a particular site and post it to my PHP script. I am getingt the Page URL and Page Title using tab.url and tab.title respectively. But the page HTML Source is not available this way. How can I get the HTML Source of a page? Highly appreciate your support. – Susan Jan 23 '20 at 14:41
  • The answer I've linked contains an exact solution of this problem. – wOxxOm Jan 23 '20 at 15:19

0 Answers0