Is there a way to disable one of this disturbing things in the page sources?
oncontextmenu="return false"
ondragstart="return false"
onselectstart="return false"
Thanks
How to disable oncontextmenu="return false"
-
- Posts: 7
- Joined: November 14th, 2002, 6:40 pm
- edcatmur
- Posts: 88
- Joined: November 12th, 2002, 1:42 pm
You can do it with bookmarklets...
javascript:(function(){var H=["mouseover","mouseout","mousemove","submit","load","unload","resize","click"], Z=[], s="", j; function R(N,a){ while (N[a]) { Z[a]=Z[a]?Z[a]+1:1; N[a]=null; } } function zapEH(N) { var a,i,C; for (j in H) R(N,"on"+H[j]); C=N.childNodes; for (i=0;i<C.length;++i) zapEH(C[i]); } zapEH(document); for (j in Z) s += j + " (" + Z[j] + ")\n"; if(s) alert("Zapped event handlers:\n\n"+s); else alert("No event handlers found.");})();
(probably from http://www.squarefree.com/bookmarklets/ ) will zap various event handlers; pruning it to
javascript:(function(){var H=["contextmenu","dragstart","selectstart"], Z=[], s="", j; function R(N,a){ while (N[a]) { Z[a]=Z[a]?Z[a]+1:1; N[a]=null; } } function zapEH(N) { var a,i,C; for (j in H) R(N,"on"+H[j]); C=N.childNodes; for (i=0;i<C.length;++i) zapEH(C[i]); } zapEH(document); for (j in Z) s += j + " (" + Z[j] + ")\n"; if(s) alert("Zapped event handlers:\n\n"+s); else alert("No event handlers found.");})();
will zap those event handlers you refer to. Making it just zap those which have a value of "return false" would be possible but you would have to consider the permutations of that e.g. "return null;" "return 0;" "alert('Context menu disabled'); return (0==1);" "return (!true)" - to evaluate all of these in their effects would be an interesting but pointless exercise.
javascript:(function(){var H=["mouseover","mouseout","mousemove","submit","load","unload","resize","click"], Z=[], s="", j; function R(N,a){ while (N[a]) { Z[a]=Z[a]?Z[a]+1:1; N[a]=null; } } function zapEH(N) { var a,i,C; for (j in H) R(N,"on"+H[j]); C=N.childNodes; for (i=0;i<C.length;++i) zapEH(C[i]); } zapEH(document); for (j in Z) s += j + " (" + Z[j] + ")\n"; if(s) alert("Zapped event handlers:\n\n"+s); else alert("No event handlers found.");})();
(probably from http://www.squarefree.com/bookmarklets/ ) will zap various event handlers; pruning it to
javascript:(function(){var H=["contextmenu","dragstart","selectstart"], Z=[], s="", j; function R(N,a){ while (N[a]) { Z[a]=Z[a]?Z[a]+1:1; N[a]=null; } } function zapEH(N) { var a,i,C; for (j in H) R(N,"on"+H[j]); C=N.childNodes; for (i=0;i<C.length;++i) zapEH(C[i]); } zapEH(document); for (j in Z) s += j + " (" + Z[j] + ")\n"; if(s) alert("Zapped event handlers:\n\n"+s); else alert("No event handlers found.");})();
will zap those event handlers you refer to. Making it just zap those which have a value of "return false" would be possible but you would have to consider the permutations of that e.g. "return null;" "return 0;" "alert('Context menu disabled'); return (0==1);" "return (!true)" - to evaluate all of these in their effects would be an interesting but pointless exercise.