zlacker

[parent] [thread] 3 comments
1. capabl+(OP)[view] [source] 2020-11-28 21:13:30
> Can anybody recommend a tool to look what Javascript code loaded by a certain page is doing?

Open your browser's developer tools, go to the Script/Debugger tab and have at it. It's just about as obtuse to use as a tool as gdb, but you'll see exactly what it does. Chrome dev tools has automatic formatting of the code, maybe firefox too. But you'll be stuck with shitty variable names if they been mangled. Although you could try http://www.jsnice.org/, I had variable luck with using it.

It would be interesting to have a browser tool that is like strace and you could filter by calls, so you can see exactly where window.navigator is being used for example, or localStorage.setItem. For now best you can do is searching for "navigator" which works, but can be minified/hidden away by coder as well.

replies(1): >>usr110+21
2. usr110+21[view] [source] 2020-11-28 21:22:37
>>capabl+(OP)
> It would be interesting to have a browser tool that is like strace and you could filter by calls, so you can see exactly where window.navigator is being used for example, or localStorage.setItem.

Exactly, that's what I meant.

replies(2): >>fiddle+J6 >>labawi+UH4
◧◩
3. fiddle+J6[view] [source] [discussion] 2020-11-28 22:17:18
>>usr110+21
Because JavaScript is dynamic, you can often rebind things like window.fetch to trace what’s going on (store the old copy and replace with a new one that does something before delegating). If you can arrange your shim to be loaded before any other JS, I guess you could implement something like object capabilities for JavaScript?
◧◩
4. labawi+UH4[view] [source] [discussion] 2020-11-30 20:42:11
>>usr110+21
Note that javascript can access whether developer tools are open and change it's behaviour. Or so I've heard.
[go to top]