MozillaZine

How to disable oncontextmenu="return false"

Discussion of general topics about Mozilla Firefox
BlueBeBe
 
Posts: 7
Joined: November 14th, 2002, 6:40 pm

Post Posted November 21st, 2002, 9:27 pm

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

jrt
 
Posts: 38
Joined: November 16th, 2002, 5:27 pm

Post Posted November 21st, 2002, 10:07 pm

No way that I know of, yet. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=86193">bug 86193</a> for more info.

edcatmur

User avatar
 
Posts: 88
Joined: November 12th, 2002, 1:42 pm

Post Posted November 26th, 2002, 8:08 am

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.

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 2 guests