Skip to content

check.is_inside_email is not reliable anymore #813

@sieppl

Description

@sieppl

I am using gmail.js for multiple years now with our Google Workspace. It seems the function is not reliable anymore as gmail is not including a mail_id in every message div.

    api.check.is_inside_email = function() {
        if(api.get.current_page() !== "email" && !api.check.is_preview_pane()) {
            return false;
        }

        var items = document.querySelectorAll(".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) { //THIS IS SOMETIMES UNDEFINED FOR SOME MESSAGES
                ids.push(items[i]);
            }
        }

        return ids.length > 0;
    };

Example of a message without a mail_id:
Image

(Working) Example of a message with a mail_id:
Image

Suggested Fix:
Remove the extra check for mail_id, but I guess it was added for a reason before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions