~ps-jenkins/unity-webapps-gmail/latestsnapshot-2.4.16+13.10.20131028.2-0ubuntu1

« back to all changes in this revision

Viewing changes to GMail.user.js

  • Committer: Tarmac
  • Author(s): Justin McPherson
  • Date: 2013-10-15 18:26:43 UTC
  • mfrom: (71.1.1 bug-1069576)
  • Revision ID: tarmac-20131015182643-x75w5z7wgrog08kh
The test for a Gmail or mail title was removed. 

- 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.

Approved by PS Jenkins bot, Alexandre Abreu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
function getLabels() {
30
30
    var i, res = [];
31
31
 
32
 
    var snapshot = document.evaluate('//div[@role="navigation"]/div[2]/div/div/div[7]/div/*/div/div/div[2]/span/a',
 
32
    var snapshot = document.evaluate('//div[@role="navigation"]/div[2]//a[contains(@href, "#label")]',
33
33
                                     document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
34
34
 
35
35
    for (i = 0; i < snapshot.snapshotLength; i++) {
44
44
}
45
45
 
46
46
function checkMessagesCount() {
47
 
    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) {
58
53
        return indicators;