0

Had a qq: is it possible to launch an extension (that is already installed) when someone clicks on a link ?

For example, let's say on my website I have a button that says "click here to launch the extension". After they install my chrome extension, when a user clicks on this button, could the extension launch? (e.g.- the popup to open).

The goal is this: I have an extension that acts like a search bar. I also have search on the website, but I wanted it to search using the extension instead of the website if a user chooses to.

Thanks for any info, Y

Yura F Kleban
  • 71
  • 1
  • 6
  • Would a custom "protocol handler" (actually a URI scheme handler, but nobody calls them that) work for you, per this question? http://stackoverflow.com/q/7087728/157957 – IMSoP Oct 21 '13 at 21:17

1 Answers1

2

If you are asking for a way to programmatically open the extension's popup, then you will be disappointed (as it cannot be done).

If it serves your purpose, you could do something like this:

  1. Have your extension inject a content script into your webpage.

  2. Have the content script bind to a button's click event.

  3. When the button is clicked: Pass some parameters to the extension's background page, let the extension perform the search and send the results back to the webpage.

Community
  • 1
  • 1
gkalpak
  • 47,844
  • 8
  • 105
  • 118