Remove a line of JS in a live page before submit

Hi there.

Not sure if this is the right place, but I have a small RPA robot that goes into a site fills up a form, and submits it. Recently, the page owner added a piece of Javascript that is causing problems (it is a single line). I know from the development tools in the browser I can comment it out and run everything properly.

My question is: Is there a way within Robotframework for me to comment that line out in the browser before filling the form?

thanks in advance for any help.
Andre

Interesting approach. Have you looked into Playwright? Or then just plain old “execute javascript” that would do the trick for you?

not familiar with Playwright. I will take a look.

But execute javascript would work… Maybe inject the function without the line that is causing problems and remove the original version through a execute Javascript line.

HI, everybody!

I just want to post an update on how I fixed the situation.

Fortunately, the element I needed to get rid of is part of a static DIV on the page. Because of that, I created a Firefox profile for the script to use. Then added an ad-block plugin to the profile, and manually blocked the elements I needed to remove.

At that point, all my headaches are gone.

Regards,
Andre