user3913867
user3913867

Reputation: 1

Getting the previous tab url on click of tab in chrome extensions

I have published my application in chrome webstore (example.extension.in). Now my requirement is I would like to add the extension of example.extension.in to browser programatically. i.e., In my test application i have a icon. If i drag and drop it beside the address-bar then extension should be added to browser.

And when the user clicks on that icon while watching some other site eg: www.facebook.com then i should get the url (www.facebook.com).

Is there any way to achieve this?

Upvotes: 0

Views: 270

Answers (1)

Brian
Brian

Reputation: 1553

You can't do it to the address bar since that's outside the web view, but you can do inline installation: https://developer.chrome.com/webstore/inline_installation

In terms of icon while on site, that's also doable. You just need to build a browser action for the icon, and use the active tab: https://developer.chrome.com/extensions/tabs

Upvotes: 1

Related Questions