Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fetch javascript heavy pages from chrome extension

I am developing an extension that fetches pages that the user is likely to access on a website. My extension uses jQuery.get() to fetch a page. This works correctly for a site like amazon.com.

But if the user logs in to gmail and I try to fetch some other pages like "account settings", I get an incomplete page. Somewhere in that page, I get the message:

"Your browser does not support Javascript or Javascript has been disabled.As your browser does not support Javascript or has Javascript disabled, we are not able to display the requested page."

Is there some way to fetch complete page in such cases?

like image 508
Methos Avatar asked Nov 04 '22 10:11

Methos


1 Answers

I ended up opening a new tab and fetching the page in that tab. Then using content script, I analyze the page data. Sure this is a problem in the sense that a user will see newly opened tab. But then it is also transparent to the user.

If you are developing an extension on Firefox using Jetpack, you can use page-worker which is an invisible page and gives access to the DOM.

like image 142
Methos Avatar answered Nov 09 '22 19:11

Methos