Can I execute Google Apps Script code from the Chrome extension?

I want to write a Chrome extension that allows users to send emails directly from omnibox. Can I directly execute Google Apps Script code, such as the Gmail API , from the internal Chrome extension?

+6
source share
1 answer

Yes, you can, but with some restriction If you publish your script applications as a webapp that will be available publicly, you can make a GET request to the web application URL to execute the script application code.

eg

doGet(e){ //use e.parameter here //write your apps script code return ContentService.createTextOutput('your return content'); } 

after posting let's say you have a url like

 https://script.google.com/macros/s/djihwerd98ejdeijded/exec 

Now make a request from your chrome application

 GET https://script.google.com/macros/s/djihwerd98ejdeijded/exec?param=value 
+7
source

Source: https://habr.com/ru/post/952363/


All Articles