security – A more efficient way to block the constant barrage of xhr ad-tracking queries?

I currently have a set of dynamic rules configured to block various ad tracking sites with the help of uBlock Origin, which work with a steady stream of requests, as observed in the recorder. My question would be: is there a more efficient way to proceed?

From what I've understood, the dynamic rules replace the "My filter" rules, but they both correspond to the same thing. Is there a previous point where I could cut these requests, or a potential tip to let a request go, then block it for toll-free numbering? Or maybe even kill him on arrival, so to speak?

My apologies for the poorly worded question. English is my mother tongue, so I do not really have a valid excuse.

javascript – Why is XHR not defined in this ajax call?

I'm trying to make an ajax call but xhr is not defined.

I have a file called threeDmaker.js that is imported into WordPress with the following items:

wp_enqueue_script (& # 39; threeDmaker & # 39 ;, get_stylesheet_directory_uri (). & # 39; /js/threeDmaker.js');

wp_localize_script ('threeDmaker', 'threeDmakerData', array (
& # 39; root_url & # 39; => get_site_url (),
& # 39; nonce & # 39; => wp_create_nonce (& # 39; wp_rest & # 39;)
));

and the threeDmaker.js file looks like this.

import $ since & # 39; jquery & # 39 ;;

function take_screenshot (e) {
var ajaxurl = e.getAttribute ("data-url");
var canvas = document.getElementById (& # 39; threeD-canvas & # 39;);
var dataURL = canvas.toDataURL ();
$ .ajax ({
URL: ajaxurl,
type: "POST",
The data: {
beforeSend: (xhr) => {
xhr.setRequestHeader ("X-WP-Nonce", threeDmakerData.nonce);
}
action: & # 39; my_screenshot & # 39;
dataURL: dataURL
}
error: function (answer) {
console.log (response);
}
success: function (answer) {
console.log (response);
}

});
}

no idea what could go wrong here?