Chrome extension: Communicate/Call an action across multiple chrome profiles in the same computer

569 views Asked by At

So I am creating a extension, they are being run on multiple "Chrome Profiles"

Chrome Profiles = In Chrome, you can make multiple chrome profiles.

So I am trying to share local storage (I am using chrome.storage.local) in my extension to get store/get data.

Example: I have one extension and that same extension is installed on multiple chrome profiles in the same computer

Now if I click a button in my extension, so it should trigger an action in other chrome profiles in the same computer

Plus, the action should also pass the data to other chrome profiles as well.


Chrome profile #1 -- in my extension: I click a button #sayHello

Chrome profile #2, Chrome profile #3,4,5,6 should log sayHello.

What I have done so far: I think I have tried all the chrome messaging api so far.

Is there a way to do it without back-end? Any tricks/tips?

Thank you!!!

1

There are 1 answers

0
Robbi On

It is not possible to pass data among Chrome defined profiles. So what you want to do as you described it is not achievable.

If the problem is sharing information between multiple profiles on the same computer, a solution (bordering on science fiction) could be to use an external service (server you own, firebase, etc.).

You should extract the PC mac address (which is a big deal apart) and then post your data along with the mac-address to the endpoint of the external service. That service then will save data in a DB or in a file. When you connect with the other profile, in the same way you will have to retrieve the mac address, then make a request to the service to see if there is "something" for you.

Another possible solution could be to link the data to the email addresses of the owners of the various profiles (profiles that will have to log in, in this case). As for the example above, you have to post your data to the external service endpoint. When you'll switch to another connected profile, you'll have to retrieve first the email address of the connected user through the Chrome identity API then you'll have to query the external service passing the email adress as parameter to get the data adressed to you. (this second method sholuld work on all PCs).