GMail Integration does not work with Google Apps for Domains

Bug #1028381 reported by Matthew Ames
128
This bug affects 24 people
Affects Status Importance Assigned to Milestone
WebApps: Applications Data
Fix Released
High
Robert Carr
unity-webapps-gmail (Ubuntu)
Fix Released
High
Alexandre Abreu

Bug Description

Logging in to GMail using a Google Apps for Domains account, the user is not prompted to integrate with Unity Webapps. Logging out and then logging in to a standard GMail account works flawlessly on the same PC, in the same browser.

This is true for both Firefox and Chromium.

Related branches

Matthew Ames (supermatt)
visibility: private → public
Revision history for this message
Stephen Rees-Carter (valorin) wrote :

This also affects Google Docs/Drive in my case.

Reader and Calendar are both fine though...

Revision history for this message
Xoimai (xoimai) wrote :

I can confirm this problem with my free google apps domain.

Revision history for this message
david.barbion (david-barbion) wrote :

Same here.

Changed in webapps-applications:
status: New → Confirmed
Revision history for this message
david.barbion (david-barbion) wrote :

Here is a little patch that make it works (at least with firefox).

--- /usr/share/unity-webapps/userscripts/GMail.user.js.orig 2012-08-21 23:34:43.400132158 +0200
+++ /usr/share/unity-webapps/userscripts/GMail.user.js 2012-08-22 00:17:35.657984099 +0200
@@ -106,11 +106,17 @@
             setTimeout(wait, 1000);
             return;
         }
- var login = doc.evaluate('//div[@role="navigation"]/div/div[1]/div[3]/div/ol/li[4]/div/div/div/div[2]/span[2]', doc, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent;
- if (login.indexOf("@") === -1) {
- login = "";
+ try {
+ var gmaillogin = doc.evaluate('//div[@role="navigation"]/div/div[1]/div[3]/div/ol/li[4]/div/div/div/div[2]/span[2]', doc, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent;
+ }catch(err) {
+ var gmaillogin="";
         }
-
+ try {
+ var gappslogin = doc.evaluate('//div[@role="navigation"]/div/div[1]/div[3]/div/ol/li[4]/div/div/div/div[3]/span[2]', doc, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent;
+ }catch(err) {
+ var gappslogin="";
+ }
+ login = gmaillogin.indexOf("@") != -1 ? gmaillogin : gappslogin.indexOf("@") != -1 ? gappslogin : "";
         Unity.init({ name: "GMail",
                      login: login,
        iconUrl: "icon://gmail",

Changed in webapps-applications:
assignee: nobody → Robert Carr (robertcarr)
importance: Undecided → High
Revision history for this message
Robert Carr (robertcarr) wrote :

Hoping to land fix on monday.

Changed in webapps-applications:
status: Confirmed → In Progress
Revision history for this message
hackel (hackel) wrote :

david-barbion's patch appears to be present already in unity-webapps-gmail 2.4.7, which claims to support Google Apps domains, however it still doesn't function properly for me. I do get prompted to add it in Firefox and I get a unity icon for it. The icon allows me to switch to my gmail tab automatically, but that's it. The Compose New Message function does not work, and I get no new mail notifications at all.

Revision history for this message
hackel (hackel) wrote :

My previous comment could be due to the language setting, as described in bug #1069576.

todaioan (alan-ar06)
Changed in unity-webapps-gmail (Ubuntu):
status: New → Incomplete
Changed in unity-webapps-gmail (Ubuntu):
status: Incomplete → New
todaioan (alan-ar06)
Changed in unity-webapps-gmail (Ubuntu):
status: New → Fix Released
Revision history for this message
Edward Donovan (edward.donovan) wrote :

And now you've done it again, toda, and someone with higher privileges will have to undo this one.

Please stop. If I can try a simple translation: "Te rog, oprește. Mulțumesc."

Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

Reverted todaioan's change. Launchpad's being vandalized a lot these days...

Changed in unity-webapps-gmail (Ubuntu):
status: Fix Released → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-webapps-gmail (Ubuntu):
status: New → Confirmed
Revision history for this message
Adrian Duranton (during-accesorios) wrote :
Download full text (4.7 KiB)

Solucion para Gmail-Unity-webapps

Configurar el Gmail en idioma ESPAÑOL LATINOAMERICANO

Editar el archivo /usr/share/unity-webapps/userscripts/unity-webapps-gmail/GMail.user.js con sudo gedit /usr/share/unity-webapps/userscripts/unity-webapps-gmail/GMail.user.js

Cambiar donde dice "Navigate to" por "Ir a"

var tag = document.evaluate('//div[@aria-label="Navigate to"]/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;

 var tag = document.evaluate('//div[@aria-label="Ir a"]/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;

Grabar

// ==UserScript==
// @include https://mail.google.com/*
// @require utils.js
// @require google-common.js
// ==/UserScript==

window.Unity = external.getUnityObject(1);
var pane = null;

function isCorrectPage() {
    var i, ids = ['hist_frame', 'js_frame'];

    for (i = 0; i < ids.length; i++) {
        if (!document.getElementById(ids[i])) {
            return false;
        }
    }

    return true;
}

function getNumber(str) {
    try {
        var onlyNumber = str.match(/\(([0-9]|,)+\)/)[0].match(/([0-9]|,)+/)[0];

        return onlyNumber.replace(/,/g, "");
    } catch (x) {
        return '0';
    }
}

function getLabels() {
    var i, res = [];

    var snapshot = document.evaluate('//div[2]/div/div/div[5]/div/*/div/div/div[2]/span/a',
                                     pane, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

    for (i = 0; i < snapshot.snapshotLength; i++) {
        var node = snapshot.snapshotItem(i);

        res.push({ name: node.textContent.match(/^[^(]+/)[0],
                   count: getNumber(node.textContent),
                   link: node.href });
    }

    return res;
}

function doMatrixIntegration() {
    doMainMenuIntegration(document);

    var i, labels = getLabels();
    for (i = 0; i < labels.length; i++) {
        Unity.addAction('/' + labels[i].name, makeRedirector(labels[i].link));
    }
}

function checkMessangesCount() {
    var tag = document.evaluate('//div[@aria-label="Ir a"]/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;

    if (tag.textContent != 'Gmail' && tag.textContent != 'Mail') {
        return;
    }

    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;
    var numMessanges = getNumber(inboxLink.text);

    var indicators = [];
    indicators.push({ name: _("Inbox"),
        count: numMessanges,
        callback: makeRedirector(inboxLink.href) });
    var i, labels = getLabels();
    for (i = 0; i < labels.length; i++) {
 indicators.push({ name: labels[i].name, count: labels[i].count, callback: makeRedirector(labels[i].link) });
    }
    showIndicators(indicators);
    Unity.Launcher.setCount(Number(numMessanges));
}

function unityLoaded() {
    var composeNewMessage = wrapCallback(function () {
        var compose = document.evaluate('//div[@role="navigation"]/div[1]/div[1]/div[1][@role="button"]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;

        cli...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in webapps-applications (Ubuntu Raring):
status: New → Confirmed
toda ioan (todaioan22)
Changed in unity-webapps-gmail (Ubuntu):
status: Confirmed → Incomplete
no longer affects: webapps-applications (Ubuntu Raring)
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

On new 14.04 implementation the issue once again exists.

Current symptom is the gmail view is opened in the webbrowser rather than the webapp
2.4.16+14.04.20140409-0ubuntu1

Changed in unity-webapps-gmail (Ubuntu):
assignee: nobody → Alexandre Abreu (abreu-alexandre)
importance: Undecided → High
status: Incomplete → Confirmed
tags: added: webapps-hotlist
Revision history for this message
David Barth (dbarth) wrote :

This is fixed with the configuration option documented here: https://bugs.launchpad.net/webbrowser-app/+bug/1302780

Online Account integration / mediation is in progress for the desktop container, with plans to backport on 14.04.01.

Changed in webapps-applications:
status: In Progress → Fix Released
Changed in unity-webapps-gmail (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.