As described in this post Firefox allows you to take a screenshot from the console with the command: :screenshot
.
I would like to automate this (resize the window and take a screenshot each time) with JavaScript to show off a responsive website.
This is my attempt:
setTimeout(() => {
eval(':screenshot');
}, 500);
When i execute it from the console it gives me the following error:
Uncaught SyntaxError: expected expression, got ':'
I feel that this is expected. However, I would like to find a way to execute these browser specific commands with JavaScript. Is that possible? Solutions for any other browser are also welcome. Thanks in advance!
Edit: This question is similar, but I am not trying to create an extension and there is no user. I want to run the script from the console myself. Just added it to make sure my question does not get flagged as a duplicate.