by BoorishBears · 5y ago · 0 comments
You can detect developer tools being open in Chrome pretty reliably, so detect dev tools have been open then "clean up your act" before there's a chance to view anything of note
Even so, we added CSS and stuff to highlight elements and that was easily found.
What do people look for today?
1. Watching window.innerHeight/innerWidth for sudden, large decreases, indicating that the user just opened the inspector.
2. Logging objects to the console with toString methods and checking if that method gets called.
2. Ahhh, clever!
but 2. I have no idea, except the browser vendors would add a "stealth dev mode"
I mean more specifically taking advantage of the awkward UI to cover up your tracks on local storage, it's something that's just devious enough that if you get caught (which is not difficult) it'll be hard to explain what you were doing, and you'll be trying to explain it to technical people
When discord loads, it copies it out of localstorage into a js var and deletes the localstorage. So if you examine localstorage it will be empty. On page unload it copies it back into localstorage. So if you want to see the value, you have to make sure no discord tabs are open in your browser.
I believe one reason for this is to prevent self-xss. It's hard for a malicious person to write a snippet of js to steal the login cookie now that it's no longer in localstorage. Another reason might be to prevent bots. It's hard for someone to automate a discord account if there's no way to get the account's login cookie.
Like, if I have one Discord tab open (so localstorage is cleared) and I open a second one in parallel, will I be logged out in the second one?