File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1515 < script src ="//cdn.jsdelivr.net/npm/eruda "> </ script >
1616 < script > eruda . init ( ) ; </ script >
1717 < script src ="./bundle.js "> </ script >
18+ <!-- <p>Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy Test copy </p> -->
1819 < div > Test disable select</ div >
1920 < input />
2021</ body >
Original file line number Diff line number Diff line change 66import disableDevtool from '../../src' ;
77// import disableDevtool from '../../npm';
88
9+ // window.addEventListener('popstate', function (event) {
10+ // event.preventDefault();
11+ // });
912disableDevtool ( {
1013 md5 : '0b9e05caf5000360ec1c263335bd83fe' , // ddtk
1114 // url: 'https://www.qq.com',
1215 ondevtoolopen : ( type , next ) => {
1316 // window.location.href = 'https://www.qq.com';
1417 document . body . innerHTML = 'devtool opened!; type =' + type ;
15- next ( ) ;
18+ // next();
1619 // console.log(next);
1720 } ,
1821 ondevtoolclose : ( ) => {
@@ -27,9 +30,9 @@ disableDevtool({
2730 // tkName: 'ddtk',
2831 // disableMenu: false,
2932 // clearLog: false,
30- disableCopy : true ,
31- disableSelect : true ,
32- disablePaste : true ,
33+ // disableCopy: true,
34+ // disableSelect: true,
35+ // disablePaste: true,
3336 // url: 'https://www.baidu.com'
3437 // detectors: [disableDevtool.DetectorType.DATE_TO_STRING],
3538
@@ -47,8 +50,8 @@ document.addEventListener('click', () => {
4750 // alert(disableDevtool.isSuspend);
4851} ) ;
4952
50- // console.log(disableDevtool.version);
51- // console.log(disableDevtool.md5('xx'));
53+ console . log ( disableDevtool . version ) ;
54+ console . log ( disableDevtool . md5 ( 'xx' ) ) ;
5255
5356
5457// import {log} from '../src/log';
Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ function disableTarget (target: Window) {
6060
6161function disableMenu ( target : Window ) {
6262 if ( config . disableMenu ) {
63- addPreventListener ( target , 'contextmenu' ) ;
63+ target . addEventListener ( 'contextmenu' , ( e : Event & { pointerType : string } ) => {
64+ if ( e . pointerType === 'touch' ) return ;
65+ return preventEvent ( target , e ) ;
66+ } ) ;
6467 }
6568}
6669function disableSelect ( target : Window ) {
You can’t perform that action at this time.
0 commit comments