- The text is not always exactly equal to this. - When this function is called, its already determined that this page is Gmail. Fixes: https://bugs.launchpad.net/bugs/1069576.
var tag = document.evaluate('//div/div[2]/div/div/div/div/div[@role="button"]/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
48
49
if (tag.textContent !== 'Gmail' && tag.textContent !== 'Mail') {
50
throw new Error();
51
}
52
47
53
48
var indicators = [];
54
49
55
var inboxLink = document.evaluate('//div[@role="navigation"]/div/div/div/div/div/div/div/div/div/span/a', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
50
var inboxLink = document.evaluate('//div[@role="navigation"]/div[2]//a[contains(@href, "#inbox")]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
56
51
57
52
if (!inboxLink || !inboxLink.href || !inboxLink.text) {