This commit is contained in:
ccppi 2024-03-19 11:08:22 +01:00
parent a8989ee13a
commit 1e0e313113
2 changed files with 14 additions and 3 deletions

View File

@ -14,7 +14,7 @@ data = readUrl()
});
function handleMessages(message,sender,sendResponse,tab,data){
if(message.state === "Button_clicked")
if(message === "Button_clicked")
{
browser.tabs.executeScript(tab.id,{
file:"spawn.js"
@ -49,6 +49,18 @@ function handleMessages(message,sender,sendResponse,tab,data){
}
}
function readFile()
{
const fileField = document.querySelector('input[type="file"]');
fileField.addEventListener("change",() =>
{
console.log(fileField.files[0]);
});
var reader = new FileReader();
function readUrl()
{
let data;

View File

@ -13,7 +13,6 @@ document.getElementById("id_run").addEventListener("click", function(e){
function startBackgroundScript()
{
browser.runtime.sendMessage({state : "Button_clicked",
fileHandler:fileField);
browser.runtime.sendMessage("Button_clicked");
console.log("home.js sent button_clicked message...");
}