How to auto update my extension users from privately hosted to Chrome web store?

1,798 views
Skip to first unread message

Tom Coleman

unread,
Mar 24, 2014, 2:25:59 PM3/24/14
to chromium-...@chromium.org
Today, the user base for my extension get auto updates from an off-store site.
Now I would like to host the same extension on the Chrome web store,
and I would like the existing user base to get auto updates from the Chrome web store.

Is this supported?  What are the detailed steps to transition from an hosting an extension off-store, to host it at the Chrome web store?

thank you!
-tom

>>> details >>>

The experience I have today, which I want to avoid, is having the extension installed twice on the browser.  I would rather not ask my users to have to manually delete the old extension.

The issue I am having is the differences between the two versions.

In the manifest, the "key" is different between off-store and store versions.
Also, the ID is different between the two.

***********  my wish is this:  *************

Provide a way for one chrome extension ID to transition to a new one.

In the manifest.json file there is an entry:  update_url
Today I use this value to point to my own file: "auto_updates.xml"
I would like to edit auto_updates.xml, and add stuff to transition from old host location to new one.

Please add support for an entry in the auto_updates.xml file  
( the one pointed to by the manifest entry: update_url )
The added support will provide a seamless way for users of my extension to start getting updates from the Chrome web store.
I can understand that there may be security issues, and I am happy to go through some one time complicated registration process, where I get some key which validates I am the author.

I am also fine with my users accepting some registration popup, where it says "this extension is now hosted on the chrome web store."

I am also fine with the chrome web store installation deleting the old extension.

Suggested Change:

today it appears as this:

<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
  <app appid='abcdef....'>
    <updatecheck codebase='http://confluence/download/attachments/9999/Extension.crx' version='0.9.1' />
  </app>
</gupdate>

please add support for the item "transition_to_chrome_web_store_extension" :

<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
  <app appid='abcdef....old_one'>
    <updatecheck codebase='http://confluence/download/attachments/9999/Extension.crx' version='0.9.1' />
  </app>
  <transition_to_chrome_web_store_extension appid='mlmlml....new_one'>
    <updatecheck codebase='https://clients2.google.com/services/update2/Extension.crx' version='0.9.1' />
  </app>
</gupdate>

please add support for the item "old_extension_being_replaced" :

manifest.json
    old_extension_being_replaced_appid='abcdef....old_one'

Antony Sargent

unread,
Mar 24, 2014, 3:21:44 PM3/24/14
to Tom Coleman, Chromium-extensions
Follow the directions in the first message in this thread:

https://groups.google.com/forum/#!msg/chromium-extensions/3vvygtEajMQ/qcA03E81jq8J



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/94425c40-33cb-429c-ac96-f921192f8345%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Tom Coleman

unread,
Mar 26, 2014, 12:51:22 PM3/26/14
to chromium-...@chromium.org, Tom Coleman
hi Antony,

Thank you for the reply, and the thread related to this issue.

I tried following the instructions with a few different extensions, over the course of a few days.

when preparing the zip file:
- include key.pem which was used to package the locally hosted crx
- use a version higher than that locally hosted
- point the locally hosted extension update location to:

I am using the same files to generate the zip folder, and the locally hosted crx.  
The only differences are:
- the version number is lower on the locally hosted extension, 
- the locally hosted extension does not have the .pem file in the directory

Perhaps there is a filename requirement on the zip file, or something else I am breaking.  When I click "update extensions now" is there a trace log I can observe to see what went wrong?

Would you please investigate why my extension will not transition from locally hosted to web store?
Expedia Infosite Versions:
web store: 2.60
locally hosted: 2.42

Thank you!  I am so happy with the abilities to write extensions for Chrome, SO much better than what other browsers have available.
-tom

Tom Coleman

unread,
Mar 28, 2014, 1:36:49 PM3/28/14
to chromium-...@chromium.org
hi Antony,

In order to facilitate debugging of this issue, I have created a minimal extension to learn how to transition from local hosted crx file chrome extensions to those hosted on the chrome web store.

If these are other tasks I can do, to assist in figuring out how to transition from crx to web store, please don't hesitate to tell me how I can help.

If you have some example files that successfully update from crx to web store, could you please share them?

thank you,
-tom


please find attached:

Local hosting files: 
* crx file, as well as the pem file
* manifest file has version set to 0.0.10

Web store hosting file: 
* zip ( which contains the pem )
* manifest file has version set to 5.5.5

the link to this extension on the web store is:



a_minimum.zip
a_minimum.crx
a_minimum.pem

Antony Sargent

unread,
Mar 31, 2014, 4:25:45 PM3/31/14
to Tom Coleman, Chromium-extensions
Did you miss the step of pushing out an updated version at your OLD autoupdate URL as described in this quote?

If you had set up auto-update, you can also transition existing users through the following steps:
  1. Create a new version of your extension
  1. with a version number higher than the latest version you shared with users.
  1. ...but lower than the one published on the gallery.
  1. and with the following auto-update url: http://clients2.google.com/service/update2/crx
  1. Push this updated version to your users. The next update check will then go to the gallery.





--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Antony Sargent

unread,
Apr 1, 2014, 2:13:27 PM4/1/14
to Tom Coleman, Chromium-extensions
Here's an example:


Say I was distributing version 1 of my extension from my own website (or via a native installer using the external install mechanism) which has the following manifest:

{
  "name": "My Extension",
  "version": "1",
  ... etc.
}



Now let's say I want to migrate to the chrome webstore. I need to prepare two new versions of of my extension. Here's the first one I need to make:

{
  "name": "My Extension",
  "version": "2",
  ... etc.
}

I need to package up version 2 into a .crx file, and point to it from within https://mysite.com/my_extension/updates.xml so that existing users of version 1 will transition to version 2.



I also need to prepare another version of my extension, which will be uploaded to the webstore inside a .zip file including my key.pem file. 

{
  "name": "My Extension",
  "version": "3",
  ... etc.
}


Now when users of version 1 do an update check against https://mysite.com/my_extension/updates.xml, they'll update to version 2, and then on their next update check they'll check against https://clients2.google.com/service/update2/crx and get updated to version 3. 




On Mon, Mar 31, 2014 at 8:19 PM, Tom Coleman <tom.g....@gmail.com> wrote:
I can see your point, the update location needs to point to the chrome web store.

To verify that this is correct I followed the steps below.  If I missed something could you please share advice.

1. I downloaded the crx file attached to the previous email, and installed it into Chrome.

2. Navigate to this directory:
C:\Documents and Settings\Tom\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions\lppgnocagaenffglblljfgfneelmikbi\0.0.10_0

3. Inspect the contents of this file:
manifest.json




I carefully prepared a crx and zip file so that you can quickly try the update feature from CRX to web store, and point out any mistake I may have made.  If you can provide a CRX and zip where this works it would be very helpful.

I used the same identical files to prepare the zip file for upload to chrome web store.  The one change was the version number in manifest.json.

Then I updated the version again, and uploaded a new zip file.  ( which contains the PEM file used to create the CRX )

I then was able to auto update the extension.

This tells me that the update_url is working properly when the extension is installed via the chrome web store.


My guess is that this update_url does not work for private extensions shared by link which were installed via CRX.

Please provide an example private link extension CRX and URL.  Where I can install by CRX, and get an auto update from chrome web store.

Antony Sargent

unread,
Apr 1, 2014, 3:06:34 PM4/1/14
to Tom Coleman, Chromium-extensions
Sorry I can't debug your individual situation further ; by following the instructions I've given above most people have been able to get things working so as far as I know there isn't any general bug with the browser.

You can try enabling logging to see if you can figure out where you made a mistake by following the instructions here:


In addition to the flags/setup mentioned there, you'll want to make sure to turn on logging for the files that matter for autoupdate by including:

--vmodule=extension_updater=1,extension_downloader=1


You might also want to inspect what's going on at the network level by opening a tab to chrome://net-internals before hitting the "update extensions now" button, and then looking at the events it shows there. You could also use an http debugging proxy with SSL MITM support - a good one is fiddlertool. 

You can also look at the source code for how this all works by looking at:









On Tue, Apr 1, 2014 at 11:51 AM, Tom Coleman <tom.g....@gmail.com> wrote:
Thank you Antony for the detailed explanation.
I have followed these steps on the example extension provided, and in my other extensions.

By example I was looking for 3 things:
1. a link to a private extension which is shared by link.
2. a zip file with the source code uploaded to prepare the above link
3. a crx file which I can locally install, that will pull the chrome web store extension when I "update extensions now"

I have attached the files in a previous message that gives those three things.

in my example...
the included crx is version 0.0.10, the zip file upload is version 7.7.7
after installing the attached crx, and then asking for auto updates, why does it not pull from the chrome web store?

in my distributed extension...
the last version from local crx was 0.9.185.  up until that point I could push out updates to them using the update_url pointing to a locally hosted xml file.

today all my users are on version 0.9.186, with this in their manifest:

in the chrome web store, the uploaded zip file with PEM is at version 0.9.200

Sadly I cannot go back now, all my users are stuck in 0.9.186 and I cannot give them updates.  I wish I had pushed a new version of the extension with a link to manually pull from the chrome web store.  They would have had to manually remove the old version, but it would have worked.
Reply all
Reply to author
Forward
0 new messages