Skip to content

Commit

Permalink
屏蔽F12按键,反扒机制
Browse files Browse the repository at this point in the history
  • Loading branch information
Paper-Dragon committed Nov 9, 2023
1 parent 575a647 commit f741d9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ export default defineUserConfig({

theme,

head: [
["script",
{},
`
/*禁用F12*/
document.onkeydown = function(){
if(window.event.keyCode==123) {
alert('大佬,别扒了!不妨加个友链?\\n执意要做?再按下F12可调出控制台');
event.preventDefault(); // 阻止默认事件行为
event.keyCode=0;
event.returnValue=false;
}
}
`,
],
],
plugins: [
searchProPlugin({
indexContent: true,
Expand Down
6 changes: 3 additions & 3 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ actions:

- text: 时光机器
link: ./timeline/
head:
- ['script', { src: '/js/echarts-wordcloud.js' }]
- ['script', { src: '/js/echarts-wordcloud.min.js' }]
#head:
#- ['script', { src: '/js/echarts-wordcloud.js' }]
#- ['script', { src: '/js/echarts-wordcloud.min.js' }]
highlights:
# - header: 易于安装
# image: /assets/image/box.svg
Expand Down

0 comments on commit f741d9a

Please sign in to comment.