|
Donation/Premium |
|
 |
|
|
|
|
|
|
|
 |
 |
| View previous topic :: View next topic |
| Author |
Message |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Fri Feb 15, 2008 6:35 pm Post subject: |
|
|
my comment would be, "cool, i find it annoying to have a 'quick bypass' and a 'save as' button"...
my preference indeed is to have one to toggle on, another to toggle off...
i wouldn't mind having your current version, when you feel it's ready for posting 
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Fri Feb 15, 2008 9:20 pm Post subject: |
|
|
ProxFox, your in luck.
Take this filter out for a test drive.
| Code: |
[Patterns]
Name = "Toggle: Object {4.d.3} 20080215 [z12]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Limit = 4096
Match = "("
"("
"$NEST(<object(\s|"),"+</object >)|"
"<object(^[a-z])(*/ object >&&(^*<object)*)|"
"<embed(^[a-z])*>(^ [a-z0-9])( </embed >)+"
")\0(^ </object >)(^ </textarea>)"
"&&"
"(^*(type=$AV(image/*)))"
"*)"
"$SET(flash=$GET(flash)$DTM(t))"
"(($TST(script=*))$SET(1=\\")$SET(2=\\)|$SET(1=")$SET(2=))"
Replace = "<span class=\1flash$GET(flash)\1 style=\1display:none\1>"
"<textarea style=\1display:none\1>\0<\2/textarea>"
"<br>"
"<\2/span>"
"<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><\2/a>"
"<\2/span>"
|
For the image toggle to work right, the js wants the images to be named
"player_play"
"player_stop"
which is what Grypen's Filter set calls them. Given that, as long as the
images are somewhere in local.ptron, the js doesn't care.
Here's the js:
| Code: |
// ====================================
// toggle object - z12
// modified for Grypen's fiter set
// ====================================
function PrxObjToggle(n) {
var player_Node = n.parentNode.previousSibling;
if (player_Node && player_Node.firstChild.nodeName == "TEXTAREA"){
var fnHTML = player_Node.firstChild.value; // this is the html inside the textarea node
player_Node.removeChild(player_Node.firstChild); // delete the textarea node
fnHTML += player_Node.innerHTML; // get the remaining proxo html
player_Node.innerHTML = fnHTML; // replace the hidden span's inner html
}
var a_toggle = n;
var img = a_toggle.firstChild.src.split(/\/player_[^.]+/i);
if (player_Node.style.display != "inline"){
player_Node.style.display = 'inline';
a_toggle.title = "Stop Media";
a_toggle.firstChild.src = img[0] + '/player_stop' + img[1];
}
else {
player_Node.style.display = 'none';
a_toggle.title = "Play Media";
a_toggle.firstChild.src = img[0] + '/player_play' + img[1];
}
return false;
}
function PrxTitleObj(n) {
n.onmouseover = null;
var button_Node = n.parentNode;
var player_Node = button_Node.previousSibling;
var mt = '';
var fn = 'file name not found';
var ot = player_Node.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_toggle = button_Node.childNodes[0];
a_toggle.onmouseover = null;
a_toggle.href = fn;
}
|
If you want the toggle button always on top:
1. reverse the spans in the replacment text.
The <br> should always close the first span.
2. In the js, change the player_node variable
in both functions to this:
| Code: |
var player_Node = button_Node.nextSibling;
|
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Fri Feb 15, 2008 10:19 pm Post subject: |
|
|
works like a charm, many thanks...
i'll report back if i stumble upon anything it misses or whatnot...
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Sat Feb 16, 2008 1:20 am Post subject: |
|
|
Alright, thanks
z12
|
|
| Back to top |
|
 |
Grypen
Major

 Joined: Aug 23, 2004 Posts: 913 Location: Japan
|
Posted: Mon Feb 18, 2008 12:13 pm Post subject: |
|
|
I'll keep an eye on how it goes for you ProxFox and if you have no issues I'll take it for a test drive when I have some time.
Cheers all!
Paul _________________ Get my current Proxomitron filters and Firefox CSS files here or here.
|
|
| Back to top |
|
 |
GuyScharf
Cadet

 Joined: Nov 14, 2007 Posts: 4 Location: USA
|
Posted: Wed Mar 05, 2008 4:11 am Post subject: |
|
|
I have the same problems and would like to try the suggested code. However, I have not modified Proxomitron's files before and am uncertain exactly where to place this code. Does the piece beginning with [Patterns] go at the beginning of that same-named section in default.cfg, or does it replace something, or does it go somewhere else? Where are the functions to be placed?
Thanks.
Guy
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Thu Mar 06, 2008 11:17 am Post subject: |
|
|
| GuyScharf wrote: |
Where are the functions to be placed?
|
Copy the JavaScript code.
With widows Explorer, browse to where Proxomitron is installed.
Open the "html" folder, then open the "Grypen_HTML" folder.
Select the "PrxFunctions.js" file, right click then "Edit".
Scroll down to here:
| Code: |
// ====================================
// Toggle Function | Required for various filters - Sidki3003, JD5000
// ====================================
|
Paste the js on a blank line above this.
Save the file then close it.
Note: You may have to force the browser to reload the modified script file.
Shift+Reload (or refresh) should do it. Worst case, clear the browser cache.
| GuyScharf wrote: |
Does the piece beginning with [Patterns] go at the beginning of that same-named section in default.cfg, or does it replace something, or does it go somewhere else?
|
Copy the web filter "pattern" code.
Open Proxomitron, click the "Web page" filters button.
Scroll down to this:
| Code: |
========== APPLETS & OBJECTS ==========
|
Select the first filter in this section.
Right click, then "Import filters from clipboard".
If all went well, the new filter will appear (in red).
Uncheck the other "Toggle:" filters in this section.
Click the "Apply" button.
Go surfing.
If your satisfied that all is working well, save the config.
HTH
z12
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Thu Mar 06, 2008 12:43 pm Post subject: |
|
|
While checking out a flash mentioned here:
/p1062626-Blocking_ads_in_flash_video.html#1062626
I noticed the file name wasn't found.
To fix this, change the this js:
| Code: |
// look for the file name in the object or embed tag
mt = ot.match(/<(?:object|embed)(?:[^>]+)(?:\s+(?:src|data|code)\s*=\s*["']*([^\s"'>]+)["']*)/i);
|
to this:
| Code: |
// look for the file name in the object or embed tag
mt = ot.match(/<(?:object|embed)(?:[^>]*)(?:\s+(?:src|data|code)\s*=\s*["']*([^\s"'>]+)["']*)/i);
|
in a nut shell:
| Code: |
(?:[^>]+) changes to (?:[^>]*)
|
a change of one character.
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Thu Mar 06, 2008 1:40 pm Post subject: |
|
|
good catch... thanks for the update...
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Thu Mar 06, 2008 2:56 pm Post subject: |
|
|
I've made a couple of minor tweaks to the replacement code for XHTML compatibility.
The br and img tags were changed:
| Code: |
[Patterns]
Name = "Toggle: Object {4.d.3.1} 20080306 [z12]"
Active = TRUE
URL = "($TYPE(htm)|$TYPE(js)|$TYPE(vbs))(^$TST(keyword=*.flash.*))"
Limit = 4096
Match = "("
"("
"$NEST(<object(\s|"),"+</object >)|"
"<object(^[a-z])(*/ object >&&(^*<object)*)|"
"<embed(^[a-z])*>(^ [a-z0-9])( </embed >)+"
")\0(^ </object >)(^ </textarea>)"
"&&"
"(^*(type=$AV(image/*)))"
"*)"
"$SET(flash=$GET(flash)$DTM(t))"
"(($TST(script=*))$SET(1=\\")$SET(2=\\)|$SET(1=")$SET(2=))"
Replace = "<span class=\1flash$GET(flash)\1 style=\1display:none\1>"
"<textarea style=\1display:none\1>\0<\2/textarea>"
"<br />"
"<\2/span>"
"<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 alt=\1Toggle Media\1 src=\1http://local.ptron/Grypen_HTML/imgs/player_play.png\1 style=\1border-style:none\1 /><\2/a>"
"<\2/span>"
|
If you don't filter XHTML, no big deal.
As a side note, a few days ago I came across a site that had an issue. After toggling the player on, the "Stop Player" button wasn't visible.
I didn't have time to really look into it, but with the dom inspector, I was able to verify the image was there and display it.
When the "Stop Player" image was visible, the flash became partially obscured.
I made a mental note of the site (mistake), but now I can't remember what site it was.
Anyway, it's something to watch for.
z12
|
|
| Back to top |
|
 |
ProxFox
Proxomitron Host

 Joined: Nov 11, 2003 Posts: 940 Location: USA
|
Posted: Thu Mar 06, 2008 3:54 pm Post subject: |
|
|
er, i'm not sure if i'm filtering XHTML or not, but will certainly keep an eye open for any stop-player anomalies...
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Thu Mar 06, 2008 5:33 pm Post subject: |
|
|
| ProxFox wrote: |
er, i'm not sure if i'm filtering XHTML or not,
|
If you go here with Firefox, http://www.w3.org/ they serve up:
| Code: |
Content-Type: application/xhtml+xml; charset=utf-8;
|
Which by default, proxo won't filter.
I use a header filter to force filtering, $FILTER(true).
Another approach, and probably saner, is to use a header filter to change the Content-Type to "text/html".
Xhtml is not very common. I don't think IE does XHTML.
At any rate, the code changes work fine with html also.
z12
|
|
| Back to top |
|
 |
Scoop
Sergeant

 Joined: Jun 03, 2003 Posts: 148
|
Posted: Sun Mar 09, 2008 10:20 pm Post subject: |
|
|
Great work guys however I have tried installing these filters a couple of time now with some success. They install correctly but I find it slows down browsing for some reason. Also having to click the view button every time you want to view a clip can be rather annoying, would be great if it was like the old days where you went to site and the video or clip would load up without the prompt. If there is a bypass any chance of including it in the filter?? For instance when on you tube you view a clip then click for next clip you have to push blue button and again for next clip. Hope this makes sense guys. _________________ Kind Regards
Scoop
|
|
| Back to top |
|
 |
GuyScharf
Cadet

 Joined: Nov 14, 2007 Posts: 4 Location: USA
|
Posted: Mon Mar 10, 2008 12:06 am Post subject: |
|
|
I installed the changes and it seems to fix most of the problems. However, videos on CNN are completely broken, much like they were before the Dec release. If I open a page that contains a video, I get a message that there was a timeout loading the video, and there is no blue button. If I go to the page containing all videos (top right link on home page), then nothing loads.
Since I use Firefox, I am now testing AdBlock Plus as an alternative to Proxo. As expected, it's a bit of a tradeoff but I'm probably doing better with ABP rather than Proxo.
Guy
|
|
| Back to top |
|
 |
z12
Captain

 Joined: Jul 17, 2002 Posts: 385 Location: USA
|
Posted: Mon Mar 10, 2008 11:17 am Post subject: |
|
|
| GuyScharf wrote: |
If I open a page that contains a video, I get a message that there was a timeout loading the video, and there is no blue button.
|
I see the button, it's on the bottom left of the page.
However, the timeout is still an issue.
| Scoop wrote: |
Also having to click the view button every time you want to view a clip can be rather annoying, would be great if it was like the old days where you went to site and the video or clip would load up without the prompt. If there is a bypass any chance of including it in the filter?? For instance when on you tube you view a clip then click for next clip you have to push blue button and again for next clip.
|
Since both sites mentioned are flash sites, perhaps the best solution is to exclude the filter from matching.
Currently, you can do so by using:
for youtube, exclude s.ytimg.com
for cnn, exclude i.cdn.turner.com
The only other way I can think of to "fix" these sites would be to default to "toggled on".
This way, the source file, whatever it is, would always be downloaded and executed.
Thats probably doable, but not with this filter.
In the end, I guess it's just another trade-off.
The cnn page also has a problem with one of the Stop buttons becoming hidden.
Putting the toggle button on top fixed this.
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
|