diff --git a/script_background.js b/script_background.js index eda9f7e..86473d0 100644 --- a/script_background.js +++ b/script_background.js @@ -13,7 +13,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse)=>{ case "alert": handleAlert(request); case "get": - handleGet(request, sendResponse); + //handleGet(request, sendResponse); } sendResponse("This is a mo'fuckin response") }) @@ -30,11 +30,5 @@ function handleAlert({message}){ function handleGet({message}, sendResponse){ console.log('handling get'); - const file = chrome.runtime.getURL('./toolbar.html'); - fetch(file) - .then((res) => { - console.log("RESPIGGITY SPONSE!") - console.log(res); - sendResponse("biggy"); - }) //assuming file contains json + } \ No newline at end of file diff --git a/script_foreground.js b/script_foreground.js index 97ffc24..4da4cba 100644 --- a/script_foreground.js +++ b/script_foreground.js @@ -7,13 +7,11 @@ let config = { watch: true } -chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ - console.log('message recieved','---------'); - console.log(message, sender, sendResponse); -}); function appendTool(html){ - chrome.runtime.sendMessage({message:{flag:"get", option:"toolbar.html"}}) + chrome.runtime.sendMessage({message:{flag:"get", option:"toolbar.html"}}, function(res){ + console.log('balls', res ) + }) /* ADD HTML BUTTONS */ @@ -35,7 +33,7 @@ function appendTool(html){ var refresh_btn = document.querySelectorAll('[data-qa-action-id="refresh-queue"]')[0]; if(refresh_btn){refresh_btn.click()}; if(newQuestion()){ - chrome.runtime.sendMessage({message:{flag:"alert", option:config.alert}}); + //chrome.runtime.sendMessage({message:{flag:"alert", option:config.alert}}); config.watch = false; }; }, config.speed); @@ -49,7 +47,7 @@ function appendTool(html){ }) - chrome.runtime.sendMessage({message:{flag:"alert", option:config.alert}}); + //chrome.runtime.sendMessage({message:{flag:"alert", option:config.alert}}); } function newQuestion(){