I'm looking for a way to maximize the Safari window using JavaScript for Automation (JXA).
I'm able to open Safari and to bring the window to front, but I can't find a way to open it in fullscreen.
var safari = Application('Safari');
safari.includeStandardAdditions = true;
safari.quit(); // Avoid having multiple Safari windows open
safari.activate(); // Start Safari and bring to front
var document = safari.documents[0];
document.url = 'http://stackoverflow.com';