Can you remove <script> tags from webpage with greasemonkey?

1,667 views
Skip to first unread message

MaxWelby

unread,
Nov 25, 2010, 1:30:47 PM11/25/10
to greasemonkey-users
I am trying to remove a bunch of javascript from a webpage, but I
can't figure it out.

I am a noob to javascript. Can anyone help me out?

MaxWelby

unread,
Nov 25, 2010, 1:37:57 PM11/25/10
to greasemonkey-users
I tried finding the elements with
document.getElementsByTagName("script"). It found the elements. Then I
went to their parentnode and tried to removeChild, but that isn't
removing it. I tried changing its innerHTML to " ", but that also
doesn't work.

Anthony Lieuallen

unread,
Nov 25, 2010, 5:39:12 PM11/25/10
to greasemon...@googlegroups.com
On 2010-11-25 1:37 PM, MaxWelby wrote:
> I tried finding the elements with
> document.getElementsByTagName("script"). It found the elements. Then I
> went to their parentnode and tried to removeChild, but that isn't
> removing it. I tried changing its innerHTML to " ", but that also
> doesn't work.

You can try to remove the script nodes all you want, but the script has
already run, so removing the node is never going to accomplish much.

As has been said many many times before on this list, Greasemonkey runs
after scripts embedded in the page, so you can't directly affect those.

Reply all
Reply to author
Forward
0 new messages