1

I want to add missing functionality to a web app's front end code JavaScript code.

I can find the code in the browser's developer tools by setting breakpoints and stepping through.

But in a large app with lots of modules, obfuscated or at least minified code, and layers of self-executing anonymous functions, how do I then begin to intercept / hook / patch the function I want from a user script?

Looking through the call stack and closure hierarchy doesn't seem to tell me everything I need.

  • If code is protected inside a closure, there is no way to get to that code from outside the closure unless you can edit the actual source before it executes. – jfriend00 Apr 26 '15 at 7:48
  • @jfriend00: That would then be an answer I would accept, though it won't make my job easier (-: It would be an even better answer if it included a method that would let me know for sure whether or not it's inside a closure. – hippietrail Apr 26 '15 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.