Author Topic: Alternative to <start> Filters  (Read 9728 times)

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« on: August 15, 2002, 12:28:38 AM »
Lately, when using <start> filters, i came across more and more pages that wouldn't load completely.
So my Bypass Start-End list grew rapidly.
Here is what i use now instead of <start>:

[Blocklists]
List.Bypass_Start-End = "..ListsBypass Start-End.txt"

[Patterns]
Name = "Header (top) Multi: Mark start"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Limit = 128
Match = "<head>"
        "|"
        "("
        "("
        "("
        "(<html*>)|(<body*>)1"
        ")"
        "&(^*<head>)"
        ")"
        "&$SET(2=
</head>
)"
        ")"
Replace = "
<head>

"
          "<!-- Start injected  Proxomitron filters Header Top -->
<ProxMarkHdrTop>
"
          "21$STOP()"

Name = "Header (top) Multi Inject: Tame Javascript (part 1)"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Bounds = "<ProxMarkHdrTop>"
Limit = 32
Match = "*"
Replace = "<script type="text/javascript" src="http://local.ptron/start.js"></script>"
          "
<ProxMarkHdrTop>$STOP()"

Name = "Header (top) Single: Mark end"
Active = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Bounds = "<ProxMarkHdrTop>"
Limit = 32
Match = "*"
Replace = "<!-- End   injected  Proxomitron filters Header Top -->"
          "
$STOP()"

Name = "Header (bottom) Multi: Mark start"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Limit = 128
Match = "</head>"
        "|"
        "("
        "("
        "((<html*>)&(^*<head>))"
        "|"
        "(<body)1"
        ")"
        "&$SET(2=
<head>)"
        ")"
Replace = "2

"
          "<!-- Start injected  Proxomitron filters Header Bottom -->
<ProxMarkHdrBottom>
"
          "</head>
1$STOP()"

Name = "Header (bottom) Multi Inject: DHTML Menu Script"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Bounds = "<ProxMarkHdrBottom>"
Limit = 32
Match = "*"
Replace = "<script type="text/javascript" src="http://local.ptron/menu.js"></script>"
          "
<ProxMarkHdrBottom>$STOP()"

Name = "Header (bottom) Single: Mark end"
Active = TRUE
URL = "$TYPE(htm)(^$LST(Bypass_Start-End))"
Bounds = "<ProxMarkHdrBottom>"
Limit = 32
Match = "*"
Replace = "<!-- End   injected  Proxomitron filters Header Bottom -->"
          "
$STOP()"

------------------------- Bypass Start-End.txt -------------------------
#dummy
------------------------------------------------------------------------
My Bypass Start-End list is currently empty .

Filters 1 and 4 do the main job. If an essential tag is missing, they create it.

Filters 2 and 5 are just examples.
The top of the header block is where i place most of my start filteres. Start.js *has* to be here, if you use it.
The bottom of the header block is the place of choice for non-essential scripts.
If you want your StyleSheet to override the one of the page author, place it here as well.

Filters 3 and 6 do the clean-up and mark the end.


/sidki


 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Alternative to <start> Filters
« Reply #1 on: August 17, 2002, 11:06:45 PM »
Hiya sidki,

If I remove the "marking" that filter number 4 makes, then disable filter number 6. Will they still function correctly? Filter number 4 still adds the miising tags, but doesn't put "<!-- Start injected Proxomitron filters Header Bottom -->
<ProxMarkHdrBottom>
"



--------
Infopros Joint :: Computer Related Links And Discussion

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Alternative to <start> Filters
« Reply #2 on: August 17, 2002, 11:14:24 PM »
It seems to work, I just want to make sure.

--------
Infopros Joint :: Computer Related Links And Discussion

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« Reply #3 on: August 17, 2002, 11:19:00 PM »
Hi JD,

Sounds like you want to go for the top of header filters only?
If so, i'd just use filters 1 and 3.
Not 100% sure though, i wrote them a while ago.
Give a shout in case of problems.

/sidki

 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Alternative to <start> Filters
« Reply #4 on: August 17, 2002, 11:24:33 PM »
So I don't need number 4?

Your still using the <end> filters, right?

Hmmm.. This is a bit complicated to explain...

--------
Infopros Joint :: Computer Related Links And Discussion

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« Reply #5 on: August 17, 2002, 11:33:44 PM »
I would try it without filter 4 and go to a page without header.

I'm still using <end> filters, i was thinking about replacing them as well ... but thats more complicated:
find the last </html> tag, if there is none create it after ... what?




Edited by - sidki3003 on 18 Aug 2002  00:39:00
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Alternative to <start> Filters
« Reply #6 on: August 18, 2002, 12:17:14 AM »
Ok, I'll give it a go. Thx.

LoL

--------
Infopros Joint :: Computer Related Links And Discussion

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« Reply #7 on: August 18, 2002, 01:33:54 AM »
sidki wrote:

quote:

find the last </html> tag, if there is none create it after ... what?



do you think this could work?

Match = "</html>|<end>"
Replace = "</html>"

altosax.

 
 

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« Reply #8 on: August 18, 2002, 01:39:27 AM »
I'm afraid no
AFAIK <start>/<end> have to be the only thing in the matching expression.

 
 

TEggHead

  • Jr. Member
  • **
  • Posts: 93
    • ICQ Messenger - 21893433
    • AOL Instant Messenger -
    • Yahoo Instant Messenger - eljarec
    • View Profile
    • Email
Alternative to <start> Filters
« Reply #9 on: September 01, 2002, 11:11:07 AM »
I don't know if it will be usefull for anyone, I have been using a filter for a long time now that will try and fix  the head section so that I at least always have a known pattern and a complete head section to match for in filters which need to inject stuf there...also the main purpose of this filter is to insert a known token, for later filters to match on, so that I could be sure of the order of the injected stuf  (each next inject has to be below the previous inject, and with a possibly absent tag in the head section I could not use e.g. </head>),

and I can't wait until one of you shows me a URL where it'll fail, coz nodoubt this will happen, although I haven't yet come accross a site where it did not work.

It has seen many tweaks in it's lifetime, and it's gotten up to the point that I am not even thinking of trying to explain the logic...(small hint, this is a classic CASE/IF-THEN-ELSE construction)

I'll just say this, it's marked multi so I can use the 'fix'ed tags too for later filters.
To make sure it only triggers at the <start> and not on embedded tags in page-generating scripts, it is STOP()ed when it has done it's job.


Name = "Fix: HEAD section insert PING (JarC) [multi]"
Active = TRUE
Multi = TRUE
URL = "*&(^$IHDR(Content-Type:*PrxOriginalType*))&$TYPE(htm)"
Limit = 4096
Match = "<"
        "(HTML>9(<HEAD             $SET(1=9)"
        "          |</HEAD            $SET(1=9
8
</HEAD>)"
        "          |<TITLE>8</TITLE  $SET(1=9
<TITLE>8</TITLE>) $SET(2=</HEAD>)"
        "          |</TITLE           $SET(1=<TITLE>9</TITLE>)       $SET(2=</HEAD>)"
        "          |<BODY8           $SET(1=9
</HEAD>)           $SET(2=<BODY8>)"
        "          )"
        "|HEAD>9(<TITLE>8</TITLE    $SET(1=9
<TITLE>8</TITLE>)"
        "        |</TITLE             $SET(1=<TITLE>9</TITLE>)"
        "        |</HEAD              $SET(1=9
</HEAD>)"
        "        |<BODY8             $SET(1=9
</HEAD>)           $SET(2=<BODY8>)"
        "        )"
        "|/HEAD                       $SET(1=</HEAD>)"
        "|TITLE>9</TITLE             $SET(1=<TITLE>9</TITLE>)       $SET(2=</HEAD>)"
        "|/TITLE                      $SET(1=<TITLE>Untitled</TITLE>) $SET(2=</HEAD>)"
        "|BODY8                      $SET(1=</HEAD>)                 $SET(2=<BODY8>)"
        ")>"
        "$STOP()"
Replace = "
 <HTML>"
          "
 <!-- Original Location: u -->"
          "
 <HEAD>"
          "
 <!-- PING! -->"
          "
 1
2

"




Edited by - TEggHead on 01 Sep 2002  12:20:33
 

altosax

  • Sr. Member
  • ****
  • Posts: 328
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Alternative to <start> Filters
« Reply #10 on: September 01, 2002, 11:33:56 AM »
a new filter to try.
now i understand also your question about <!--ping -->

<edit>:
what the 8 variable do in this line?

"          |</HEAD            $SET(1=9
8
</HEAD>)"


altosax.

Edited by - altosax on 01 Sep 2002  13:56:03
 

TEggHead

  • Jr. Member
  • **
  • Posts: 93
    • ICQ Messenger - 21893433
    • AOL Instant Messenger -
    • Yahoo Instant Messenger - eljarec
    • View Profile
    • Email
Alternative to <start> Filters
« Reply #11 on: September 02, 2002, 12:03:49 AM »
: now i understand also your question about <!--ping -->



<edit>:
what the 8 variable do in this line?

"          |</HEAD            $SET(1=9
8
</HEAD>)"


beats me...probably a leftover from a previous edit...seems as if it can be snuffed without risk...