Author Topic: onLoad by choice  (Read 2295 times)

Boolean

  • Newbie
  • *
  • Posts: 2
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
onLoad by choice
« on: February 07, 2002, 08:30:03 PM »
Hi there! I've just discovered this place, and it's really great to see that there exists an active Proxomitron forum.  I look forward to hanging around.

As an initiation rite, allow me to offer a filter I use.  There are some sites where it is preferable to let the onLoad function do its thing, so I made the filter below.  It takes the onLoad attribute from the <body> tag and sticks it in a bright red button, so you can see what the web page wanted to do, and optionally even let it go ahead.  I use it under Mozilla; I don't know how well it'll work elsewhere.

Keep well!


Name = "<body> Onload mover"
Active = TRUE
Bounds = "<bodys*>"
Limit = 2000
Match = "#(onload="2')1#"
Replace = "@"
          "<button style="border:none;background:red;text-align:center;width:100%;" onclick="2">1</button><BR>"


 
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
onLoad by choice
« Reply #1 on: February 08, 2002, 05:42:32 AM »
Welcome to the forum Boolean!

Good filter, and it works under Opera 6 as well

Praeterea censeo Americe esse delendam.
 

xartica

  • Newbie
  • *
  • Posts: 38
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
onLoad by choice
« Reply #2 on: February 08, 2002, 06:58:30 AM »
quote:

Match = "#(onload="2')1#"



Nice use of the SmartQuotes, but what if there are NO quotes?

It's not well-formed HTML, but MSIE 5.5 would parse the following
just fine (and the onLoad code would elude the filter):

<html>
<body onload=alert(document.location)>
text here
</body>
</html>

Don't get me wrong ~~ I absolutely LOVE you filter idea. I would just hesitate to put it in place unless it's 100% reliable... and I'm not slick enough
(at least not at 12:40am) to figure out how to handle the above scenario.
niether $AV nor $AVQ would owrk, eh?
    ???
Match = "#((onload='|onload=)2&&('|))1#"

What I ESPECIALLY like about your filter is that it can be INTERACTIVE, rather that all-or-nothing. I think I'd expand the replacement to include a confirm,
ala:

Replace = "@"
  "<button style="border:none;background:red;text-align:center;width:100%;"
  "onclick="confirm('Prox trapped an onLoad event\nWanna run it?')"
  " 2">1</button><BR>"

...except I would ALSO try to use the 2 string twice ~~ DISPLAYING it in the confirm dialog as well as injecting it as javascript code to be executed.

Whaddya think?
 

Boolean

  • Newbie
  • *
  • Posts: 2
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
onLoad by choice
« Reply #3 on: February 15, 2002, 07:24:01 AM »
To address your second issue first, I think that's a matter of taste.  Personally, I think a big red button is enough interactiveness, and won't add the confirmation dialog to the filter I use.  But whatever floats your boat.

As for the first issue... under Mozilla, I can't foresee it being a problem, but I'll try playing with it some time and I'll get back to you.

Oh, and for the record, Proxomitron works wonderfully under Wine/Linux, as long as you don't play with the dialog boxes too often in a short time. (: