What you see in your web browser when you open a page is the result of rendiring a page. You don't download the result of rendering, it is already on your computer and in your memory. What you are trying to do is to take a screenshot.
In Javascript, there is no standard API for taking screenshots of rendered pages — after all, it is not a job of the web browser, but rather of your system tools. But a trick you can do is to separately render a part of your DOM (or whote DOM) into <canvas>
and save contents of that canvas to an image. This answer explains the general mechanics of such process: https://stackoverflow.com/a/6678156/1542343
Now, you may say that there are online services that let you download a screenshot of a website done in different browsers, but what those services essentially do is they run a browser on a server and use the operating system tools to take a screenshot of the desired page. They could as well be taking screenshots of Microsoft Word run on their servers or anything, inherently that has nothing to do with web browsers.