Author Topic: filtering of external scripts  (Read 670 times)

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
filtering of external scripts
« on: June 11, 2002, 07:48:43 PM »
Hi all,

I would like to get rid of all those nosey external scripts,
but also avoid writing two versions of each filter,
one for $TYPE(htm) and one for $TYPE(js).

I was thinking of something like that (what follows is of course not possible):
Using <script> bounds for html files
and something like <start>*<end> or $NEST({,}) for JS files.

I could throw out the bounds match alltogether, but i don't really like to.
Any ideas?

edit:
I didn't say that i'm speaking about 4 or 5 JavaScript filters that look for certain keywords, rename certain functions etc.

regards, sidki


Edited by - sidki3003 on 11 Jun 2002  22:00:12
 

TEggHead

  • Jr. Member
  • **
  • Posts: 93
    • ICQ Messenger - 21893433
    • AOL Instant Messenger -
    • Yahoo Instant Messenger - eljarec
    • View Profile
    • Email
filtering of external scripts
« Reply #1 on: June 14, 2002, 03:20:15 PM »
Hi SidKi,

quote:

I would like to get rid of all those nosey external scripts,
but also avoid writing two versions of each filter,
one for $TYPE(htm) and one for $TYPE(js).



Well, I chose to just chuck all these in a list and use litteral matching to replace them with nonproperties. Never minding if these occur in actual text or script code or displayed HTML code...can lead to some pretty funny results some times ;)

Some properties (such as history.length, screen.availHeight, etc) I replace by litteral matching into predefined constants (such as "Micorosft Internet Explorer" or -1), others get replaced by "undefined" if possible (making something like

 if( navigator.indexOf('(Microsoft|Netscape)'"


look like

 if( navigator.indexOf("undefined"


JarC

 
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
filtering of external scripts
« Reply #2 on: June 14, 2002, 04:30:57 PM »
Thanks. That's what i will do

sidki