security.js 551 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. /**
  3. * 安全模块
  4. */
  5. module.exports = {
  6. /**
  7. * 安装
  8. */
  9. install (eeApp) {
  10. console.log('[preload] load security module');
  11. const runWithDebug = process.argv.find(function(e){
  12. let isHasDebug = e.includes("--inspect") || e.includes("--inspect-brk") || e.includes("--remote-debugging-port");
  13. return isHasDebug;
  14. })
  15. // 不允许远程调试
  16. if (runWithDebug) {
  17. console.log('[error] Remote debugging is not allowed, runWithDebug:', runWithDebug);
  18. eeApp.appQuit();
  19. }
  20. }
  21. }