function insertScript() { chrome.tabs.query({active: true, currentWindow: true}, tabs => { chrome.scripting.executeScript({target: {tabId: tabs[0].id}, function: getData}) }) } // This is an event listener that detects clicks on the battle report button document.getElementById('buttonTwo').addEventListener('click', insertScript) function getData() { alert(document.getElementsByClassName("team__monster__level")[0].innerText); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)