Answer the question
In order to leave comments, you need to log in
How to pass variable from input from popup.js to inject.js?
popup.html has an input and a button
<input type="text" id="numb" class="no">
<button id="sub" class="subsave">Start</button>
var btn = document.getElementById("sub");
btn.addEventListener('click', start);
function start(e) {
chrome.tabs.executeScript({
code: "let inp = " + document.getElementById("numb").value,
allFrames: true
}, function(result) {
chrome.tabs.executeScript({file: "/js/inject.js", allFrames: true}, function(result) {
});
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question