mirror of
https://github.com/AEPKILL/devtools-detector.git
synced 2026-04-26 23:15:48 +03:00
[GH-ISSUE #21] console.log function-to-string.checker #9
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#9
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 @LeDinhPhuc on GitHub (May 28, 2021).
Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/21
I am just starting with javascript, can you explain to me why console.log method is called twice when devtools is open.
Tks bro
@AEPKILL commented on GitHub (Jun 3, 2021):
good question. I'll write a blog this weekend to explain it.
@AEPKILL commented on GitHub (Jun 6, 2021):
sorry, I didn't run the 'chormium' debugging environment at the weekend, so I can only give a general description from memory.
when we run the code from the
devtools consoleIt will actually be sent to 'devtools Host' execution
when the 'Console. API' execution is complete, it will be notified that execution has been completed
` args' is a serialized 'Remote Object',which is its definition:

we need to focus on the 'description' property because it' s the key, this is how it' s generated:

` Devtools' will use 'to String' to generate' description' property

so, we just overwrite
toStringmethod, whendevtoolsis open, our function will be execute.@LeDinhPhuc commented on GitHub (Jun 7, 2021):
Thanks pro @AEPKILL
@alpgul commented on GitHub (Jun 20, 2021):
How will it detect? if I do
console.log=()=>{};@AEPKILL commented on GitHub (Jul 7, 2021):
@alpgul
devtools-detectorwill cache thelogmethod, as long as you ensure thatdevtools-detectoris loaded first, it will work even if you override thelogmethod