I have completed the following Google Calendar Auth tutorial: https://developers.google.com/google-apps/calendar/quickstart/js.
It works with no errors. Now I am trying to use the same Google Calendar auth in a chrome extension. I want to allow people to enter dates and have the dates/events placed in their Google Calendar.
Step 1 is to have the user provide permissions within the chrome extension. I parsed everything out into my Chrome Extension. The problem is that I receive no errors (the text and buttons show, but the button no longer works and takes the user to Google Calender auth). In the chrome extension console and prior to placing it the extension package, there were no errors.
Here’s a picture of the extension. When not in the extension the code (in the link above) works fine, click “Authorize” button and I sign into Google oauth no problem. And I can access the google calendar. When placed in the extension, the button no longer works and has no console errors.
One thing I noticed is that the following code was needed when it was a static HTML page:
The link above has the full code. And exactly what I used, trying to keep the post short.
https://apis.google.com/js/api.js as a local file. And the chrome extension successfully finds it with no errors in the console.
My guess is that the following:
onreadystatechange="if (this.readyState === 'complete') this.onload()
How do I make calender auth work in a chrome extension? Where should the
onload function be placed?