I was able to get the HTML source of the page by following the answer on this page: Getting the source HTML of the current page from chrome extension
However, it could not get the new HTML source which is dynamically loaded via AJAX even I close the popup, unless I manually refresh the page. It keeps loading the previous HTML source. I couldn't figure out why. I am new to chrome extension though. A little help is appreciated. Thanks.