0

is it possible for a Chrome Extension to control/manipulate several tabs at once? For example, if I have two or three Chrome tabs open, and they all have a similar layout, with a text boxes located roughly in the same place; - would an extension be able to fill/click on those text boxes all at once, (in the two/three tabs open); even if the particular tab(s) in question/being edited are not brought to front at the time?

Many thanks in advance!

sowbug
  • 4,644
  • 22
  • 29
Chromer101
  • 25
  • 4

1 Answers1

0

You definitely can change content of a textbox if the tab is not currently active, if you have a content script injected in it. It can be tricky*, but you can invoke a click event on an element most of the time. However, you need to consider permissions to inject a script into that tab first.

activeTab permission does not generate warnings to the user, but he'll have to manually click the extension button on each tab before it will work. It is probable (but not necessary) that it's not what you want.

If you want your extension to automatically apply to a set of websites, you can request permissions for all of them and inject your content scripts at leisure, following whatever logic your extension uses, and then communicate required synchronizations via Messaging API.

* the linked question is about a keydown event, but the problem is similar

Community
  • 1
  • 1
Xan
  • 74,770
  • 16
  • 179
  • 206