0

I am making a Chrome extension that adds a button to a React page (whatsapp web). And I want this button to call an existing function, exactly as another already existing button that is inside a menu.

My extension was built using React.js too.

What I already know, is that that existing function is named handleSelectMessages() (I used the React Developer Tools to see that), but I cant find a way to call this function.

How can it be made? (Keep in mind that I cant make changes to the original react page, I can only inject new js)

I`ve tryed the very basic:

<button onClick={() => handleSelectMessages()}/>

But as expected it didnt do anything.

I`ve tryed also:

<button onClick={() => window.handleSelectMessages()}/>

But it seems it is not avaliable globally.

0 Answers0