Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Option to add //# sourceURL to Dev Environment

Avatar

Avatar
Boost 1
Level 1
fredrc777
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
fredrc777
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
fredrc777
Level 1

03-07-2018

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

Avatar
Give Back 100
Level 9
thomas_amsler
Level 9

Likes

244 likes

Total Posts

159 posts

Correct reply

26 solutions
Top badges earned
Give Back 100
Give Back 50
Ignite 10
Give Back 25
Ignite 5
View profile

Avatar
Give Back 100
Level 9
thomas_amsler
Level 9

Likes

244 likes

Total Posts

159 posts

Correct reply

26 solutions
Top badges earned
Give Back 100
Give Back 50
Ignite 10
Give Back 25
Ignite 5
View profile
thomas_amsler
Level 9

04-07-2018

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

Avatar
Boost 1
Level 1
fredrc777
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
fredrc777
Level 1

Likes

2 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
fredrc777
Level 1

05-07-2018

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