gmail.js
gmail.js copied to clipboard
is_inside_email broken for popout of thread "In new window"
When a thread is poped out by clicking the "In new window" button, is_inside_email reports false when run from within the poped out window.
I think this can be fixed with something like this (adding a is_popped_out), since the second half of the function works fine:
api.check.is_inside_email = function() {
if(api.get.current_page() !== "email" && !api.check.is_preview_pane() && !api.check.is_popped_out()) {
return false;
}
var items = $(".ii.gt .a3s");
var ids = [];
for(var i=0; i<items.length; i++) {
var mail_id = items[i].getAttribute("class").split(" ")[2];
if(mail_id !== "undefined" && mail_id !== undefined) {
ids.push(items[i]);
}
}
return ids.length > 0;
};
and then is_popped_out just needs to be built to detect the popout
Sounds good to me. PRs welcome!