Creating messageHandlers

This commit is contained in:
2024-03-15 11:03:09 +01:00
parent 2b2c21623c
commit e8b0022302
3 changed files with 85 additions and 7 deletions

14
home.js
View File

@@ -1,9 +1,17 @@
window.onload = run;
function run()
{
document.getElementById("id_run").addEventListener("click", function(e){
console.log("triggered!!");
alert("judihudi");
console.log("triggered!!");
alert("judihudi");
startBackgroundScript();
e.preventDefault();
});
}
window.onload = run;
function startBackgroundScript()
{
browser.runtime.sendMessage("Button_clicked");
console.log("home.js sent button_clicked message...");
}