question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to exclude a function from obfuscation?

See original GitHub issue

In one of my project we have WorkerFn function that executes within WebWorker environment. We create it in this way:

function WorkerFn(root) {
  //here is worker code
}

url = URL.createObjectURL(
  new Blob([ '(' + WorkerFn.toString() + ')(this)' ], { type: 'text/javascript' })
);

ww = new Worker(url);

This is only place that breaks after obfuscation, because this function executes in clean environment (WebWorker) and doesn’t have global function to resolve names.

I know the workaround to add every name into reservedNames array, but it has serious downsides:

  • it prevents names from obfuscations in other places of script
  • it is tedious process and breaks every time source code is changed

Is there good solution to avoid obfuscation of this chunk?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
sanex3339commented, Oct 18, 2017
2reactions
Kukunincommented, Oct 20, 2017

Amazing, thanks. You do great job!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How i exclude part of code being obfuscated by ConfuserEx?
Gets or sets a Boolean value indicating whether the obfuscation tool should exclude the type or member from obfuscation.
Read more >
ObfuscationAttribute.Exclude Property (System.Reflection)
The MethodA method is marked with the value "default" for the Feature property. It is necessary to specify false for the Exclude property...
Read more >
ZKM Script Exclusions Tutorial - Zelix KlassMaster
You can exclude packages, classes, fields and methods based upon the presence or absence of annotations at the class, field, method or method...
Read more >
Obfuscating Code- Zend Guard 7
The Scan feature (on the Exclude Tab) scans the code in order to locate entities that should be added to the Exclude list....
Read more >
yGuard 2.5 - Ant Java Bytecode Obfuscator and Shrinker
Another way is to annotate the elements directly in the source code that should be obfuscated or excluded. You can use the yFiles...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found