How to open a Chrome app from a web link

I am trying to create only a simple html link to open a Chrome application by clicking it. Let's look at the following example:

I installed the application found at https://chrome.google.com/webstore/detail/videostream-for-google-ch/cnciopoikihiagdjbjpnocolokfelagl

If I open the application from the Chrome menu, it will open the application in a new browser tab, chrome-extension: //cnciopoikihiagdjbjpnocolokfelagl/app.html will be displayed as the URL in the address field.

So, naively, I thought that I could just specify this URL so that it is open if I click on the link, that is:

<a href="chrome-extension://cnciopoikihiagdjbjpnocolokfelagl/app.html">Link to the installed Chrome App</a>

But that does not work. How do I do to correctly link to an (installed) application?

+4
source share
3 answers

If you controlled this application, you can use the externally_connectableproperty and listen to requests to launch the application.

But it looks like you are not in control of this application. The normal code of a webpage is unprivileged and cannot name chrome-extension://URLs, etc.

Perhaps you can make an extension to the launcher. Using the managementAPI , you can launch the application using

chrome.management.launchApp("cnciopoikihiagdjbjpnocolokfelagl");

and this can again be called via messaging over the Internet with externally_connectable. But this obviously requires that your users have two different Chrome add-ons installed, the corresponding application and your control panel.

+2

url_handlers

, url_handlers. manifest.json.

...
"url_handlers": {
  "openApp": {
    "matches": [
      "https://www.yourVerifiedDomain.com/openApp"
    ],
    "title": "Open App"
  },
}
...

​​ .

<a href="https://www.yourVerifiedDomain.com/openApp">Open App</a>

, , Xan:

chrome.management.launchApp("<appId>");
0

. Chrome, , . :

  • Chrome
  • " "
  • ""
  • , " "

, , .

Chrome - Google Chrome -.

, Chrome, .

https://chrome.google.com/webstore/detail/videostream-for-google-ch/cnciopoikihiagdjbjpnocolokfelagl

, Chrome . , . , ( 1,5 ), - . Chrome:

https://chrome.google.com/webstore/category/apps

-1

Source: https://habr.com/ru/post/1568178/


All Articles