gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

is_inside_email broken for popout of thread "In new window"

Open cancan101 opened this issue 3 years ago • 2 comments

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.

cancan101 avatar May 31 '22 18:05 cancan101

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

cancan101 avatar May 31 '22 18:05 cancan101

Sounds good to me. PRs welcome!

josteink avatar Jun 01 '22 06:06 josteink