The JS code provided in some webpage advertisements can be code injected and then monitor various elements.
The following example is to monitor the input value of the Baidu input box and then display it,
;(function()
{
function myfn()
{
var ssk=document.getElementById("kw");
var ssz=ssk.value;
alert(ssz);
}
var btn = document.getElementById ("su");
btn.addEventListener("click",myfn,false);
//Read the cookie value here, and then call an ajax to upload it to the local server.
<.>})();
This method allows the advertising JS code to monitor the content, read the cookie information of the current page, and then execute the ajax code to upload the local data to its own server. , so that when ads are opened on other websites, some ads can be pushed to the current website based on information about previous visits to the website.