Get Page Source in FireFox

I've been using the AppleScript below to save the source of a web page to a variable with Safari. How could I achieve the same result with FireFox?


If you just want the source of a web page, do you really care about the Browser?

There are at least two methods to get the source independent of any browser:

  1. Shell script using bash curl
  2. ASObjC script

FireFox does NOT support scripting, so there is little chance of getting the source from FireFox, other than UI scripting (but why bother?).

Maybe the OP uses FireFox as their preferred browser but still wants to get the page source. A couple of options appear - if that is the case:

  1. Have KM drive a Safari request to the same URL. (Or Chrome for that matter).

  2. Manipulate the Firefox UI to invoke its View Page Source, or Save Page functions.

But, it’s not clear what the OP’s use case was.