Insert content from firefox webextension

I created a simple Firefox extension to show an external page in a popup. I was now wondering if it’s possible to use the content from the external page to fill a field in the current tab or if this is only possible when loading the content natively.

Basically what I’m trying to do is:

  • Open a webpage
  • The webpage contains an input field
  • Open the extension > popup appears
  • Click an item inside the popup
  • Use the content of the item clicked as value for a (or all) input fields in the current tab

You can use content script to manipulate current page.

For example when you click the item in the popup, you can execute tabs.executeScript to inject content script into the page and then you can send a message to that script with the values you want to enter.