Expand my Community achievements bar.

Option to add //# sourceURL to Dev Environment

Avatar

Level 1

7/3/18

One challenge I have found with Adobe Launch is debugging custom rules. The custom code in Adobe Launch is put into JSON strings and evaluated resulting in the code not being available in Developer Tools for debugging.

I found a feature in Chrome Dev Tools that allows a local override and a “SourceURL” to be set.

If I modify the script file by adding something like this to the end. “//# sourceURL=someUniqueName.js”

Then I can find “someUniqueName.js” in sources and browse the code and set breakpoints.

Request idea

Add a checkbox in the Environments tab of Adobe Launch “Turn on SourceURL” for Dev and/or Staging scripts.

When checked. It would add this “//# sourceURL={uniqueFileName}.js” To the end of every generated script.

This could greatly simplify debugging.

2 Comments

Avatar

Level 9

7/4/18

Not sure if I understand you correclty, but in either Chrome or Firefox you can still pretty print the compressed file from launch. Just open the developert tools, navigate to the source, in your cause probably the launch-HASH-ENV-min.js and click the {} icon.

There are still some limitations to debugging as the compresser does a lot of code rewriting and uses less semicolons and more comma and boolean operators to have multiple operations in one line. So you can't have a breakpoint on every line you would expect based on the code you wrote.

Avatar

Level 1

7/5/18

Hi Thomas,

The base Adobe Launch Library script can be formatted, but the custom rules applied to the page can't be. See this example

CustomRule-InJSON.png

Notice that even formatted, the code is inside a JSON

So I found a manual way to work on each file.

I used the new overrides feature in Chrome and add //# sourceURL=rule1.js to the end of the string

addingSourceUrl.png

And now you can see the script as a file in the debugger

NowCanDebug.png

If Adobe Launch could add the option to add these to Dev builds, that would be so awesome!

//# sourceURL=HASH1.js

//# sourceURL=HASH2.js