mirror of
https://github.com/AEPKILL/devtools-detector.git
synced 2026-04-26 23:15:48 +03:00
[GH-ISSUE #46] Disable console clearing #27
Labels
No labels
bug
bug
enhancement
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/devtools-detector#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Valar353 on GitHub (Aug 16, 2022).
Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/46
Hey! Is it possible to disable console clearing?
@RVFET commented on GitHub (Aug 16, 2022):
You can overwrite
console.clear()method, however it'll be still possible to use Browser's built-in "Clear console" button.@AEPKILL commented on GitHub (Aug 18, 2022):
If clear is disabled, a lot of information for detection will appear in the console (every detection loop)
If you want the your debugging information not to cleared, you can turn off the detection in the development environment
E.g.:
@Valar353 commented on GitHub (Aug 22, 2022):
Got it, thanks for the reply. However, the library clears the console before I call the
launchmethod, is there any way to get around this?@AEPKILL commented on GitHub (Sep 7, 2022):
I just tried it won't clear the console before call the
launchmethod@jdempcy commented on GitHub (Sep 30, 2022):
I am using a package which uses devtoolsDetector (@d-i-t-a/reader) and so I do not have control over devtoolsDetector.launch() nor do I see that anywhere in the reader code. Is there another way to configure devtools-detector not to clear the console?
@AEPKILL commented on GitHub (Oct 29, 2022):
you can rewrite
devtoolsDetector.launchmethod before import@d-i-t-a/readere.g.
@jdempcy commented on GitHub (Nov 18, 2022):
This disables other functionality used by the module for its content protection which requires detecting when the dev tools are open. What I really need to do is disable the console clearing. I actually found a way to do this by just pointing console.clear to an empty function, ilke you did with the launch method. In the index.html for the whole React app I simply add a script like so:
Thanks for the great tool! And for the good idea of overriding the method like that :)
@jdempcy commented on GitHub (Nov 18, 2022):
@Valar353 You can do this by overriding console.clear().
@jdempcy commented on GitHub (Nov 18, 2022):
@AEPKILL this question can be closed as there is a suitable workaround (imo)
@jdempcy commented on GitHub (Nov 18, 2022):
Note that pointing to void did not work for me and I actually had to override to an empty function with () => {}.
@jfaylon commented on GitHub (Jul 21, 2025):
I'm trying to override the console.clear but to no avail. Is there a way to disable the logs for this module instead of clearing as this affects globally?