Fuck 知乎 Anti Devtools

防止知乎的付费杂志页面禁止打开开发人员工具。

  1. // ==UserScript==
  2. // @name Fuck 知乎 Anti Devtools
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.0
  5. // @description 防止知乎的付费杂志页面禁止打开开发人员工具。
  6. // @author 3^^^3
  7. // @match https://www.zhihu.com/market/paid_magazine/*
  8. // @grant none
  9. // @run-at document-start
  10. // @require https://update.gf.qytechs.cn/scripts/485962/1319216/hookPropertyName.js
  11. // @license none
  12. // ==/UserScript==
  13.  
  14. window.console.clear = function () {console.log('Prevented console.clear()')};
  15. window.close = function () {console.log('Prevented window.close()')};
  16.  
  17. let setTimeoutOriginal = window.setTimeout;
  18. window.setTimeout = function (...args) {
  19. if (args[0].toString().includes('disable-devtool')) {
  20. console.log('Prevented disable-devtool close-window');
  21. return;
  22. }
  23. setTimeoutOriginal.call(this, ...args);
  24. };
  25.  
  26. hookPropertyName('largeObjectArray', null, () => {
  27. return ['“largeObjectArray”🤣'];
  28. })
  29.  
  30. // anti-devtools的作者,您用setTimeout,确实很高明,但是也给了脚本用户进行hook的机会。当然我知道,您无疑是前端的大佬,您开发的是开源库,惠及许多人,被少部分人绕过,也是无可奈何,而我用一点脚本的雕虫小技,绕过这一个小小的前端限制,也根本造成不了什么影响。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址