在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mhawksey/Example-Google-Apps-Script-Execution-API-integration-in-Chrome-Extension开源软件地址:https://github.com/mhawksey/Example-Google-Apps-Script-Execution-API-integration-in-Chrome-Extension开源编程语言:JavaScript 67.5%开源软件介绍:Using the Google Apps Script Execution API in Chrome ExtensionsThis is a sample Google Chrome extension that demonstrates using the Chrome Identity API to authorize access to use the Google Apps Script Execution API. If you are not familiar with these services here: Chrome Extensions and Content Security
If you have developed applications using the Execution API with HTML/JavaScript you've probably used Google client library to do this. As Google states "while not strictly necessary, can greatly assist in handling OAuth for the application". In the case of Chrome Extensions the use of client libraries can be problematic. For example, when developing my first Chrome Extension I encountered a number of errors similar to:
There are solutions for these on Stack Overflow (like this one), but I struggled to get those to work. As the Execution API relies on the user having a Google Account using the Chrome Identity API appears to be a better solution. Testing it outThe quick and easy to get the code running on your computer.
How it worksWhen the popup is opened the extension silently checks/requests a authentication token. If a token is present the authenticate button is disabled, otherwise the button is enabled and when clicked starts the interactive authentication flow. Notes on setting upFor notes on setup and usage read this blog post AcknowledgementsThis project is based on: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论