AndersSahlin / MailCheckerPlus

Mail Checker Plus for Google Mail™ - Chrome Extension
https://chrome.google.com/extensions/detail/gffjhibehnempbkeheiccaincokdjbfe
GNU General Public License v3.0
100 stars 39 forks source link

Action buttons not working #21

Closed TinoSM closed 13 years ago

TinoSM commented 13 years ago

Simple as that, google changed something and action buttons (delete, mark as read, archive...) wont work anymore.

I tried doing a little development and changed this on mailaccount.class.js, but looks like not working.

     var postURL = mailURL.replace("http:", "https:");
     postURL += "h/" + Math.ceil(1000000 * Math.random()) + "/?&at="+gmailAt;
     var postParams = "nvp_a_tr=Suprimir&tact=&t="+threadId+"&bact=";

Here you have delete request from spanish GUI (SUPRIMIR=DELETE)

POST /mail/h/111/?&at=AF6bupNRxwDedagbFafdX8Ydaxblhw HTTP/1.1 Accept: text/html, application/xhtml+xml, / Referer: https://mail.google.com/mail/h/111/?& Accept-Language: es-ES User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate Host: mail.google.com Content-Length: 61 Connection: Keep-Alive Cache-Control: no-cache Cookie: :P my data

redir=%3F%26&nvp_a_tr=Suprimir&tact=&t=1319beee5007&bact=

IDs and such have been cut a little (threadid and gmailID)

AndersSahlin commented 13 years ago

Perhaps they have changed something that corrupts the way the extension retreives the "at"-token (gmailAt in the code). Does it contain a value when you debug those lines you referred to?

TinoSM commented 13 years ago

I never coded javascript for real nor make extensions, just trying to fix it dirty and couldnt guess how to view console outputs :S. When it works i may try doing it better.

Just to confirm, extension does connect to my language (Spanish) website right? (aka it doesnt use an international-version or something like that)

Edit: Looks like at= still exists on gmail code when i make the request /?ui=html&zy=c, it shouldnt be wrong.

AndersSahlin commented 13 years ago

It's not that difficult:

1) Open chrome://extensions/ 2) Click on the "+Developer mode" link to the right 3) Click on the "background.html" link under the MCP entry 4) Click on the "Scripts" tab 5) Select "mailaccount.class.js" and insert a breakpoint on a line of your choice.

AndersSahlin commented 13 years ago

The extension POSTs to the basic HTML view (https://mail.google.com/mail/h/).

TinoSM commented 13 years ago

Ok thanks, you were right of course, it was failing, looks for ?at= and it should look for at=

Removing the ? works fine, now everything is working again. Thanks, i think people are "complaining" about this bug in extension's comment page. You should make a new version (i cant open pullrequest right now, dont have tortoisegit on this PC).

In getAt function line 314 @ mailaccount.class.js should become:

        var matches = this.responseText.match(/\at=([^"]+)/);

Damn comment and close button xP.

I asked the language thing because via GUI, Post setting its different and looks kinda UI-Dependant (aka button text). But no need to, "old" Post code works fine, only gmail_at was changing.

Thanks for you help =).

AndersSahlin commented 13 years ago

Thanks for helping, I'll release a fix ASAP.

closed for real