aboutsummaryrefslogtreecommitdiff
path: root/oauth.js
diff options
context:
space:
mode:
Diffstat (limited to 'oauth.js')
-rw-r--r--oauth.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/oauth.js b/oauth.js
new file mode 100644
index 0000000..96ae811
--- /dev/null
+++ b/oauth.js
@@ -0,0 +1,13 @@
+window.onload = function() {
+ chrome.identity.getAuthToken({interactive: true}, function(token) {
+ fetch('https://www.googleapis.com/calendar/v3' + '/users/me/calendarList' + '?access_token=' + token,
+ { method: 'GET', async: true }).then((response) => response.json()).then(function(data) {
+ var test = document.getElementById('test');
+ data.items.map(e => e.summary).forEach(function(e) {
+ var entry = document.createElement('li');
+ entry.innerText = e;
+ test.appendChild(entry);
+ });
+ });
+ });
+};