phaistonian / MyExtensions

Are you an extensions developer? Keep track of your Chrome extensions. Be notified for new comments, ratings and more!
https://chrome.google.com/webstore/detail/igejgfmbjjjjplnnlgnbejpkpdajkblm
52 stars 24 forks source link

Doesn't work, at all? #4

Closed brisssou closed 12 years ago

brisssou commented 13 years ago

Hello, You extension has just receive some advertisement on the chrome-app group, and it seems like a nice extension. But I can't get to do anything. When trying to add an extension on the options page, nothing happen, and the console gets filled with Ext is not defined.

I'm using 15.0.869.0 (Build officiel 99327) canary on windows 7x64

Thanks for your help!

brisssou commented 13 years ago

humkay, that's a duplicate of #1

sorry sorry...

phaistonian commented 13 years ago

Hello,

I am aware of this issue. It's actually fixed but I am kind of unable to update it since the new policy requires me to draw some new icons and stuff and frankly, I just don't have the time to do it.

I am going to be away for a trip for a couple of days. I am planning to update the extension after I come back.

Sorry for taking so much time to reply.

George E. Papadakis georgepapadakis.me | @phaistonian

On 2 Sep 2011, at 23:49, brisssou wrote:

Hello, You extension has just receive some advertisement on the chrome-app group, and it seems like a nice extension. But I can't get to do anything. When trying to add an extension on the options page, nothing happen, and the console gets filled with Ext is not defined.

I'm using 15.0.869.0 (Build officiel 99327) canary on windows 7x64

Thanks for your help!

Reply to this email directly or view it on GitHub: https://github.com/phaistonian/MyExtensions/issues/4

brisssou commented 12 years ago

Nothing updated.

I tried to remove all extensions and add them again: bad luck. I can't add them back, the extension can't find them.

Thanks!

phaistonian commented 12 years ago

Hello.

You are right. Google has done some changes, so in order for this extension to actually auto-fetch all your extensions based on your username, won't really work (at this moment).

Please try adding the extensions using their ID.

If that won't work too, I will try to find some time to look at it.

Thank you.

brisssou commented 12 years ago

Unfortunately, using IDs does not work either.

Thanks for your help!

phaistonian commented 12 years ago

That is very, very weird.

Could you please provide either some IDs or your username for further checking?

brisssou commented 12 years ago

I even checked with My Extensions, with no luck.

Those lines end up in the console: Failed to load resource: the server responded with a status of 441 (unknown) https://chrome.google.com/webstore/ajax/detail?hl=en&pv=1323796576&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1330936583133

POST https://chrome.google.com/webstore/ajax/detail?hl=en&pv=1323796576&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1330936618985

chrome.google.com/webstore/ajax/detail?hl=en&pv=1323796576&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1330936618985:1

(unknown) Class.send Ext.Extension.Class.getActualMetajs.js:1608 Ext.XHR.meta.Ajax.onSuccessjs.js:1456 _78 (anonymous function) Array.extend.forEach Class.invokeEvent _78

I tested on Linux (Ubuntu 11.10x64) with 19.0.1055.1, and on Windows 7x64 with canary.

phaistonian commented 12 years ago

Thanks for the reply.

Unfortunately, I will have to be away for a couple of days.

I have already put up a reminder so that I will check it when I come back.

Please forgive my delay fixing/doing things; things are pretty hectic down here.

brisssou commented 12 years ago

Thanks a lot!

It's just a bug report, not a death threat ;-) take your time. You're tool is great, so it's fustrating when it stops working. I see google making changes all the times in the chrome store.

Thanks again!

neocotic commented 12 years ago

I've tried looking at this and can't see why using extensions isn't working as I'm able to add these. However, I see why the username check isn't working anymore and I'll put together a patch for this.

The service now uses a RESTful URL. For example; https://chrome.google.com/webstore/search/George%20Papdakis. Since usernames don't exist in the same way I'll also change the wording to something like "Author" as the results seem to be based on this field. To find my extensions I have to search for neocotic and not my name as my extensions have the author field as neocotic.com. Finally, I'll need update the regex to capture the IDs correctly;

// Captures all of the extension links
/<a class="[^"]*id-wide-tile-anchor[^"]*" href="https:\/\/chrome.google.com\/webstore\/detail\/[^"]+"[^>]*>/gi;
// Extracts ID from individual links (in loop)
/\/webstore\/detail\/([^"]+)/i;

Unfortunately, I don't think I can fix the other problem you're experiencing since I'm not able to replicate it so I'm not sure this fix will help you out here as the details are then fetched for each of your extensions afterwards, a process which isn't working for you. In true IT fashion; have you tried turning it off and back on again (uninstall -> re-install)?

I'm also going to try and include a small fix for extensions with over 1m users (e.g. AdBlock) not having their user count fetched. This problem was reported in a review by Fam Lam.

neocotic commented 12 years ago

I've raised a pull request that deals with the issues I previously mentioned.

@brisssou I still wasn't able to replicate the issue you're experiencing with the standard update process. I would suggest re-installing the extension as I can't imagine what's going wrong.

That said; I did noticed that the pv parameter (which the webstore relies so heavily on) in your requests was 1323796576 (i.e Tue, 13 Dec 2011 17:16:16 GMT). This is the default value I put in for the original fix but the code tries to fetch the latest value before each update. This wouldn't be an issue unless this fetch is failing for whatever reason and the default value no longer matches the expected pv. Currently the endpoints are expecting pv to be 1330633475 (i.e. Thu Mar 01 2012 20:24:35 GMT) so this might explain why you're seeing a problem but not why the pv values aren't matching.

I believe the pv parameter is used to ensure the webstore code is calling the correct endpoints after an update (to the webstore itself) while tackling caching problems.

brisssou commented 12 years ago

Here are the POST made to details when I use the webstore to see My Extensions:

Request URL:https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=mmapnhgbanipillmolcbaidjboadhngn&_reqid=643226&rt=j

Request URL:https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&_reqid=543226&rt=j

Request URL:https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=pcflmbddgcmomcfngehfhlajjapabojh&_reqid=443226&rt=j

Request URL:https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&_reqid=343226&rt=j

Request URL:https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&_reqid=243226&rt=j

My extensions does a single POST: Request URL:https://chrome.google.com/webstore/ajax/detail?hl=en&pv=1323796576&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1331204684407 Request Method:POST Status Code:441 unknown

I tried:

$ curl -X POST 'https://chrome.google.com/webstore/ajax/detail?hl=en&pv=1323796576&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1331204684407' -i -H 'Content-Length: 0' HTTP/1.1 441 unknown

Then using the url from the web store: $ curl -X POST 'https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm&_reqid=243226&rt=j' -i -H 'Content-Length: 0' HTTP/1.1 200 OK $ curl -X POST 'https://chrome.google.com/webstore/ajax/detail?hl=fr&gl=FR&pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm' -i -H 'Content-Length: 0' HTTP/1.1 200 OK $ curl -X POST 'https://chrome.google.com/webstore/ajax/detail?pv=1330633475&id=igejgfmbjjjjplnnlgnbejpkpdajkblm' -i -H 'Content-Length: 0' HTTP/1.1 200 OK

And I ended with a bunch of data in the response body. Indeed, 'pv' seems to be the only mandatory field, along with id of course ; but 'pv' computation seems to be wrong in the extension.

my 2cts ;-) Brice.

neocotic commented 12 years ago

Well, lucky you mentioned that as I made a slight mistake in my latest changes but I've fixed them now.

Unfortunately, since Google do not have a public API for the webstore (which we have suggested to them - for both our benefits) we are required to scrape the data. Since pv is required, but only mentioned a few times in the code of the pages themselves, that's where we must derive it from.

I don't think this derivation is wrong as I'm not able to replicate this and my requests are sent using the pv value fetched previously. What I'm concerned about is why you're only seeing a single request as I would expect to see 2 per extension as the first is required to fetch the pv and only if that call is successful is the 2nd call made.

The way in which pv is scraped is quite simple and you can try it for yourself.

  1. Go to My Extensions' page
  2. Open the Console
  3. Run the following code;
(function () {
  var pv = null;
  var matches = document.body.innerHTML.match(/<script type="text\/javascript" src="\/webstore\/static\/(\d*)\/wall\/js\/webstore.js"><\/script>/i);
  if (matches && matches.length) pv = matches[1];
  // Or if you want to use my latest changes, replace with the following;
  // if (matches && !isNaN(parseInt(matches[1]))) pv = matches[1];
  // They both do the same really. Except the latter is safer in my opinion.
  return pv;
}());

You should then see the pv value in the console. What is this value to you? I'm wondering if this is some sort of strange caching issue.

Finally, are you using version 0.9.5.0 of this extension?

brisssou commented 12 years ago

For conciceness, I listed only POST calls, there is indeed a GET: Request URL:https://chrome.google.com/webstore/detail/igejgfmbjjjjplnnlgnbejpkpdajkblm?source=igejgfmbjjjjplnnlgnbejpkpdajkblm&_crnd=1331204683359

The regEx you provided only works with ?hl=en. The pv in the page is: 1330633475.

With the French UI, the js link looks like : "/webstore/static/1330633475/wall/js/webstore__fr.js", so I would suggest going from var matches = responseText.match(/<script type="text\/javascript" src="\/webstore\/static\/(\d*)\/wall\/js\/webstore.js"><\/script>/i);

to var matches = responseText.match(/<script type="text\/javascript" src="\/webstore\/static\/(\d*)\/wall\/js\/webstore[a-zA-Z_]*.js"><\/script>/i);

I forked, and requested a pull. The extension works for me now !

Thanks a lot to both of you! Brice.

neocotic commented 12 years ago

That's great! Honestly, I'd be happy if anything after /js/webstore is ignored. For example;

/<script type="text\/javascript" src="\/webstore\/static\/(\d*)\/wall\/js\/webstore[^"]*"><\/script>/i

Less chance for future problems in my opinion.

brisssou commented 12 years ago

indeed