Chrome extension auto-update not working
I am trying to implement an auto-update feature for my Chrome extension . But for some reason it won't work. I have a file updates.xml
hosted on GitHub and I can see that it is downloading (this shows the download counter). But the latest version of the extension is never loaded.
Mine manifest.json
looks like this:
"version": "0.14.0",
"update_url": "https://github.com/downloads/PeeHaa/cv-pls/updates.xml",
And mine updates.xml
looks like this:
<?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 have checked and double checked appid
both the download url and both are correct.
Does anyone know what's going on here? Is this because it is hosted on GitHub?
source to share
I have tried this approach before and failed. The update.xml file was loaded correctly, but the newest version of my application will not be installed.
I found out that this 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 pass the file to 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;
source to share