iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Sync plugin missing gapi #899

Open martinemde opened 9 years ago

martinemde commented 9 years ago

I installed the sync plugin with the uniques plugin and I can't authorize:

window.plugin.sync.authorizer.authorize(true)
Uncaught Reference
Error: gapi is not defined
message: "gapi is not defined"stack: (...)

Seems I don't have gapi somehow, or don't have a reference to it in scope. I tried running the authorize button's javascript directly. I was able to authorize sync on both chrome and safari on iOS before I tried desktop, though since this is a javascript error before hitting google at all, I doubt that's related.

Here's my list of installed plugins:

screen shot 2014-11-07 at 8 27 45

3ch01c commented 9 years ago

Is this still an issue? I can't seem to reproduce it. It looks like the issue is that the Google API (gapi) is being accessed before it's imported. Maybe the sync plugin should load gapi first in its setup function?

txr13 commented 9 years ago

I am experiencing this issue as well, using Firefox + Greasemonkey. IITC is fully up to date (0.21.2).

When I initially load intel while watching console, I can see the message "Failed to load Drive Realtime API library." Expanding that message gives me an additional five lines with "cb=gapi.Load...:XXX" on the end. I'm assuming this is a stack trace / line numbers of some sort? (Sorry, I'm not a JS developer and have almost no familiarity with the browser console.)

Whenever I reload or close / reopen the Intel site, the Sync plugin is not authorized, and the above message displays. Once I authorize the Sync plugin, the console displays "TypeError: gapi.drive.realtime is undefined".

I can see that the sync file has been created in my Google Drive, but it hasn't ever been modified after creation time. (After accessing it from multiple browsers on multiple machines.) To be honest, I don't know what troubleshooting steps to take next.

bdols commented 8 years ago

i experienced this problem when I had the Disconnect chrome extension installed. you have to whitelist google when you are on the iitc page if you have any third-party blocking extensions.