$("#iframe's ID").contents().find("#iframe's advertising ID").remove()
Originally, this code was used to remove ads that reference iframe, but each page The advertising id is updated as soon as it is refreshed. Cpg23241154qzkmv Cpg23241154ustep Cpg23241154gvhzk How to write to make this ID dynamic.
It seems that its ID is quite regular, basically starting with "Cpg", then the processing is as follows
This kind of direct query for iframes excludes those in your own site and blocks all others, or you can determine whether the name of the iframe meets a certain rule and then block it
If you can find a pattern, write a regular rule
It starts with Cpg, the middle 8 characters are always numbers, and the last 5 characters are lowercase letters:
Start with Cpg23241154, the last 5 are numbers or letters: