{"action":"created","issue":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/333","repository_url":"https://api.github.com/repos/KartikTalwar/gmail.js","labels_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/333/labels{/name}","comments_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/333/comments","events_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/333/events","html_url":"https://github.com/KartikTalwar/gmail.js/pull/333","id":190881607,"number":333,"title":"Email source CORS fix","user":{"login":"michi88","id":1010260,"avatar_url":"https://avatars.githubusercontent.com/u/1010260?v=3","gravatar_id":"","url":"https://api.github.com/users/michi88","html_url":"https://github.com/michi88","followers_url":"https://api.github.com/users/michi88/followers","following_url":"https://api.github.com/users/michi88/following{/other_user}","gists_url":"https://api.github.com/users/michi88/gists{/gist_id}","starred_url":"https://api.github.com/users/michi88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michi88/subscriptions","organizations_url":"https://api.github.com/users/michi88/orgs","repos_url":"https://api.github.com/users/michi88/repos","events_url":"https://api.github.com/users/michi88/events{/privacy}","received_events_url":"https://api.github.com/users/michi88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-22T01:13:03Z","updated_at":"2016-11-22T06:18:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/pulls/333","html_url":"https://github.com/KartikTalwar/gmail.js/pull/333","diff_url":"https://github.com/KartikTalwar/gmail.js/pull/333.diff","patch_url":"https://github.com/KartikTalwar/gmail.js/pull/333.patch"},"body":"As already noticed by @josteink in the merged PR https://github.com/KartikTalwar/gmail.js/pull/329 there is a CORS problem when the browser caches the first redirect. \r\n\r\nAlthough it seems that the location of the redirect is the same when requested 'fresh' but Google only supplies the `Access-Control-Allow-Origin` header for the latter. Strangely!!! Btw, this might also happen in other places so if you see CORS related errors check that the cache is not used. And of course to learn from this... do not disable cache in devtools when testing gmail.js! ;)\r\n\r\njQuery's `{cache: false}` adds something like this to the url `_=76348726487` which might not be OK for all GET calls so I've added the flag on `make_request` and `make_request_async`.\r\n\r\nI've also added a change to `is_inside_email` because when email text is hidden (collapsed because of thread already read) it should return `true`.\r\nThis happens for example when someone emails an attachment as a reply on an email but without adding text.\r\n\r\nThis fixes an issue in my application and I don't see any problems but if you don't want to add it I'll make you a new PR if you want.\r\n\r\nThe `TODO` probably needs to looked at because I see some errors (not a lot) coming in from my extension in production."},"comment":{"url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/comments/262157392","html_url":"https://github.com/KartikTalwar/gmail.js/pull/333#issuecomment-262157392","issue_url":"https://api.github.com/repos/KartikTalwar/gmail.js/issues/333","id":262157392,"user":{"login":"josteink","id":411338,"avatar_url":"https://avatars.githubusercontent.com/u/411338?v=3","gravatar_id":"","url":"https://api.github.com/users/josteink","html_url":"https://github.com/josteink","followers_url":"https://api.github.com/users/josteink/followers","following_url":"https://api.github.com/users/josteink/following{/other_user}","gists_url":"https://api.github.com/users/josteink/gists{/gist_id}","starred_url":"https://api.github.com/users/josteink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josteink/subscriptions","organizations_url":"https://api.github.com/users/josteink/orgs","repos_url":"https://api.github.com/users/josteink/repos","events_url":"https://api.github.com/users/josteink/events{/privacy}","received_events_url":"https://api.github.com/users/josteink/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T06:18:00Z","updated_at":"2016-11-22T06:18:00Z","body":" A few comments :\r\n\r\n* It's awesome that you're updating the TypeScript bindings. That's really appreciated :)\r\n* Please remove the todo comment and register a official github issue instead so that it can be tracked properly, and is more easily discoverable for other people having the same issue.\r\n* Please submit the \"is inside email\" bits in a separate PR so that it can be discussed separately.\r\n\r\nBack to the main gist of this PR: Looking at the code it seems like users of the Gmail.js library will have to manually implement cache bursting themselves by using the error callback.\r\n\r\nIs this correct? Wouldn't it be better to implement the once and properly inside the library? Or am I wrong and this PR fully fixes the CORS issue without any further intervention needed?"}}
{"actor":{"display_login":"josteink"}}