How to stop Google+ Sign-In Button from popping up the message "Welcome back, you've already connected with this app via Google+ Sign-In as ....."

Stanley picture Stanley · Jun 18, 2013 · Viewed 9.1k times · Source

I'm adding Google+ sign in button to my site using the server-side flow. Here is how I render the sign in button:

<script type="text/javascript">
    (function () {
        var po = document.createElement('script');
        po.type = 'text/javascript';
        po.async = true;
        po.src = 'https://plus.google.com/js/client:plusone.js?onload=renderGPlus';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(po, s);
    })();
</script>

<script type="text/javascript">
    function renderGPlus() {
        gapi.signin.render('customGPlusBtn', {
            'callback': 'gPlusSignInCallback',
            'clientid': '<my_client_id>',
            'redirecturi': 'postmessage',
            'accesstype': 'offline',
            'cookiepolicy': 'single_host_origin',
            'requestvisibleactions': 'http://schemas.google.com/BuyActivity',
            'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email'
        });
    }
</script>

When the button is loaded, it immediately checks to see if the user has authorized my application (immediate mode). If the user has previously authorized my application, a notification bar will pop up at the bottom of the page with the message "Welcome back, you've already connected with this app via Google+ Sign-In as .....".

enter image description here

Is there anyway to stop this message from popping up?

Answer

Chimdi2000 picture Chimdi2000 · Dec 14, 2013

Just recently the newly accepted answer on this page for hiding the "Google Sign-in Welcome back pop up"

window.___gcfg = { isSignedOut: true };

does not work again.

AIM: "Hide or Suppress the Google+ Sign In Welcome Back message" on all browsers.

Please if you have been using `

window.___gcfg = { isSignedOut: true };

to suppress the warning. After serious experimentation I discovered this.

I will recommend you use this iframe versions to suppress any kind of Google API pop up window on your web page..

Iframe 1: iframe[src^="https://apis.google.com"] {display: none;} This Hides all pop up windows from Google APIs on your web page.

Iframe 2: iframe[src^="https://apis.google.com/u/0/_/sharebox"] {display: none;} This Hides all Google's Interactive Share Dialog pop up on your web page.

Iframe 3: iframe[src^="https://apis.google.com/u/0/_/widget/oauthflow/toast"] {display: none;} This Hides all "Google's Welcome Back Message" pop up window on your web page.

Iframe 4: iframe[src^="https://apis.google.com/u/0/_/+1/"] {display: none;} This Hides all "Google's +1 Button" on your web page.

So for this particular question do this in the Head tag of your HTML Page

 <style> `iframe[src^="https://apis.google.com/u/0/_/widget/oauthflow/toast` </style>

Have tested it and it works perfectly well.