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

后端 未结 1 1824
礼貌的吻别
礼貌的吻别 2020-12-13 22:46

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

相关标签:
1条回答
  • 2020-12-13 23:28

    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.

    e.g

    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
    
    0 讨论(0)
提交回复
热议问题