0

I want to build a Chrome extension that shows some content embedded when a specific website is displayed. Exactly the same as Rapportive on Gmail.

Seems that browserAction only enables me to show that content as a popup, not embedded on the webpage. How can I do that?

How can I restrict it to a single URL?

  • 1
    I suspect you are looking for [content scripts](https://developer.chrome.com/extensions/content_scripts), which can be injected into specific pages or sets of pages. – apsillers Jul 07 '16 at 14:43

1 Answers1

2
  1. To embed contents on the web page, see Content Scripts for more details. You could declare your customized scripts/css into current page or use Programming injection to include them
  2. To restrict it to a single URL,
    • you could achieve that by specifying matches field for content scripts
    • Or if you want to dynamically inject your scripts, you could determine whether to inject by detecting current tab url. To detect the url, there are many ways to achieve that, for example, check it in the handler of chrome.tabs.onUpdated
Haibara Ai
  • 9,915
  • 2
  • 23
  • 44