Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obfuscator without call to global variable from callback function? #943

Closed
zenlykoi opened this issue Jun 26, 2021 · 1 comment
Closed
Labels

Comments

@zenlykoi
Copy link

My english is not good, but i will try to explain my problem.

I want to obfuscator my script (chrome extension). In my script have some callback function does not execute in this context. It will be send to another context to execute (background send a function from string to content and execute it).

When i obfuscator my script in https://obfuscator.io/ with option of Identifier Names Generator is Hexadecimal , my script call to a variable in global!

How can i obfuscator my script with Hexadecimal and without this change in my callback function?

image
image

@sanex3339
Copy link
Member

Hi. As i understood, executeScript function runs code in a different context, as BLOB inline WebWorker does?
Try to wrap it into conditional comments (https://github.com/javascript-obfuscator/javascript-obfuscator#conditional-comments):

function executeScript(fn) {}

// javascript-obfuscator:disable
executeScript(function () {
    var a = 5;
    console.log(a);
});
// javascript-obfuscator:enable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants