googlearchive / realtime-playground

Google Drive Realtime API Playground helps you to try out the features of the Realtime API
https://realtimeplayground.appspot.com/
Apache License 2.0
241 stars 114 forks source link

Google Drive now passes 'state' via GET parameter #8

Open nishio opened 10 years ago

nishio commented 10 years ago

In rtclient.RealtimeLoader.prototype.load, it access to rtclient.params['state'] for handle redirection from Drive UI.

Now Drive UI passes those values via GET parameter, however, rtclient.getParams checks location.hash only.

I added following code into rtclient.getParams and it works

    var getParam = document.location.search;
    if(getParam){
        getParam = getParam.slice(1);
        getParam.split('&').forEach(function(paramStr){
            paramStr = paramStr.split('=');
            if(paramStr[0] == 'state'){
                params['state'] = decodeURIComponent(paramStr[1]);
            }
        });
    }