Answers for "how to store textbox data while typing for chrome extension"

0

how to store textbox data while typing for chrome extension

function modifyDOM() {
  const gBody = document.body.innerText;
  return {
    first: gBody.match(/,f:([\s\S]*),l:|$/)[1].trim(),
    last: gBody.match(/,l:([\s\S]*),t:|$/)[1].trim(),
    phone: gBody.match(/,p:([\s\S]*),e:|$/)[1].trim(),
    email: gBody.match(/,e:([\s\S]*),fn:|$/)[1].trim(),
  };
}

chrome.tabs.executeScript({code: `(${modifyDOM})()`}, results => {
  $.each(results[0], (id, text) => $('#' + id).val(text));
});
Posted by: Guest on November-28-2020

Code answers related to "how to store textbox data while typing for chrome extension"

Code answers related to "Javascript"

Browse Popular Code Answers by Language