i will try to give as much details i can about this project. First of all sorry about my English cause it's not my native language :) It's not directly a question, is about your opinion for the architecture, i am student and not a profesional developer of Google-extensions that's why i am asking for your opinions. I am curretly developing a Google Extension about integration of Gmail website with a Enterprise CRM. I have been doing a lot of research and each day get a bit more confused and at the same time i see many possibilities in this architecture.
The final architecture i have decided to do is the next:
Google Extension
- Background.js, file wich is going to send request to a CRM API using AJAX. At the same time is going to communicate with the next file Content.js using "chrome.runtime.onMessage.addListener" this way it allows me to answer request produced in the Gmail website as we will see after.
- Content.js, file which allows me to interact with DOM elements from the Gmail interface. In many reserachs i have seen the are manny ways to "extract" elements from Gmail interface, but they are like "`zZ. I-TJ ...*" and i don't want to loose time with this issue, so i have decided to use gmail.js, a Open Source API to extract elements and at the same time, the most important thing, inject elements directly to the interface.
Here the problem is that using Gmail.js as the author says:
I still need to add implementation for chrome extension, works by injecting js for now
- Injected.js, file which implement all the logic from the buttons clicked, and at the same time, shows a new sidebar next to the inbox or email details, showing CRM details. Here we can use the class from gmail.js.
CRM API, access to a central database storage and answer the request produced agains it's API using JSON AJAX requests.
Here a give a visual example of the architecture: Architecture planning
If you have any suggestion, something that can cause troubles, just an advice, everything will be taken in count, i am sure. Thank you ;)
I have read posts like:
I have tried:
Using gmail.js directly in the content script, allways getting :
'Uncaught TypeError: Cannot read property 'GLOBALS' of null'
Obviously cause it's not prepared to do it.
If this kind of question is not allowed notify me and i will delete it or update it.