Add CEF Remote Debugging toggle (#129)

* feat: add CEF Remote Debugging toggle

* feat: disable remote debugger on startup

* refactor: stop debugger instead of disable

* feat: add option to allow remote debugging by default

Co-authored-by: TrainDoctor <traindoctor@protonmail.com>
This commit is contained in:
Sefa Eyeoglu
2022-08-18 23:50:59 +02:00
committed by GitHub
parent 55a7682663
commit 43dee863cd
5 changed files with 79 additions and 3 deletions
+17 -1
View File
@@ -5,6 +5,7 @@ from aiohttp import ClientSession, web
from injector import inject_to_tab
import helpers
import subprocess
class Utilities:
def __init__(self, context) -> None:
@@ -16,7 +17,10 @@ class Utilities:
"confirm_plugin_install": self.confirm_plugin_install,
"execute_in_tab": self.execute_in_tab,
"inject_css_into_tab": self.inject_css_into_tab,
"remove_css_from_tab": self.remove_css_from_tab
"remove_css_from_tab": self.remove_css_from_tab,
"allow_remote_debugging": self.allow_remote_debugging,
"disallow_remote_debugging": self.disallow_remote_debugging,
"remote_debugging_allowed": self.remote_debugging_allowed
}
if context:
@@ -133,3 +137,15 @@ class Utilities:
"success": False,
"result": e
}
async def remote_debugging_allowed(self):
return await helpers.is_systemd_unit_active(helpers.REMOTE_DEBUGGER_UNIT)
async def allow_remote_debugging(self):
await helpers.start_systemd_unit(helpers.REMOTE_DEBUGGER_UNIT)
return True
async def disallow_remote_debugging(self):
await helpers.stop_systemd_unit(helpers.REMOTE_DEBUGGER_UNIT)
return True