A simple firefox extension which helps you look at your google calendar from a different perspective. Well.. how many hours am I working, how much time goes to sports and fittness. What's the trend over the last year? Am I sleeping more, or am I neglecting my health.
Create jsconfig.json
file in the root of your extension project, that's all! Once done, the lsp
will start providing completions like browser.browserAction.onClicked...
.
// jsconfig.json
{"typeAcquisition": {"include": ["firefox-webext-browser"]}}
I was having a hard time setting up extension ID and OAuth2 on chromium. I was getting a wierd error
(Unchecked runtime.lastError: The user turned off browser signin
) probably because chromium doesn't
come with google chrome propriatery stuff..
Also to publish an extension on chrome, I was required to have an account there. That's another reason why IMO firefox is a better choice, not to mention that most of the extensions on firefox add-ons page have a github repo link, so you can easily go to the source and learn about how the extension is doing something. (this is not that common on chrome extensions store)
I felt as if I wasted 2 hours trying to create a new tab (chrome.action.onClicked.addListener(tabs => {...})
) when the user
clicks on the extension icon. The code was clearly mentioned on the tutorial page but I managed to create a mess somehow. But
then it hit me, this is how we learn anything. At first, we are really inefficient, then we start getting a hang of it.. and then
as we work on it, we become experts at that thing.
I guess then the only skill required as a beginner is to stick around for some time, to wait for the bud to blossom, when things start clicking. It's important to not have unrealistic expectations when just starting out.
- Hello World extension
- Run scripts on every page
- Inject scripts into the active tab
- Manage tabs
- OAuth 2.0: authenticate users with Google
- javascript - How to write events to Google Calendar in Chrome Extension? - Stack Overflow
- Publish in the Chrome Web Store
- https://github.com/mdn/webextensions-examples/tree/main/google-userinfo
- https://developers.google.com/identity/protocols/oauth2
- https://developers.google.com/identity/protocols/OAuth2UserAgent#tokeninfo-validation
- https://www.chartjs.org/docs/latest/getting-started/
- Icons provided by Icons8. Thanks! :)
These are really quick tutorials/primers which go over varous aspects of the language like basic syntax, networking (request/response), async/await/promises etc.
- https://medium.com/weekly-webtips/javascript-the-survival-guide-41799d01d565
- https://www.cs.cmu.edu/~aldrich/courses/17-396/js/
- https://kinsta.com/knowledgebase/javascript-http-request/
- https://developer.mozilla.org/en-US/docs/Web/API/Request
- https://www.sitepoint.com/javascript-async-await/
- https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world
- https://developer.chrome.com/docs/extensions/get-started/tutorial/scripts-on-every-tab
- https://developer.chrome.com/docs/extensions/get-started/tutorial/scripts-activetab
- https://developer.chrome.com/docs/extensions/get-started/tutorial/popup-tabs-manager
- https://developer.chrome.com/docs/extensions/how-to/integrate/oauth
- https://stackoverflow.com/questions/74440654/how-to-write-events-to-google-calendar-in-chrome-extension
- https://developer.chrome.com/docs/webstore/publish