mirror of
https://github.com/ironfox-oss/IronFox.git
synced 2026-07-31 18:07:06 -04:00
Applies consistent formatting and naming to patches Signed-off-by: celenity <celenity@celenity.dev>
73 lines
2.7 KiB
Diff
73 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: celenity <celenity@celenity.dev>
|
|
Date: Sun, 05 Jul 2026 20:19:20 +0000
|
|
Subject: [PATCH] Gecko - Bypass DevTools detection
|
|
|
|
Prevents websites from detecting that a user is using developer tools/debugging.
|
|
|
|
Signed-off-by: celenity <celenity@celenity.dev>
|
|
---
|
|
diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js
|
|
index 2d70647d0e59e..fc0d5c015e749 100644
|
|
--- a/devtools/server/actors/thread.js
|
|
+++ b/devtools/server/actors/thread.js
|
|
@@ -8,6 +8,7 @@
|
|
// error packets.
|
|
/* eslint-disable no-throw-literal */
|
|
|
|
+var flags = require("resource://devtools/shared/flags.js");
|
|
const { Actor } = require("resource://devtools/shared/protocol/Actor.js");
|
|
const { Pool } = require("resource://devtools/shared/protocol/Pool.js");
|
|
const { threadSpec } = require("resource://devtools/shared/specs/thread.js");
|
|
@@ -390,7 +391,8 @@ class ThreadActor extends Actor {
|
|
attach(options) {
|
|
// Note that the client avoids trying to call attach if already attached.
|
|
// But just in case, avoid any possible duplicate call to attach.
|
|
- if (this.alreadyAttached) {
|
|
+ let forceDetach = flags.derDetach;
|
|
+ if (this.alreadyAttached || forceDetach) {
|
|
return;
|
|
}
|
|
|
|
diff --git a/devtools/server/actors/webconsole/listeners/console-api.js b/devtools/server/actors/webconsole/listeners/console-api.js
|
|
index cdf6a841a8dec..db60f1945516a 100644
|
|
--- a/devtools/server/actors/webconsole/listeners/console-api.js
|
|
+++ b/devtools/server/actors/webconsole/listeners/console-api.js
|
|
@@ -4,6 +4,16 @@
|
|
|
|
"use strict";
|
|
|
|
+const lazy = {};
|
|
+ChromeUtils.defineESModuleGetters(
|
|
+ lazy,
|
|
+ {
|
|
+ IFPrefUtils:
|
|
+ "moz-src:///ironfox/utils/IFPrefUtils.sys.mjs",
|
|
+ },
|
|
+ { global: "contextual" }
|
|
+);
|
|
+
|
|
const {
|
|
CONSOLE_WORKER_IDS,
|
|
WebConsoleUtils,
|
|
@@ -98,7 +108,8 @@ class ConsoleAPIListener {
|
|
* The message object receives from the ConsoleAPIStorage service.
|
|
*/
|
|
onConsoleAPILogEvent(message) {
|
|
- if (!this.handler) {
|
|
+ let disableConsole = lazy.IFPrefUtils.getBoolPref("browser.ironfox.devtools.console.logging_disabled");
|
|
+ if (!this.handler || disableConsole) {
|
|
return;
|
|
}
|
|
|
|
diff --git a/devtools/shared/flags.js b/devtools/shared/flags.js
|
|
index 1b0ec2647299a..e6958231d30b8 100644
|
|
--- a/devtools/shared/flags.js
|
|
+++ b/devtools/shared/flags.js
|
|
@@ -67,3 +67,4 @@ makePrefTrackedFlag(exports, "wantVerbose", "devtools.debugger.log.verbose");
|
|
* behaviors typically enable easier testing or enhanced debugging features.
|
|
*/
|
|
makePrefTrackedFlag(exports, "testing", "devtools.testing");
|
|
+makePrefTrackedFlag(exports, "derDetach", "browser.ironfox.devtools.debugger.force_detach");
|
|
--
|