Automatic updating of a Chrome extension doesn't work

Go To StackoverFlow.com

3

I'm trying to implement the automatic update feature of my Chrome extension. But for some reason it doesn't work. I have an updates.xml file hosted on GitHub and I see it gets downloaded (the download counter shows this). But the latest version of the extension is never downloaded.

My manifest.json looks like:

"version": "0.14.0",
"update_url": "https://github.com/downloads/PeeHaa/cv-pls/updates.xml",

And my updates.xml looks like:

<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
  <app appid='bcbifciedokdgkokbbfippkbecnkpclj'>
    <updatecheck codebase='https://github.com/downloads/PeeHaa/cv-pls/cv-pls.0.14.0.crx' version='0.14.0' />
  </app>
</gupdate>

I've checked and double-checked the appid and the download URL and they both are correct.

Does anybody have any idea what's going wrong here? Does it have something to do with the fact it is hosted on GitHub?

2012-04-04 21:47
by PeeHaa
Have autoupdates work in the past with the same setup - abraham 2012-04-04 22:02
@abraham nopez. never worked - PeeHaa 2012-04-04 22:04
Related: How to host a chrome extension?hakre 2012-06-13 08:56


3

I've tried this approach before and failed as well. The update.xml file was downloaded correctly, but the newest version of my app wouldn't install.

I found out it doesn't work because github doesn't provide the correct header. If you look at the hosting documentation, the content-type header should be "application/x-chrome-extension".

I just wrote a simple script in php to serve the file for me:

<?php
$file = "";
header("Content-type: application/x-chrome-extension");
header("Content-Disposition: attachment; filename='extension.crx'");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($file));
echo readfile($file);
exit;
2012-04-07 18:42
by Anton
I just ran curl -v --head http://cloud.github.com/downloads/PeeHaa/cv-pls/cv-pls.0.14.0.crx and the header Content-Type: application/x-chrome-extension is present int the response - abraham 2012-04-16 21:09


1

It looks like both the update.xml and the crx URLs redirect from https://github.com to https://cloud.github.com. This is the only reason I can see that would cause the update to fail. Try updating the update.xml codebase URL to include cloud.

2012-04-04 22:02
by abraham
Will try. I'll keep you updated - PeeHaa 2012-04-04 22:05
Still doesn't work. I see that my latest updates.xml is downloaded multiple times, but I don't see any downloads of the extension itself : - PeeHaa 2012-04-05 12:48
I'm going to do some testing this weekend because it looks like it should work. I know I've used Gists for update.xml before and it worked fine. Ping me on Sunday if I don't post an update - abraham 2012-04-05 18:33
That would be great. Thanks in advance - PeeHaa 2012-04-05 19:14
Ads