How to hide an element or section using cloudflare worker

I came to know that, we can hide any element/section on a page using cloudflare workers?
Is it right?

Can you help me out, how can i do this??

looking forward to help…

Some example:

addEventListener('fetch', event => {

class ElementRemover {
  element(element) {

const rewriter = new HTMLRewriter()
	.on("#element-to-remove", new ElementRemover()) #select the element to remove, can be ID, class, tag name

async function handleRequest(request) {
  const res = await fetch(request)
  return rewriter.transform(res)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.