Sumalatha M
Sumalatha M

Reputation: 11

Is it possible to show chrome extension icon inside the web page?

Is it possible to show chrome extension icon inside the web page?I am able to create an extension using page action ,icon is shown inside the address bar ,but i need to show it inside the web page ...

Upvotes: 0

Views: 173

Answers (1)

Xan
Xan

Reputation: 77591

Well, there is no special API you can simply use for that.

You can inject your own UI elements into the page, but it's going to be difficult. I will only outline this, don't ask for specific code.

You will need a Content Script (also, read the Architecture Overview page if you haven't yet) to access the contents of the page.

Then, you need to create and append your elements to the DOM of the page. In your case, you could possibly add an <img> tag with your icon and a click listener that does something.

Note that to avoid clashes with CSS of the page itself it is recommended to use Shadow DOM techniques.

Of course, this may or may not work well depending on the page you're injecting into.

Upvotes: 1

Related Questions