DevTools Anti-Detector

Simple tool to temporarily prevent site from using popular methods of DevTools detection. Do not leave enabled!

目前为 2018-04-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name DevTools Anti-Detector
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Simple tool to temporarily prevent site from using popular methods of DevTools detection. Do not leave enabled!
  6. // @author lainverse
  7. // @match *://*/*
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. let tS = Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString');
  15. let tSV = tS.value;
  16. let fts = Function.prototype.toString;
  17. Object.defineProperty(RegExp.prototype, 'toString', {
  18. enumerable: tS.enumerable,
  19. configurable: tS.configurable,
  20. get: () => tSV,
  21. set: function(val) {
  22. console.log('Attempt to change toString for', this, 'with', fts.call(val));
  23. return true;
  24. }
  25. });
  26. })();