Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to store textbox data while typing for chrome extension

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

chrome.tabs.executeScript({code: `(${modifyDOM})()`}, results => {
  $.each(results[0], (id, text) => $('#' + id).val(text));
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #store #textbox #data #typing #chrome #extension
ADD COMMENT
Topic
Name
9+7 =