Old Proxomitron Forums

Proxomitron Filters - Discussions welcome => Other => Topic started by: Admin on July 31, 2001, 11:40:49 AM

Title: Allow right mouse click II
Post by: Admin on July 31, 2001, 11:40:49 AM
http://arne.jaha.dk/download.php/1,15,5/id34.zip
Hi all,

I came across a site the other day with another tricky way of
stopping the right mouse button from working. I suspect this may be
an IE "feature". Anyway, here's a filter to fix it.

[Patterns]
Name = "Allow Right Click 2"
Active = TRUE
Bounds = "<body*>"
Limit = 256
Match = "1oncontextmenu=2"
Replace = "1Prx_offcontextmenu=2"

Regards,
Michael

With regards from
Admin
Title: Allow right mouse click II
Post by: Arne on June 08, 2002, 12:35:49 PM
A site to test it on is here:
http://www.ncsx.org/2002/ncs060302/ncs0603.htm

And I find that modyfying the orginal filter to this one does the same trick: (new is in red)

[Patterns]
Name = "Allow right mouse click"
Active = TRUE
Limit = 256
Match = ".(document.oncontextmenu|onmousedown=|captureEvents()1"
Replace = ".PrxOff_1"

Best wishes
Arne
Imici username: Arne
Title: Allow right mouse click II
Post by: sidki3003 on June 08, 2002, 12:41:22 PM
For those using Paul Rupe's Tame start/end JS:
These functions are already nullified in end.js.

edit:
That doesn't mean Tame JS is the all in one solution for everyone.
It can be too restrictive at times, and modifying the scripts is more difficult then switching of a filter

Edited by - sidki3003 on 08 Jun 2002  14:03:35
Title: Allow right mouse click II
Post by: Arne on June 08, 2002, 01:12:00 PM
Yes, I have that filterset here in my default.cfg, but it is turned off. I was sitting here trying to remember why I turned it off in the first place, but could not really remember. When you mention it, I seem to remember that this was the exact reason. It killed a few things I wanted to preserve. But there is much to be learned in Paul's filterset which in fact is really good. So people should download it, try it out and have a look at the good coding in it.

Best wishes
Arne
Imici username: Arne
Title: Allow right mouse click II
Post by: sidki3003 on June 08, 2002, 01:35:16 PM
I had a hard time with these scripts recently to get some things back
e.g. popup bookmarklets, menues depending on timers, and a few more
But finally it worked and it's fun too

Here is Paul Rupe's proxo page again:
http://www.geocities.com/u82011729/prox/


 
Title: Allow right mouse click II
Post by: altosax on June 08, 2002, 06:28:04 PM
hi sidki and arne,

this to let you know that in my filter set i have a different approach to tame javascript: i've simply realized 2 tame javascript [vm version] and 2 file, vmstart.js and vmend.js INCLUDING FILTERS in them, not simply js code.
this way you can easily recognize what you need and what you can delete. this also allows user to add new code from his own filters. these files also are really simply to maintain.

as usual, you can find my filter set at:
http://virgolamobile.50megs.com/proxomitron.html

read also vmstart.txt in html folder.

regards,
altosax.

 
Title: Allow right mouse click II
Post by: sidki3003 on June 08, 2002, 06:55:06 PM
Hi altosax,

I tried your config recently and liked it
As you saw with the mimefix list (the content-header thread),
i adopted some of your ideas.

From your vmstart.js i'm using your faked functions idea.
So i'm also trying to simplify Paul's scripts,
and they look quite different by now

regards, sidki


 
Title: Allow right mouse click II
Post by: Arne on June 08, 2002, 06:57:01 PM
Nice! Now I have something more to read tonight. I love to read what you guys have made. It gives so many ideas and the opportunity to learn more and to see things I have missed. Thanks!

Best wishes
Arne
Imici username: Arne
Title: Allow right mouse click II
Post by: Jor on June 08, 2002, 08:01:05 PM
quote:

For those using Paul Rupe's Tame start/end JS:
These functions are already nullified in end.js.

edit:
That doesn't mean Tame JS is the all in one solution for everyone.
It can be too restrictive at times, and modifying the scripts is more difficult then switching of a filter


Paul Rupe is very helpful with these filters tho

I have emailed him several times, and have modified my version of start.js a bit, to allow certain functions (and disable others he does not include). I prefer using as little files as possible -- hence I put all the JS which is to be used always in start.js (or end.js), and all my user CSS which should always be used in prox.css.

 
Title: Allow right mouse click II
Post by: lnminente on August 12, 2002, 06:10:22 PM
Another filter:

Name = "Allow Right Click 3"
Active = FALSE
URL = "$TYPE(htm)"
Limit = 256
Match = ".(on(contextmenu|mousedown|mouseup)|captureEvents)1"
Replace = ".1Prox"

And one question:
If i put bounds <script*</script>, the filter dont works well, why?

Note: I changed the replace code. Was missing the point before 1Prox

Edited by - lnminente on 13 Aug 2002  16:08:00
Title: Allow right mouse click II
Post by: altosax on August 12, 2002, 07:40:04 PM
Inminente wrote:

quote:

And one question:
If i put bounds <script*</script>, the filter dont works well, why?



when you use the bounds field, you have to match the whole bounds. this should work:

Match = ".(on(contextmenu|mousedown|mouseup)|captureEvents)12"
Replace = "1Prox2"

but i suggest to not use bounds with this kind of filters because if you use bounds you need also to enable multi filtering, and this increase the time needed to filter the script. if you try to use bounds and not to enable the multi filtering you risk to not filter malicious code contained in the same script, so the filter is well written as it is now.

regards,
altosax.

 
Title: Allow right mouse click II
Post by: lnminente on August 13, 2002, 03:31:38 PM
Many thanks Altosax. And sorry, my poor english limit me.

I did explain the problem very very bad

I was trying to tell that the filter with
Match = ".(on(contextmenu|mousedown|mouseup)|captureEvents)12"
only works for the first code matched, but not for the rest.

The code to verify it is the next (extracted of http://www.ncsx.org/2002/ncs060302/ncs0603.htm ):

<script language=JavaScript>
<!--

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// -->
</script>

Edited by - lnminente on 28 Aug 2002  16:59:25
Title: Allow right mouse click II
Post by: altosax on August 13, 2002, 06:59:58 PM
as i wrote in my first post, if you use bounds with this kind of filter, you need to enable multi filtering, so add:

Multi = TRUE

and the filter will work for all occurrence of the matching code.

regards,
altosax.

 
Title: Allow right mouse click II
Post by: lnminente on August 14, 2002, 12:13:55 AM
Sorry, but still doesn't work.

With multiple matches allowed, each filter only can match the same code one time.

I would like that the same filter matches the same code more times, not only one.



Other thing: I don't like the version 3,(without bounds) Why?

Because will change this
<a href=http:\www.web.captureEvents.cometc.gif>[link]</a>
to that
<a href=http:\www.web.captureEventsProx.cometc.gif>[link]</a>


Perhaps, you can think that there is no web called captureevents.com

But i had a problem with the config set of JD5000 with the filter "Browser Info in JS (Browser & OS)" and the web www.onlinedown.net because the filter matches ".online" as a javascript

Regards.

Edited by - lnminente on 28 Aug 2002  17:02:00
Title: Allow right mouse click II
Post by: sidki3003 on August 14, 2002, 12:21:21 AM
You're right, you need the replacement stack for multiple matches within bounds.
I posted an example here (http://"http://www.computercops.biz/modules.php?name=Forums&file=viewtopic&t=544") .


 
Title: Allow right mouse click II
Post by: altosax on August 14, 2002, 12:27:56 AM
inminente wrote:

quote:

Other thing: I don't like the version 3,(without bounds) Why?

Because will change this
<a href=http:\www.web.captureEvents.cometc.gif>[link]</a>
to that
<a href=http:\www.web.captureEventsProx.cometc.gif>[link]</a>



to make it safer modify it this way:

Name = "Allow Right Click 3"
Active = FALSE
URL = "$TYPE(htm)"
Limit = 256
Match = "document.(on(contextmenu|mousedown|mouseup)|captureEvents)1"
Replace = "document.1Prox"

otherwise you need to write a filter using the # stack.

regards,
altosax.

 
Title: Allow right mouse click II
Post by: lnminente on August 14, 2002, 12:36:57 AM
And If the name of the web is document.captureevents.com ??

Many thanks Altosax and Sidki3003, i think that # is what i was searching.

I have too much to learn of Proxomitron.

Also, JD5000 has in his latest config set one js filter called "Allow Right Mouse Clicks" that works perfectly.

Regards.



Edited by - lnminente on 14 Aug 2002  18:01:02
Title: Allow right mouse click II
Post by: altosax on August 14, 2002, 07:14:52 PM
the best filter i know to allow right click is this one by homeric:

Name = "Allow right mouse click [EAH]"
Active = TRUE
Limit = 16
Match = "<end>"
Replace = "
<!--//--><script language="JavaScript">
"
          "if (document.layers)
"
          "{
"
          "document.releaseEvents(Event.MOUSEDOWN);
"
          "document.onmousedown=null;
"
          "window.releaseEvents(Event.MOUSEDOWN);
"
          "window.onmousedown=null;
"
          "}
"
          "if (document.all)
"
          "{
"
          "document.oncontextmenu=null;
"
          "document.onmousedown=null;
"
          "document.body.oncontextmenu=null;
"
          "document.body.onmousedown=null;
"
          "}
"
          "<!--//--></script>
"

i use this one in my config, but i know the filter use by jd and also appreciate it. otoh, the whole jd config is a well assembled collection of filters, i always download every new release.

regards,
altosax.

 
Title: Allow right mouse click II
Post by: lnminente on August 16, 2002, 05:03:36 PM
Thanks Altosax.

Your knowledge about Proxomitron is great.

Before i was making my own filters set, but now, i'm testing, learning and personifying the JD500 filters set.

Regards.

Edited by - lnminente on 28 Aug 2002  17:09:13
Title: Allow right mouse click II
Post by: lnminente on August 28, 2002, 04:09:43 PM
Update 1 for multiple matches (added
 in replace code).
Update 2 for style , dedicated to Altosax.


Name = "Allow Right Mouse Click v.IV"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)"
Bounds = "$NEST(<script,</script*>)"
Limit = 5120
Match = "1.(on(contextmenu|mousedown|mouseup)|captureEvents)2"
Replace = "
1.Prox2"

Other thing, i don't use this filter, i prefer "Allow Right Mouse Clicks" from the config set of JD5000.

I only post here for knowledge of the readers to view the use of multiple matches.

Regards to all.

Edited by - lnminente on 28 Aug 2002  21:49:01
Title: Allow right mouse click II
Post by: altosax on August 28, 2002, 06:19:03 PM
hi inminente,
just a point for style,
not an improvement neither a criticism.

NOTE: this is not a trick of mine, it was suggested by bigpurplemoon time age on yahho prox-list and i've adopted it.

when you have to place some code to discard in a variable you can use the variable for this. this way the filters becomes more readable because you immediately know what stuff will be deleted. also the 0 appears to be the more indicated variable for this.

altosax.