diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 index e87f97a1..a3757579 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## Version 1.1.11 + +- Fix `api.observe.on("view_email", ...)`not working. + ## Version 1.1.10 - Fix `api.dom.right_toolbar()`, by @stevepeak. diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 9907a3c2..e43412d0 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gmail-js", - "version": "1.1.10", + "version": "1.1.11", "description": "JavaScript API for Gmail (useful for chrome extensions)", "main": "src/gmail.js", "types": "src/gmail.d.ts", diff --git a/src/gmail.js b/src/gmail.js index da44298d..44a56a78 100644 --- a/src/gmail.js +++ b/src/gmail.js @@ -2478,10 +2478,14 @@ var Gmail = function(localJQuery) { // class depends if is_preview_pane - Bu for preview pane, nH for standard view, // FIXME: the empty class ("") is for emails opened after thread is rendered (causes a storm of updates) class: ["Bu", "nH", ""], - sub_selector: "div.adn", handler: function(match, callback) { - match = new api.dom.email(match); - callback(match); + setTimeout(() => { + match = match.find("div.adn.ads"); + if (match.length) { + match = new api.dom.email(match); + callback(match); + } + }, 0); } },