0

I want to create the chrome extension that will past the static gif by URL(for example this) after loading the "compose" (new email) window. As I understand correctly, I need to use only content.js

I'm trying to find some info on how to do this for a long time and found this decision. But when I insert this code into my content.js(almost empty) it writes to me that DriveApp is not defined. So, as I understand I need to include something for using this class, but I can`t find correct info on how to do it.

Also, I think that it could be some easier decision to create the extension which will add static gif by URL after loading compose window if(document.querySelector('.AD'))

I am not good at this, so I hope will be glad of any help, especially a complete solution :)

JS 1love
  • 21
  • 3
  • I also found the [author of that post - Tanaike](https://stackoverflow.com/users/7108653/tanaike) and wrote to him in the mail asking for help, but I doubt what he saw. I am also grateful if you help to contact him. – JS 1love Nov 12 '19 at 01:09
  • The DriveApp is an [Apps Script class](https://developers.google.com/apps-script/overview) so you cannot use it outside that environment. If you want to use Javascript I recommend you to use the [Drive API Get function](https://developers.google.com/drive/api/v3/reference/files/get). However, this is only useful if your gif is in your drive. Also, I recommend you to take a look at [this](https://developer.chrome.com/extensions/getstarted). – Jescanellas Nov 12 '19 at 10:20
  • @Jescanellas I already done some simple extensions but did not work with API. I thought that there’s nothing complicated about it, but I didn’t find the functionality I needed in the Gmail API. If I understand correctly "get functions" will not help me since I need to put information (about adding a gif into my mail) and send an ajax request about it. Maybe I'm wrong, tell me if it is so :) – JS 1love Nov 12 '19 at 10:57

0 Answers0