Wait, osascript can inject HTML and Javascript into the DOM? How is that okay?
However, Chrome's AppleScript support was used almost exclusively by malware, so it's disabled by default now: https://crbug.com/661810.
I just wish Apple invested more in automation.