遇到一个网页禁用鼠标左右中键怎么用js搞好

52 views
Skip to first unread message

晨风楚

unread,
Sep 6, 2012, 6:50:29 AM9/6/12
to greasemon...@googlegroups.com
遇到一个网页禁用鼠标左右中键怎么用js搞好

.

unread,
Sep 6, 2012, 7:11:42 AM9/6/12
to greasemon...@googlegroups.com
On 6 September 2012 12:50, 晨风楚 <jued...@gmail.com> wrote:
> 遇到一个网页禁用鼠标左右中键怎么用js搞好
>

Google translate:
"Left and right mouse key is how to do a good job with js disabled
encounter a web..."

Ok, I have no idea what you are talking about.

But here is a script to stop websites from disabling right-click menus.
http://userscripts.org/scripts/show/30096


--
--
ℱin del ℳensaje.

Klaus Johannes Rusch

unread,
Sep 6, 2012, 8:03:18 AM9/6/12
to greasemon...@googlegroups.com
On 06.09.2012 12:50, ����� wrote:
> ����һ����ҳ������������м���ô��js���

���! ���� http://userscripts.org/scripts/show/30096

--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

晨风楚

unread,
Sep 6, 2012, 8:32:35 AM9/6/12
to greasemon...@googlegroups.com


在 2012年9月6日星期四UTC+8下午6时50分29秒,晨风楚写道:
遇到一个网页禁用鼠标左右中键怎么用js搞好


感谢各位哥哥们的回复。刚刚试过了,发现没有用。

那个网页禁用了鼠标的功能,代码如下:

<script type="text/javascript">
// IE Evitar seleccion de texto
document.onselectstart=function(){
if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password")
return false
else return true;
};
// FIREFOX Evitar seleccion de texto
if (window.sidebar){
document.onmousedown=function(e){
var obj=e.target;
if (obj.tagName.toUpperCase() == "INPUT" || obj.tagName.toUpperCase() == "TEXTAREA" || obj.tagName.toUpperCase() == "PASSWORD")
return true;
/*else if (obj.tagName=="BUTTON"){
return true;
}*/
else
return false;
}
}
// End -->
</script>
 

Klaus Johannes Rusch

unread,
Sep 6, 2012, 8:41:51 AM9/6/12
to greasemon...@googlegroups.com
On 06.09.2012 14:32, ����� wrote:
>
> ��л��λ����ǵĻظ����ո��Թ��ˣ�����û���á�
>
> �Ǹ���ҳ���������Ĺ��ܣ��������£�
Greasemonkey script to re-enable text selection blocked by this script:

// ==UserScript==
// @name Re-enable text selection
// @namespace http://www.example.com/
// @description Re-enable text selection
// @include *
// @version 1
// @grant none
// ==/UserScript==

document.onmousedown=function(e){ return true; }

杨大成

unread,
Sep 6, 2012, 11:33:32 AM9/6/12
to greasemon...@googlegroups.com
you are actually right :)
the question is, what to do if the website has disable the left,  right , and middle button .

2012/9/6 . <oscar...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To post to this group, send email to greasemon...@googlegroups.com.
To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.


Klaus Johannes Rusch

unread,
Sep 7, 2012, 8:17:33 AM9/7/12
to greasemon...@googlegroups.com
On 06.09.2012 17:33, 杨大成 wrote:
> you are actually right :)
> the question is, what to do if the website has disable the left, right
> , and middle button .
Since there are multiple ways to block mouse buttons, you will need to
examine the websites to identify the method used, and undo those
change/re-enable the buttons.

Blindly setting handlers for mouse button events may give you the
desired results but could have side effects if useful functions are
attached to those events too.
Reply all
Reply to author
Forward
0 new messages