0

Is it possible to write a browser plugin or a windows or linux application that can download each currently opened web page that is now running in our browser? Do any one have any similar method for this purpose?

  • Extensions can use chrome.pageCapture.saveAsMHTML or manually extract html from each tab and its resources via chrome.debugger API method [Page.getResourceTree](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-getResourceTree). Another method is using a content script to get html from DOM and resources from performance.getEntries() and download each one individually. – wOxxOm Jan 21 '20 at 12:12
  • Tanks a lot. Now is it possible to download just js part of we page separated from html file? And also is it possible to write a plugin to monitor JS event of a web page –  Jan 21 '20 at 12:37
  • What is a "js part" and "js event" exactly? – wOxxOm Jan 21 '20 at 12:40
  • JS part: javascript part of all web page code that i assume often it is external./// JS event: for example a call to time functions or assignments or etc. –  Jan 21 '20 at 12:42
  • I don't understand. If it's a script with its own URL then it's already covered in my first comment. As for a call to a function or assignment, there's no magic universal solution but in most cases an extension can do it with chrome.debugger API which provides access to the same stuff used by devtools. – wOxxOm Jan 21 '20 at 12:47
  • consider a situation that the number of calling performance.now() in a page is important for us. I mean is there any tool or possibility to monitor this calls? –  Jan 21 '20 at 12:58
  • A global function is easy to monitor - an extension can reassign window.performance.now or window.Performance.prototype.now in [page context](https://stackoverflow.com/a/9517879) to a wrapper function that calls the original function and updates the statistics. – wOxxOm Jan 21 '20 at 13:04

0 Answers0