Using shell_exec with Xvfb and FireFox currently to capture screenshots. However, it is necessary to load the entire html (for example, Save the page as → Web page completed.) To the directory using shell_exec. Look at all the different options available on the Mozilla Developer Forums, but were unable to figure out how to do this.
I apparently need this code, but where and how is it implemented so that it can be accessed in shell_exec?
var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath("C:\\filename.html"); var wbp = Components.classes['@mozilla.org/embedding/browser/nsWebBrowserPersist;1'] .createInstance(Components.interfaces.nsIWebBrowserPersist); wbp.saveDocument(content.document, file, null, null, null, null);
Source above code
void saveDocument( in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn );
Source above code
There is a manual Stackoverflow solution here, but it does not address shell_exec: How to save a web page locally, including photos, etc.
source share