In the end your browser is just making a HTTP request. Figure out the shape of the HTTP requests the Gmail UI sends, then write a script to do it in a non-browser environment.
yes as trivial as replicate arbitrary complexity obfuscated code in a script
yes as trivial as replicate arbitrary complexity obfuscated code in a script