File tree Expand file tree Collapse file tree 7 files changed +28
-5
lines changed Expand file tree Collapse file tree 7 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -224,7 +224,8 @@ interface IConfig {
224224 disablePaste: boolean ; // 是否禁用粘贴 默认为false
225225 ignore? : (string | RegExp )[] | null | (()=> boolean ); // 某些情况忽略禁用
226226 disableIframeParents? : boolean ; // iframe中是否禁用所有父窗口
227- timeOutUrl? : // 关闭页面超时跳转的url;
227+ timeOutUrl? : string ; // 关闭页面超时跳转的url;
228+ rewriteHTML: string ; // 检测到打开之后重写页面
228229}
229230
230231enum DetectorType {
Original file line number Diff line number Diff line change @@ -221,7 +221,8 @@ declare interface IConfig {
221221 disablePaste: boolean ; // Whether to disable paste, default is false
222222 ignore? : (string | RegExp )[] | null | (()=> boolean ); // Some cases ignore the disablement
223223 disableIframeParents? : boolean ; // Whether all parent windows are disabled in the iframe
224- timeOutUrl? : // Turn off URLs that page timeouts forward towards
224+ timeOutUrl? : string ; // Turn off URLs that page timeouts forward towards
225+ rewriteHTML? : string ; // Detecting the rewriting page after opening
225226}
226227
227228enum DetectorType {
Original file line number Diff line number Diff line change 55-->
66# Version Log:
77
8+ ## 0.3.7
9+
10+ 1 . Fix the movement of the mobile browser long press and not pop up the copy and other buttons
11+ 2 . Add REWRITEHTML configuration
12+ 3 . Remove CleardDinterval calls in Closewindow
13+
814## 0.3.6
915
10161 . Fix The new version of Google Lighthouse is not released
Original file line number Diff line number Diff line change 55-->
66# Version Log:
77
8+ ## 0.3.7
9+
10+ 1 . 修复移动端浏览器长按不弹出复制等按钮
11+ 2 . 增加 rewriteHTML 配置
12+ 3 . 移除 closeWindow 中的 clearDDInterval 调用
13+
814## 0.3.6
915
10161 . fix google lighthouse 新版本没有放行
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface IConfig {
2626 ignore : ( string | RegExp ) [ ] | null | ( ( ) => boolean ) ; // 某些情况忽略禁用
2727 disableIframeParents : boolean ; // iframe中是否禁用所有父窗口,默认 true
2828 seo : boolean ; // 是否启用对seo进行保护,默认 true
29+ rewriteHTML : string ; // 检测到打开之后重写页面
2930}
3031
3132export interface IDisableDevtool {
Original file line number Diff line number Diff line change 22 * @Author : tackchen
33 * @Date : 2021-12-24 15:14:06
44 * @LastEditors : Please set LastEditors
5- * @LastEditTime : 2023-06-21 08:00:32
5+ * @LastEditTime : 2023-12-22 09:57:58
66 * @FilePath : /disable-devtool/src/close-window.js
77 * @Description : Coding something
88 */
99import { config } from './config' ;
10- import { clearDDInterval } from './interval' ;
10+ // import {clearDDInterval} from './interval';
1111
1212export function closeWindow ( ) {
13- clearDDInterval ( ) ;
13+ // clearDDInterval();
1414 if ( config . url ) {
1515 window . location . href = config . url ;
16+ } else if ( config . rewriteHTML ) {
17+ try {
18+ document . documentElement . innerHTML = config . rewriteHTML ;
19+ } catch ( e ) {
20+ // for 'TrustedHTML' assignment
21+ document . documentElement . innerText = config . rewriteHTML ;
22+ }
1623 } else {
1724 try {
1825 window . opener = null ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export const config: IConfig = {
2626 ignore : null ,
2727 disableIframeParents : true ,
2828 seo : true ,
29+ rewriteHTML : '' ,
2930} ;
3031
3132const MultiTypeKeys = [ 'detectors' , 'ondevtoolclose' , 'ignore' ] ;
You can’t perform that action at this time.
0 commit comments