in my chrome extension I have the codes below which display alerts correctly:
manifeste.json
{index.html
<!doctype html>popup.js
const button = document.getElementById('btn');I want to keep the same principle, i.e. to enter a code in the text field of the index.html page and launch a function, but I want to replace the alert functions with filling functions as follows:
instead of 1: function () { alert(1); },
i want to put
1: function () {When I did the test with the method I just mentioned, I received the following error message:
Is there a solution that allows me to do this. I'm fairly new to all of this, so any help would be much appreciated.
I noticed that the functions launch on the window of the "index.html" extension and not on the target web page, here are the images:
my question is how to launch the functions of my extension on a web page?
manifeste.json
{index.html
popup.js
const button = document.getElementById('btn');--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/5065f7c6-782c-4eec-b26a-0b22009a021an%40chromium.org.
I explain my request, I have an intranet web interface with text fields to fill and the id "categorisation_1" is only one example so I want to do an automatic filling instead of doing it manually several times a day.
I was able to collect some information that helped me do most of it, but unfortunately the problem that remains is to execute the code on the web page and not on the extension window.
what I want to know now is how to make the connection between background.js and popup.js so that my functions run in the web page after the button click.
I already shared my request on the link: https://stackoverflow.com/questions/73864317/why-the-functions-of-my-extension-are-not-injected-on-the-web-page