showing results for - "how to store textbox data while typing for chrome extension"
Kyllian
08 May 2017
1function modifyDOM() {
2  const gBody = document.body.innerText;
3  return {
4    first: gBody.match(/,f:([\s\S]*),l:|$/)[1].trim(),
5    last: gBody.match(/,l:([\s\S]*),t:|$/)[1].trim(),
6    phone: gBody.match(/,p:([\s\S]*),e:|$/)[1].trim(),
7    email: gBody.match(/,e:([\s\S]*),fn:|$/)[1].trim(),
8  };
9}
10
11chrome.tabs.executeScript({code: `(${modifyDOM})()`}, results => {
12  $.each(results[0], (id, text) => $('#' + id).val(text));
13});