1

I currently have a Chrome extension with a popup.html browser action. This popup allows the user to enter values in various fields, select different websites to search, then it searches those sites in new tabs. What I'd like to be able to do is bridge the gap between a custom fat app and this extension. Namely, the fields being filled out currently must be copy/pasted out of the other application and into this extension, but I'd like to automate that.

I'm open to suggestions on a best way to do this. My thoughts were to open chrome via command line, but i can't find any appropriate switches to open my extension popup. Nor how to reasonably pass data and consume it on the other side. Any ideas/help would be greatly appreciated.

eakins05
  • 78
  • 6

2 Answers2

1

My thought is to create an HTML page within your extension that would be opened in a tab and perform the same functions as your popup page. You could open this page by its URL via a command line or have your Chrome extension open it each time you started up Chrome. If you have the data in your clipboard, you should be able to paste it programmatically. Or you could try passing the data by putting it in an anchor of the HTML page's URL and then reading the anchor with JavaScript.

Unfortunately, this idea would not open the popup, but it would hopefully be a good substitute.

Community
  • 1
  • 1
  • A good substitute was exactly was I was looking for, thanks! I posted the specifics of my solutions below. – eakins05 Jun 25 '13 at 21:07
0

For anybody interested, here are the specifics of how I solved the problem.

  • I set the key in the manifest as described here in order to get a known application ID.
  • As suggested, I passed the requisite data behind the url hash.
  • I created a new page (called it external-landing.html) within my extension. This page contained a single iframe, and on DOM load, I set the src to my popup.html along with the url hash (using this method of js url parsing - thought it was too clever not to share).
  • Consumed the data within the popup as if it had been there all long
  • From our fat app, executed the following cmd:
    start chrome "chrome-extension://known-extension-id/external-landing.html#necessary-data"
eakins05
  • 78
  • 6