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".

_eanilsenAuthor
January 6, 2020

I am sorry for the unclear question, let me clarify.

My problem is that when I try to access the scripts using the developers console (F12) they are not visible for debugging. It is a result of Adobe Launch loading the scripts/rules as dynamic resources, meaning they do not show up as files but rather only exist under runtime. So I am not able to place any breakpoints to the code.

 

Where can I include the non-minified version of the script and how can I place breakpoints in the rules even in the minified code with the obfuscated variables? I cannot seem to find the code I have written in any of the source files in the browser.