(function(){const e=(e,t)=>(Object.keys(e).forEach((o=>{const s=e[o];if("dom"===s.behavior){const e=document.querySelector(s.value);if(!e)return;let n="";n=s.attribute?e.getAttribute(s.attribute):e.innerText,n&&(t[o]=n)}})),t),t=(t,o,s,n)=>{let a={tabId:o,id:s};a=e(t,a),console.log(JSON.stringify(a)),n(a),setTimeout((()=>{chrome.runtime.sendMessage({type:"setPages",data:a})})),setTimeout((()=>{a=e(t,a),chrome.runtime.sendMessage({type:"setPages",data:a})}),1500)};window.chrome.runtime.onMessage.addListener((function(e,o,s){const{type:n,data:a,tabId:i,id:r}=e;switch(console.log(n,a,i,r,location.href),n){case"getPages":t(a,i,r,s);break}return!0}))})();