Debugging dynamically added JavaScript | Community
Skip to main content
December 16, 2019
Solved

Debugging dynamically added JavaScript

  • December 16, 2019
  • 1 reply
  • 9351 views

Hi.

 

Is there any way to add breakpoints so that I can step through the code in the dynamically loaded scripts coming from Adobe Launch? I have tried adding //# sourceURL=name_of_file.js, but it does not seem to be working.

 

Any help would be appreciated, thank you!

 

Kind regards,

Even A. Nilsen

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by thomas_amsler

Not sure if I understand you correctly, but most browsers have some developer tools (F12), where you can select the loaded resources and add breakpoints to them. The ones from Chrome beeing the best and the ones from IE/Edge the worst. It is easier if you include the non minified launch script in your code for debugging purposes, which then also loads additional scripts in the non minified version if needed. But also the minified ones can be reformatted in most developer tools with some button like "{ }" to be able to set proper breakpoints. Just the variable names are "obfuscated".

1 reply

thomas_amslerAccepted solution
Level 6
December 17, 2019

Not sure if I understand you correctly, but most browsers have some developer tools (F12), where you can select the loaded resources and add breakpoints to them. The ones from Chrome beeing the best and the ones from IE/Edge the worst. It is easier if you include the non minified launch script in your code for debugging purposes, which then also loads additional scripts in the non minified version if needed. But also the minified ones can be reformatted in most developer tools with some button like "{ }" to be able to set proper breakpoints. Just the variable names are "obfuscated".

Level 6
January 6, 2020
Still not sure I understand you correctly, sorry. If I open the developer console I can see all scripts from Adobe and can debug them. Your custom code can be found in a script called: launch-HASH.min.js whereas the HASH part is dependent on your company, property and environment and for development and staging the name is added after the hash, e.g. lanuch-HASH-development.min.js