啥都不说了,老司机直接移步GITHUB看源码吧:
https://github.com/deaboway/AndroidWebViewTextSelect
万一不work,一定不是代码的问题,你可以自查链接中的如下情况
CSS控制页面文字不能被选中user-select:none;body{
-moz-user-select:none;/*火狐*/
-webkit-user-select:none;/*webkit浏览器*/
-ms-user-select:none;/*IE10*/
-khtml-user-select:none;/*早期浏览器*/
user-select:none;
}
JS屏蔽复制粘贴右键菜单//屏蔽右键菜单
document.oncontextmenu = function (event){
if(window.event){
event = window.event;
}try{
var the = event.srcElement;
if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){