Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test inline installation of Chromium/Chrome extensions locally?

I am trying to test the inline installation feature of the Chrome Webstore as per this document (https://developers.google.com/chrome/web-store/docs/inline_installation). I am developing this locally to test and cannot easily and often push my changes live.

How do I test inline installation locally since inline installation depends on your site being verified in Webmaster Tools?

Code

if (!chrome.app.isInstalled) {
    chrome.webstore.install(undefined, undefined, function(err) {
        console.log(err);
    });
}

This returns:

Installs can only be initiated by the Chrome Web Store item's verified site 

Obviously localhost is not a verified site.

Any help is appreciated.

like image 936
Nick Presta Avatar asked Aug 10 '12 19:08

Nick Presta


People also ask

How do I run a CRX file in Chrome?

Go to chrome://extensions/ and check the box for Developer mode in the top right. Click on the “Load unpacked” button, and go to the location of the content of this CRX file. And click on the OK button to install that Chrome extension.


1 Answers

From Google's Using Inline Installation guide: "Note that if you verify ownership for a domain (for example, http://example.com) you can initiate inline installation from any subdomain or page".

So, if you do own a domain, you can verify it and then simulate that your local machine is a subdomain of your verified domain.

For instance, if you verify with Google the domain example.com, you can include the following in your hosts file:

127.0.0.1 local.example.com

Then you can access your local server via http://local.example.com (some configuration on your local webserver may be needed). If you associate your item in the Chrome Webstore with example.com, you'll be able to start an inline installation from your local page.

like image 180
rsanchez Avatar answered Nov 02 '22 06:11

rsanchez