Post Reply 
Flash at YouTube
Aug. 29, 2010, 01:23 PM
Post: #6
RE: Flash at YouTube
I agree that it would be more comfortable to have the Flash filter always matching. However, i have to weigh the pros and cons. From the coding perspective, we are dealing with a generic filter, which is supposed to work *quickly* and should be resistant to code changes.

Below are modified filters, the first one for the release config, the other for alpha4. They are just a proof of concept, and i'm not comfortable with them, due to the compromises solely implemented for YouTube.

Code:
[Patterns]
Name = "<object>...: Toggle Flash     10.08.29 (ccw! !nn) [jd sd] (o.2 l.2) POC-RL"
Active = FALSE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.(a_flash|a_code|i_level:1).*)|$TST(hOrigUA=mozilla/4.[1-9](^*opera)*))"
Limit = 10000
Match = "<(\" \+ \"o|\' \+ \'o|o)b(" \+ ')+j(" \+ ')+ect(\s|"|\\n|>)(("
        "(*<)\0(/embe(d)\4 >(^(^ </(^object)))|(" \+ ')+(\\+/)\4ob(" \+ ')+j(" \+ ')+ect[^>]+>)"
        "(^$TST(\0=*<object*))$SET(#=$SET(tObject=))"
        "&&*(s(hockwave|wf)|flash(.|_|vars)|d27cdb6e-|obj(Attrs|Str)|.push\(" >)*"
        ")|(*>&&*(s(hockwave|wf)|d27cdb6e-)*))"
        ""
        "|<(\" \+ \"e|\' \+ \'e|e)mbed(\s[^/]|"|\\n)(^$TST(tObject=1))"
        "(*>(^ [0-9=])&&*(s(hockwave|wf)|flash|embedAttrs|.push\(" /(^(^>)))(>|*[^-]>)(^?))"
        "((*<)\0(\\+/)\4embed >(^$TST(\0=*<(embe(d)\5|/script)*))|)(^$TST(\5=*)&$TST(script=*))"
        ""
        "&&(^$TST(comment=1)|$TST(tNoscript=1)|$TST(tNoframes=1)|*function\s[^()"'; ]+ \()*"
        "&$SET(2= style=\1)<(("
        "*>&&*width(=(\\+("|\&quot;)+{0,1})\1| : "+)( ([#*:*]%+)\8|")*"
        "&&*height(=\\+("|\&quot;)+| : "+)( ([#*:*]%+)\9|")*"
        ")|)"
        ""
        "&<((" \+ ')+ob(" \+ ')+j(" \+ ')+ect)\0"
        "("
        "$TST(\4=/(^$TST(script=[1s]*))|d$SET(4=/object></))$SET(7=span)$SET(#=\1><\0)(\#&$SET(#=</span>))"
        "|$SET(7=\0)(([^>]++\sstyle=\\+("|\&quot;)+{0,1})\2(([^"'\\&]++)\#display : [a-z-]+;+)+|$SET(#=\1))"
        "(\#))"
        "|<((" \+ ')+embed)\0$SET(7=span)$SET(#=\1><\0)(\#&$SET(#=</span>))"
        ""
        "&$SET(4=$TST(hOrigUA=*msie(^*opera)*)(function(a,b){"
        "while(b.firstChild&&!b.Movie&&!b.SRC&&!b.src)b=b.firstChild;"
        "while(b.nextSibling&&!b.Movie&&!b.SRC&&!b.src)b=b.nextSibling;"
        "b.rmov=b.Movie||b.SRC||b.src;"
        "if(b.ReadyState!=4)b.Movie?b.Movie=a.alt:b.SRC?b.SRC=a.alt:b.src=a.alt;"
        "})(this,this.parentNode.nextSibling);)"
        "($TST(script=1*)(*</script)+{1,*}(^*<script)$SET(script=)|)$SET(3=$TST(script=[1s]*)JS)"
        "("
        "$TST(script=*)($TST(\1=\")$SET(1=\\x22)|$TST(\1=\')$SET(1=\\x27))"
        "|(^$TST(script=*))(^$TST(\1="))$SET(1=")"
        "|)"
        "($TST(displayM=none)$SET(5=inline)|$SET(5=none))"
        "($TST(tAnc=1*|j)$SET(tAnc=)$SET(6=</a>)|$TST(script=*)$SET(6=<a></a>)|)"
        "($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tWEB Flash\t\0 \3 \t\u)|)"
Replace = "\6<span class=\1ProxFlash&#x20;ProxToggle\1 style=\1display:\5\1>"
          "<img class=\1ProxBcn-Img\1 alt=\1about:blank\1 src=\1http://local.ptron/killed.gif\1"
          " onload=\1prxO.oiFlash=!prxO.oiFlash?1:++prxO.oiFlash;\4prxO.oInt.inGetFlash(this);\1 />"
          "<a class=\1ProxToggle&#x20;ProxTogO-A\1 href=\1javascript://\1"
          " onclick=\1prxO.oInt.inToggleD(this.parentNode,true);prxO.oInt.inStopEv(event);\1"
          " title=\1\0&#160;\3&#160;\8x\9\1 target=\1_self\1>Toggle</a>"
          "<a class=\1ProxToggle&#x20;ProxTogO-A\1 href=\1about:blank\1"
          " title=\1Direct&#160;Link\1 target=\1_top\1>Flash</a>"
          " </span><\7 class=\1ProxFlash\1\2display:$GET(displayM)\;\@"

Code:
[Patterns]
Name = "<object>...: Toggle Flash     10.08.28 (ccw! !nn) [jd sd] (o.2 l.2) POC-A4"
Active = FALSE
URL = "($TST(hCT=*html)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.(a_flash|a_code|i_level:1).*)|$TST(hOrigUA=mozilla/4.[1-9](^*opera)*))"
Limit = 10000
Match = "<(\" \+ \"o|\' \+ \'o|o)b(" \+ ')+j(" \+ ')+ect(\s|"|\\n|>)(("
        "(*<)\0("
        "/embe(d)\4 >(^(^ </(^object)))|(" \+ ')+(\\+/)\4(" \+ ')+ob(" \+ ')+j(" \+ ')+ec(" \+ ')+t(*>)+{1}"
        ")"
        "(^$TST(\0=*<object*))$SET(#=$SET(tObject=))"
        "&&*(s(hockwave|wf)|flash(.|_|id|vars)|d27cdb6e-|obj(Attrs|Str)|.push\(" >)*"
        ")|(*>&&*(s(hockwave|wf)|d27cdb6e-)*))"
        ""
        "|<(\" \+ \"e|\' \+ \'e|e)mbed(\s[^/]|"|\\n)(^$TST(tObject=1))"
        "(*>(^ [0-9=])&&*(s(hockwave|wf)|flash|embedAttrs|.push\(" /(^(^>)))(>|*[^-]>)(^?))"
        "((*<)\0(\\+/)\4embed >(^$TST(\0=*<(objec(t)\5|embe(d)\5|/script)*))|)(^$TST(\5=d)&$TST(script=*))"
        ""
        "&&(^$TST(comment=1)|$TST(tNoscript=1)|$TST(tNoframes=1)|*function\s[^()"'; ]+ \()*"
        "&$SET(2= style=\1)<(*>&&("
        "*width(=(\\+("|\&quot;)+{0,1})\1| : "+)( ([#*:*]%+)\8|")*"
        "&&*height(=\\+("|\&quot;)+| : "+)( ([#*:*]%+)\9|")*"
        ")|*&&(*\s(classid|data|id|type)=(\\+("|\&quot;))\1)+{0,1}*)"
        ""
        "&<((" \+ ')+ob(" \+ ')+j(" \+ ')+ect)\0"
        "("
        "$TST(\4=/|d$SET(4=/object></))$SET(7=span)$SET(#=\1><\0)(\#&$SET(#=</span>))"
        "|$SET(7=\0)(("
        "([^>]++\sstyle=)\4$AVQ(\\+("|\&quot;)+{0,1}(\#display : [a-z-]+;+)+\#)"
        "&&($TST(\4)\\+("|\&quot;)+{0,1})\2*"
        ")|$SET(#=\1))(\#)"
        ")"
        "|<((" \+ ')+embed)\0$SET(7=span)$SET(#=\1><\0)(\#&$SET(#=</span>))"
        ""
        "&$SET(4=$TST(hOrigUA=*msie(^*opera)*)(function(a,b){"
        "while(b.firstChild&&!b.Movie&&!b.SRC&&!b.src)b=b.firstChild;"
        "while(b.nextSibling&&!b.Movie&&!b.SRC&&!b.src)b=b.nextSibling;"
        "b.rmov=b.Movie||b.SRC||b.src;"
        "if(b.ReadyState!=4)b.Movie?b.Movie=a.alt:b.SRC?b.SRC=a.alt:b.src=a.alt;"
        "})(this,this.parentNode.nextSibling);)"
        ""
        "($TST(script=1*)(*</script)+{1,*}(^*<script)$SET(script=)"
        "|$TST(script=*)($TST(\1=\")$SET(1=\\x22)|$TST(\1=\')$SET(1=\\x27))"
        "|(^$TST(script=*))(^$TST(\1=*))$SET(1=")"
        "|)$SET(3=$TST(script=[1s]*)JS)"
        "($TST(displayM=none)$SET(5=inline)|$SET(5=none))"
        "($TST(tAnc=1*|j)$SET(tAnc=)$SET(6=</a>)|$TST(script=*)$SET(6=<a></a>)|)"
        "($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tWEB Flash\t\0 \3 \t\u)|)"
Replace = "\6<span class=\1Pr0xFlash&#x20;Pr0xToggle\1 style=\1display:\5\1>"
          "<img class=\1Pr0xBcn-Img\1 alt=\1about:blank\1 src=\1http://local.ptron/killed.gif\1"
          " onload=\1prxO.oiFlash=!prxO.oiFlash?1:++prxO.oiFlash;\4prxO.oInt.inGetFlash(this);\1$GET(mType)>"
          "<a class=\1Pr0xToggle&#x20;Pr0xTogO-A\1 href=\1javascript://\1"
          " onclick=\1prxO.oInt.inToggleD(this.parentNode,true);prxO.oInt.inStopEv(event);\1"
          " title=\1\0&#160;\3&#160;\8x\9\1 target=\1_self\1>Toggle</a>"
          "<a class=\1Pr0xToggle&#x20;Pr0xTogO-A\1 href=\1about:blank\1"
          " title=\1Direct&#160;Link\1 target=\1_top\1>Flash</a>"
          " </span><\7 class=\1Pr0xFlash\1\2display:$GET(displayM)\;\@"

The best idea is probably that someone writes a site-specific filter (which might need to be updated regularly).
If i understood the code correctly:
- The object/embed tags for standard compliant browsers are in the inline script.

- The fallback code currently is in http://s.ytimg.com/yt/jsbin/www-core-vfl186132.js
-> object code for IE 6/7/8
-> embed code for other browsers

Test link: http://www.youtube.com/watch?v=zlfKdbWwruY
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Flash at YouTube - wammie - Aug. 28, 2010, 03:23 AM
RE: Flash at YouTube - sidki3003 - Aug. 28, 2010, 11:22 AM
RE: Flash at YouTube - wammie - Aug. 28, 2010, 01:31 PM
RE: Flash at YouTube - sidki3003 - Aug. 29, 2010 01:23 PM
RE: Flash at YouTube - wammie - Aug. 29, 2010, 05:33 PM
RE: Flash at YouTube - JJoe - Aug. 29, 2010, 10:28 PM
RE: Flash at YouTube - wammie - Sep. 01, 2010, 02:40 AM
RE: Flash at YouTube - ProxRocks - Aug. 29, 2010, 06:22 PM
RE: Flash at YouTube - Toppy - Aug. 30, 2010, 11:41 AM
RE: Flash at YouTube - wammie - Sep. 23, 2010, 07:29 PM
RE: Flash at YouTube - ProxRocks - Sep. 23, 2010, 07:32 PM
RE: Flash at YouTube - wammie - Sep. 29, 2010, 02:28 AM
RE: Flash at YouTube - wammie - Sep. 29, 2010, 02:39 AM
RE: Flash at YouTube - wammie - Sep. 29, 2010, 03:00 AM
RE: Flash at YouTube - JJoe - Sep. 29, 2010, 05:07 AM
RE: Flash at YouTube - wammie - Sep. 29, 2010, 10:59 PM
RE: Flash at YouTube - JJoe - Sep. 30, 2010, 12:45 AM
RE: Flash at YouTube - wammie - Sep. 30, 2010, 03:27 AM
RE: Flash at YouTube - wammie - Oct. 15, 2010, 04:17 AM
RE: Flash at YouTube - JJoe - Oct. 16, 2010, 04:53 AM
RE: http://www.cnn.com/TECH/ - wammie - Aug. 28, 2010, 03:42 AM
RE: http://www.cnn.com/TECH/ - sidki3003 - Aug. 28, 2010, 11:30 AM

Forum Jump: