Search code examples
tampermonkey

Can Tampermonkey load several pages and then use the browser to save the HTML to disk?


I want to provide a list of about 10 web pages, have them loaded by the browser, then saved to the disk (same as "View Source Code", then save as...). I'm totally new to TamperMonkey. Can it run browser commands, or can it only react with the web page using Javascript, which itself, cannot save to disk?


Solution

  • No, with GreaseMonkey / TamperMonkey / Extensions, we are not able to write to local disk: only read via the FileSystem API). Despite of that, you can, for example :

    • use the navigator localStorage to store and retrieve values
    • send collected informations to an external server, for further usage
    • capture pages with in browser headless mode and work with the saved pages