|
Donation/Premium |
|
 |
|
|
|
|
|
|
|
 |
 |
| View previous topic :: View next topic |
| Author |
Message |
IP: 83.55.*.*
Guest
|
Posted: Tue Feb 05, 2008 2:28 am Post subject: Grypen's filter set suddenly broke flash videos |
|
|
As the title of the post says, I'm unable to play flash videos on some sites when Proxomitron is running. I have been noticing this since maybe a week or so.
If I try to play any video on Youtube or some sites like this, everything I get is this error: "Hello, you either have JavaScript turned off or an old version of Adobe's Flash Player. Get the latest Flash player.". I have that version and is running nicely if I load these pages without Proxomitron enabled. I'm running latest (december 5th) version.
Same happens with either Opera or Firefox. I guess that Proxo + Grypen's filters are the culprit. Otherwise I wouldn't be able to see the videos when they are disabled.
Anyone experiencing the same over here? I can post Proxo's debug pages if anyone wants to check.
Regards and TIA
|
|
| Back to top |
|
 |
z12
Guest IP: 65.41.*.*
|
Posted: Fri Feb 08, 2008 5:14 am Post subject: |
|
|
The root of the problem is that the Toggle Flash filter is trying to match in some rather advanced js.
Surprisingly, the following hacks seem to work for YouTube.
Although, I must admit I don't know what Quick Bypass is supposed to do.
To fix the problem in the Bounds embed match:
| Code: |
|(embed)*>(^ [a-z0-9])(*</embed >|)|
|
To fix the param tag match for matching 'movie':
| Code: |
name=($AV(movie)|\\"movie\\")
|
HTH
|
|
| Back to top |
|
 |
IP: 83.55.*.*
Guest
|
Posted: Sun Feb 10, 2008 7:52 am Post subject: |
|
|
Thanks, z12!
I hard a hard time trying to figure exactly what to modify, but I think I succeed:
| Code: | [Patterns]
Name = "Toggle: Flash {4.d} 20060329 [z12]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Bounds = "<((object)*>(*</object >|)|(embed)*>(^ [a-z0-9])(*</embed >|)|(iframe)*>(*</iframe >|))"
Limit = 4096
Match = "(*(shockwave|macromedia|flash|swf)*)\#"
"&(*(src|classid|codebase|type|pluginspage)=((\\|)('$SET(7=")|("|)$SET(7=')))\0|)"
"&*(\sdata|s(" \+ "|)rc|<par(" \+ "|)am name=($AV(movie)|\\"movie\\") value)=$AV(\2)"
"&((<(embed|object)*>&&*width=$AV(\8)*&&*height=$AV(\9)*)|)"
"&($TST(script=*)$SET(1=\\\7)|$SET(1=\7))"
"&$SET(flash=$GET(flash)$DTM(c))"
Replace = "<span class=\0flash$GET(flash)\0 style=\0display:inline\0>"
""
"<table width=\8 height=\9 cellpadding=0 cellspacing=0 style=\0border-width:2px;border-style:solid;\0>"
"<tr><td align=center>"
""
" <a title=\0Play Flash Media\0 href=\0javascript:PrxToggle(\1flash$GET(flash)\1,\1cl\1,\1yes\1,\1span\1)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/player_play.png\0 border=0></a> "
"<a title=\0Quick Bypass\0 href=\0\u&keyword(.flash.)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/flash.png\0 border=0></a> "
"<a title=\0Save Flash Media\0 href=\0\2\0><img src=\0http://local.ptron/Grypen_HTML/imgs/3floppy_mount.png\0 border=0></a> "
""
""
"</td></tr>"
"</table>"
""
""
""
""
"</span>"
""
"<span class=\0flash$GET(flash)\0 style=\0display:none\0>"
""
"\#"
"<br>"
"<a title=\0Stop Media\0 href=\0javascript:PrxToggle(\1flash$GET(flash)\1,\1cl\1,\1yes\1,\1span\1)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/player_stop.png\0></a>"
""
"</span>" |
Now videos a toggable at Youtube, but for example this flash video is still broken, and disabling the toggle flash filter doesn't fix it.
Is the problem elsewhere?
BTW, I can't believe that people isn't more interested in Proxomitron. Damn! It's the best program EVER!
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Sun Feb 10, 2008 6:16 pm Post subject: |
|
|
| Anonymous wrote: | BTW, I can't believe that people isn't more interested in Proxomitron. Damn! It's the best program EVER!  |
amen to that!!!
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Mon Feb 11, 2008 5:12 am Post subject: |
|
|
I knew that fix wouldn't last long.
The flash on the Opera site is using some fairly common js.
From what you posted, it looks like you made the right changes to the filter.
Howerver, the filter still has issues and is breaking some js.
If the flash doesn't work right bypassed, flush the browser cache to reload the flash script.
So here's round two.
In the Replacement text, deleting:
from the table tag
and deleting
from the "Save Media" anchor tag
will get it working, sort of.
For good measure, I also deleted all occurrences of
in the Replacement text, since the semicolon has the
potential to cause grief when replacing code inside js.
Deleting all of the above causes two problems:
1: Since there is no width attribute for the table tag, it goes to far right.
I don't really see a fix for that other than removing all the table tags (which is what I did).
2: You lose the "Save Media" functionality.
I'm looking at some js to fix that, but the code needs some tweaking yet.
In the meantime, you can try deleting the code above and remove all the
| Code: |
<table><tr><td>
</td></tr></table>
|
tags and give it a try.
If you find someplace where the filter doesn't work after these changes, post a link.
HTH
z12
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Tue Feb 12, 2008 12:51 am Post subject: |
|
|
The good news is I got the "Save Media" functionality working.
The bad news is the filter is still not matching some common flash js.
Here for example, the filter won't match.
http://puzzles.usatoday.com/sudoku/
The js code used there is by adobe, and a lot of sites use it.
The problem is with the matching expression.
Essentially, none of the matches in the first four lines of the matching expression will match.
The only solution that I can see is to remove these checks.
Here is the resulting Match Expression:
| Code: |
\#$SET(flash=$GET(flash)$DTM(c))
($TST(script=*)$SET(1=\\")|$SET(1="))
|
With this, the sudoku puzzle flash example now matches & toggles.
The Filter now also matches here:
http://www.java.com/en/download/help/testvm.xml
which is java, not flash.
On the bright side, "dancing Duke" can still be toggled on & off.
I suppose you could modify the filter to try to not match java.
However, there is still a posibility it could match anyway.
So here is the web filter as it stands now.
| Code: |
[Patterns]
Name = "Toggle: Flash {4.d.1} 20080211 [z12]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Bounds = "<((object)*>(*</object >|)|(embed)*>(^ [a-z0-9])(*</embed >|)|(iframe)*>(*</iframe >|))"
Limit = 4096
Match = "\#$SET(flash=$GET(flash)$DTM(c))"
"($TST(script=*)$SET(1=\\")|$SET(1="))"
Replace = "<span class=\0flash$GET(flash)\0 style=\0display:inline\0>"
"<a title=\0Play Flash Media\0 href=\0javascript:PrxToggle(\1flash$GET(flash)\1,\1cl\1,\1yes\1,\1span\1)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/player_play.png\0 border=0></a>"
"<a title=\0Quick Bypass\0 href=\0\u&keyword(.flash.)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/flash.png\0 border=0></a>"
"<a title=\0Save Flash Media\0 onmouseover=\0PrxTitleFlash(this)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/3floppy_mount.png\0 border=0></a>"
"</span>"
""
"<span class=\0flash$GET(flash)\0 style=\0display:none\0>"
"\#"
"<br>"
"<a title=\0Stop Media\0 href=\0javascript:PrxToggle(\1flash$GET(flash)\1,\1cl\1,\1yes\1,\1span\1)\0><img src=\0http://local.ptron/Grypen_HTML/imgs/player_stop.png\0></a>"
"</span>"
|
Couple of notes:
1. I'm not so sure about leaving the iframe match in the bounds.
2. The images in the replacement text are .png format. Does IE have a problem with those?
3. Perhaps somebody can spruce up the replacement image formatting/display.
Keep in mind there's no reliable way to capture the object/embed tags height & width attributes.
4. Remove the onmouseover attribute for the "Save Flash Media" replacement anchor.
I don't want to post the js to support it till #3 is done.
HTH
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Tue Feb 12, 2008 1:11 pm Post subject: |
|
|
| z12 wrote: | | 2. The images in the replacement text are .png format. Does IE have a problem with those? |
the .png's seem to present no problems for me (IE7 shell)...
unless it's some "intermittent" issue that i simply just haven't bumped into as of yet while test-running the above filter dropped into the Grypen 12/5/07 release...
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Tue Feb 12, 2008 2:03 pm Post subject: |
|
|
Thanks ProxFox.
I remember some issue with IE and png images.
Maybe it was when a png image was served up with an object tag,
instead of an image tag.
I have some notes on that somewhere, but it seems
that there's no need to look for it now.
BTW, I seem to recall that IE loaded the fash file even though
the flash was initially toggled off.
Is that still true?
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Tue Feb 12, 2008 2:37 pm Post subject: |
|
|
| z12 wrote: | BTW, I seem to recall that IE loaded the fash file even though the flash was initially toggled off.
Is that still true? |
unfortunately, YES...
i use your "Object to Img {z12}" filter to correct that nuisance...
| Code: | Name = "Object to Img {z12} [add]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))"
Bounds = "(<object*/ object >|<embed[^<]++>(^ [a-z0-9])( </embed >)+)(^ </object >)(^ </textarea>)"
Limit = 4096
Match = "\#"
"&(*(\" \'|\' \"|\\"|= " \+|" <|> ")$SET(1=\\")|*\s(codebase|type|src)=(")\1)|$SET(1=")"
Replace = "<span>"
"<textarea style=\1display:none\1>\@</textarea>"
"<img"
" style=\1cursor:pointer\1"
" onclick=\1proxo.imgToFlash(this)\1"
" src=\1http://local.ptron/My_HTML/z12_htm/camera.jpg\1"
" onmouseover=\1proxo.titleFlash(this)\1"
" />"
"</span>" |
| Code: | Name = "Header Top Add: User JS Code - z12 Flash [add]"
Active = TRUE
URL = "$TYPE(htm)"
Limit = 16
Match = "(^(^<ProxHdrTop>))$STOP()"
Replace = "\t<script type="text/javascript" src="http://local.ptron/My_HTML/z12_htm/z12.js"></script>\r\n" |
| Code: | if(typeof(proxo)=='undefined'){
proxo = {};
proxo.imgToFlash = function(n){
var pn, sn, fnHTML;
if (typeof n == 'string')n = document.getElementById(n);
pn = n.parentNode; // this is the span element
pn.toff = pn.innerHTML; // this is the toggle off html
fnHTML = n.previousSibling.value; // this is the html inside the textarea node
// alert(fnHTML);
pn.innerHTML = fnHTML; // write the flash object
}
proxo.titleFlash = function(n){
var c, m, fn;
c = n.previousSibling.value; // this is the html inside the textarea node
m=c.match(/<param\s+(?:value\s*=\s*)?([^>]*?)\s*["']*name\s*=\s*["']*(?:movie|src|url)["']*\s+(?:value\s*=\s*)?([^>]*?)\/?>/i);
if(m){
if(m[1])fn=m[1];
else if(m[2])fn=m[2];
}else{
m=c.match(/\s+(?:src|data)\s*=\s*["']*([^\s"'>]+)["']*/i);
if(m){
if(m[1])fn=m[1];
}else{
fn = "file name not found";
}
}
n.title = fn;
n.onmouseover=null;
}
document.prxRealDocWrite = document.write; // save a ref to the real document.write
document.prxDocWrite = function(wstr){
if(!wstr||typeof(wstr)!='string')return document.prxRealDocWrite(wstr); // done, no string to match against
var re =/<object\s+[^>]+>(\s*<(param|\\?\/?embed|\\?\/?object)[^>]*>)+\s*(<\\?\/object>)(?!<\/textarea)/i;
var sr = wstr.replace(re,function(sm){
// this function code executed only if there was a match
// arguments[1] to arguments[arguments.length-3] are inner matches
// [arguments.length -2] is the match index
// [arguments.length -1] is the original string
var origStr = arguments[arguments.length -1];
if (sm.search(/shockwave|clsid:D27CDB6E-AE6D-11cf-96B8-444553540000/i)==-1){
// alert("not a match for flash :\r\n"+origStr);
return origStr; // done, not a match for flash
}
// build the return string
var ns = '<span>';
ns += '<textarea style="display:none">';
ns += wstr.substr(0,arguments[arguments.length -2]) + sm;
ns += wstr.substr(arguments[arguments.length -2]+sm.length+1);
ns += '</textarea>';
ns += '<img style="cursor:pointer"';
ns += ' onclick="proxo.imgToFlash(this)"';
ns += ' onmouseover="proxo.titleFlash(this)"';
ns += ' src="http://local.ptron/My_HTML/z12_htm/flash_rune.gif" />';
ns += '</span>';
// alert(ns);
return ns;
}
);
return document.prxRealDocWrite(sr);
}
// intercept document.write()
document.write = document.prxDocWrite;
} |
Last edited by ProxFox on Tue Feb 12, 2008 4:01 pm, edited 1 time in total |
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Tue Feb 12, 2008 3:22 pm Post subject: |
|
|
| ProxFox wrote: |
unfortunately, YES...
i use your "Object to Img {z12}" filter to correct that nuisance...
|
doh, I guess I haven't posted an update to that filter in quite awhile.
I suppose I should rectify that.
This filter seems to be morphing into a version of that.
However, this filter has the toggle feature already,
which is something I've never integrated into mine.
I'll take a stab at fixing the IE load issue here.
I think I see a way to make it work with the toggle.
hmm...
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Tue Feb 12, 2008 6:18 pm Post subject: |
|
|
| z12 wrote: | However, this filter has the toggle feature already,
which is something I've never integrated into mine. |
the "toggle" doesn't seem that much of a concern, if you ask me...
to me, it's a GODSEND because the flash is not fetched until i tell it to be fetched...
at that point, i wanted it, i got it, why "toggle" it back off?
|
|
| Back to top |
|
 |
Grypen
Major

 Joined: Aug 23, 2004 Posts: 913 Location: Japan
|
Posted: Wed Feb 13, 2008 5:22 pm Post subject: |
|
|
Hi guys, I want to make sure I'm updating these filters correctly (and haven't seen the Object to Img filter either?) so once you are happy, please post the relevant filters here as code and/or JS and I'll incorporate them into my next build.
Sorry I haven't been here more but I have just begun my film production and camera rental company here in Japan and am quite busy!
Cheers!
Paul _________________ Get my current Proxomitron filters and Firefox CSS files here or here.
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Wed Feb 13, 2008 10:37 pm Post subject: |
|
|
Here's one to take out for a spin:
| Code: |
[Patterns]
Name = "Toggle: Object {4.d.2} 20080213 [z12]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Bounds = "<((object)*>(*</object >|)|(embed)*>(^ [a-z0-9])(*</embed >|))"
Limit = 4096
Match = "\0$SET(flash=$GET(flash)$DTM(t))"
"($TST(script=*)$SET(1=\\")|$SET(1="))"
Replace = "<span class=\1flash$GET(flash)\1 style=\1display:inline\1>"
"<a title=\1Play Media\1 onclick=\1PrxObjToggle(this);return false;\1 onmouseover=\1PrxTitleObj(this)\1>"
"<img src=\1http://local.ptron/Grypen_HTML/imgs/player_play.png\1 border=0></a>"
"<a title=\1Quick Bypass\1 href=\1\u&keyword(.flash.)\1>"
"<img src=\1http://local.ptron/Grypen_HTML/imgs/flash.png\1 border=0></a>"
"<a title=\1Save Media\1 onmouseover=\1PrxTitleObj(this)\1>"
"<img src=\1http://local.ptron/Grypen_HTML/imgs/3floppy_mount.png\1 border=0></a>"
"</span>"
""
"<span class=\1flash$GET(flash)\1 style=\1display:none\1>"
"<textarea style=\1display:none\1>\0</textarea>"
""
"<br>"
"<a title=\1Stop Media\1 onclick=\1PrxObjToggle(this);return false;\1>"
"<img src=\1http://local.ptron/Grypen_HTML/imgs/player_stop.png\1></a>"
"</span>"
|
Here's the js that needs to be inserted in PrxFunctions js:
| Code: |
// ====================================
// toggle object - z12
// modified for Grypen's fiter set
// ====================================
function PrxObjToggle(n) {
var pn = n.parentNode;
var stopNode = (pn.firstChild.nodeName == "A") ? pn.nextSibling : pn;
if (stopNode && stopNode.firstChild.nodeName == "TEXTAREA"){
var fnHTML = stopNode.firstChild.value; // this is the html inside the textarea node
stopNode.removeChild(stopNode.firstChild); // delete the textarea node
fnHTML += stopNode.innerHTML; // get the remaining proxo html
stopNode.innerHTML = fnHTML; // replace the hidden span's inner html
}
var playNode = (pn == stopNode) ? stopNode.previousSibling : pn;
if (pn == stopNode){
stopNode.style.display = 'none';
playNode.style.display = 'inline';
}
else {
playNode.style.display = 'none';
stopNode.style.display = 'inline';
}
}
function PrxTitleObj(n) {
n.onmouseover = null;
var playNode = n.parentNode;
var stopNode = playNode.nextSibling;
var mt = '';
var fn = 'file name not found';
var ot = stopNode.firstChild.value; // the html inside the textarea node
// look for the file name in the object or embed tag
mt = ot.match(/<(?:object|embed)(?:[^>]+)(?:\s+(?:src|data|code)\s*=\s*["']*([^\s"'>]+)["']*)/i);
if (mt && mt[1]) {
fn = mt[1];
} else {
// look for the file name in the parameter tag. hmm... might only need to match "movie" for flash.
mt = ot.match(/<param(?:\s?(?:\s+value\s*=\s*["']*([^\s"'>]+)["']*)|(?:\s+name\s*=\s*["']*(?:movie|src|FileName|code|url)["']*)){2}\s*\/?>/i);
if (mt && mt[1]) {
fn = mt[1];
}
}
var a_Play = playNode.childNodes[0];
a_Play.onmouseover = null;
a_Play.Name = '#Play='+fn;
a_Play.href = a_Play.Name;
var a_Bypass = playNode.childNodes[1];
a_Bypass.onmouseover = null;
var a_Save = playNode.childNodes[2];
a_Save.onmouseover = null;
a_Save.title = fn;
a_Save.href = fn;
var a_Stop = stopNode.childNodes[2];
a_Stop.onmouseover = null;
a_Stop.Name = '#Stop='+fn;
a_Stop.href = a_Stop.Name;
}
|
I put it right above this:
| Code: |
// ====================================
// Toggle Function | Required for various filters - Sidki3003, JD5000
// ====================================
|
This filter doesn't load the object code till you play it.
Even with IE.
I'm sure further tweaks will be needed, most likely to the bounds.
Changes to the replacement text, may require some js modifications.
For testing, you might want to disable the Toggle filters:
Toggle: Java
Toggle: Flash
Toggle: Embeded Movies
as this filter should catch those also.
The filter should work in any filter set, as long as the replacement image
attributes are set correctly.
z12
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Wed Feb 13, 2008 10:54 pm Post subject: |
|
|
Before anyone posts it, I know the above filter doesn't work at google video, at least not with Firefox. Probably not with Opera either, maybe IE though.
As far as I can tell, google video will need its own filter.
Paul, good to hear things are going well for you in Japan.
The filter I posted above needs a bit more work before it's ready for general release.
For sure, one thing that needs to be looked at is the bypass and the url keyword check.
It would be nice if someone could format the replacement images better.
But without having the width & height attributes always available, I can't figure it out.
Also, using a table will make the js a bit uglier.
z12
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Fri Feb 15, 2008 4:50 pm Post subject: |
|
|
I've been playing around with this filter.
I've modified the bounds & matching exppresion to what I
currently use.
I'm down to one button, which toggles the player on & off.
The "toggle" button's image changes to the stop or play image.
I set the href of the "toggle" button to the file name.
This eliminates need for a "Save Media" button.
If you want to save the file, right click on the "toggle"
button and "Save Link As".
The "Quick Bypass" button seems useless, so I removed it.
It seems to me that if you want to play the file, toggle it on.
If you always want the file to play, add it to an include/exclude list.
Or am I missing something here?
Personally, I think I would prefer the "toggle" button to always appear
above the player. I find it somewhat unsettling that the button "appears"
to move around after you click it.
I'll wait for comments before posting any code revisions.
z12
|
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001 phpBB Group
|