简体   繁体   中英

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

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

Yes, you can but with some limitation If you publish your apps script code as a webapp which will be accessible publicly, you can make a GET request to the webapp URL to execute the Apps Script code.

eg

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

after publishing it, say you got a URL like

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

Now make a request from your chrome app

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM