Comments (9)
@jamiebikies thanks for noticing this. So the first thing email_data()
does is retrieves the email_id from the url. With the open_email
observer, the data function is getting triggered the instant you click on an email from the inbox view where the url is still the inbox's. The quickest way to fix this is add a delay in the email_data
function so a valid id is present. I'll try to fix it by tomorrow and see if this can be done without a delay
from gmail.js.
Hey @KartikTalwar, the delay is exactly what I've done for now. I'll take a look and submit a PR if you haven't got to it and I come up with a good way, like you said, to do it without a delay.
from gmail.js.
That PR for now would be great. From what I did to debug, L861 bloc always works (it knows that its inside the email) but api.get.email_id()
in L862 still has the inbox view url.
from gmail.js.
@jamiebikies so the problem is that the observe callback gets executed right after its triggered. So when your callback requests the email_data
, the data function runs between your click on the email and the email opening. If you add a 10 second delay to the email_data
function, its going to wait 10s before opening the email. I just added a fix for this where the data function has been parameterized. This code will work
gmail.observe.on('open_email', function(id) {
var data = gmail.get.email_data(id);
console.log(data);
});
Feel free to reopen this issue if you find any inconsistencies
from gmail.js.
@KartikTalwar @jamiebikies i added above code in my script but still empty object got..but first time i got data but if i open email 2nd onwards then empty object got.Now i m using https://xmailchrome.appspot.com/gmail.js link gmail.js in my script. Can you tell me where i did wrong?
from gmail.js.
@sweetaai that js file is very outdated. It most likely does not have the fix from this issue. Please host gmail.js yourself so you can keep better track of code changes.
from gmail.js.
@KartikTalwar when i added below code in load.js then working fine.
var fb = document.createElement('script');
fb.src = "https://xmailchrome.appspot.com/gmail.js";
document.getElementsByTagName('body')[0].appendChild(fb);
but when added
var fb = document.createElement('script');
fb.src = "https://2.helloworld1test.appspot.com/js/gmail.js";
document.getElementsByTagName('body')[0].appendChild(fb);
then gmail is not defined exception got on console.There is no any difference. Only difference in gmail.js. So plz can you tell me where i did wrong?
from gmail.js.
@sweetaai the url is not a valid https url. I would recommend you host it on amazon s3
.
from gmail.js.
@KartikTalwar
Below is valid url
......................
but still not working.
I don't have amazon s3 space..If you have any updated gmail.js url can you send me?
from gmail.js.
Related Issues (20)
- gmail.observe.on('view_email', () => {}) is not fired HOT 16
- Synchronous 'DOMNodeInserted' DOM Mutation Event is deprecated HOT 3
- Synchronous 'DOMSubtreeModified' DOM Mutation Event is deprecated HOT 3
- Reloading window makes the the user email undefined HOT 2
- gmail.observe.on("compose") observer returns type of "compose" when reply button is clicked HOT 6
- How to Utilize the "make_request" and "make_request_async" Methods?
- Button added to toolbar in Gmail label page shows for few seconds & gets hidden (by Gmail)
- `recipient_change` hook throws console errors when compose is closed
- Detecting attachment open from search list HOT 1
- "view_email" event fires twice HOT 1
- Gmail change for innerHTML HOT 35
- Update header before send request HOT 2
- Error in the function: gmail.tools.add_compose_button HOT 7
- Error in the function compose.body() HOT 3
- Nonstop requests sent to play.google.com HOT 1
- api.get.user_email does not work with non-workspace email addresses
- GmailJS library (1.1.14) is failing to load (with error in console) HOT 1
- GmailJS method add_toolbar_button is not working HOT 3
- why this project can not be used at the server side with node? HOT 1
- Detect dark mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmail.js.