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

the obfuscator code can not run in IE8 #13

Closed
acgotaku opened this issue Jan 9, 2017 · 7 comments
Closed

the obfuscator code can not run in IE8 #13

acgotaku opened this issue Jan 9, 2017 · 7 comments
Labels

Comments

@acgotaku
Copy link

acgotaku commented Jan 9, 2017

Because IE8 have not console object in normal mode, so the code will trigger error or you have to press F12 open developer tools.

At last, I have to add polyfill code before the obfuscator code:

window.console = window.console || (function(){ var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function(){}; return c; })();

Please check whether console object exists before disable console output.

Thank you !

@sanex3339 sanex3339 added the bug label Jan 9, 2017
@sanex3339
Copy link
Member

Thank you, i will fix it today

sanex3339 added a commit to javascript-obfuscator/javascript-obfuscator that referenced this issue Jan 9, 2017
sanex3339 added a commit to javascript-obfuscator/javascript-obfuscator that referenced this issue Jan 9, 2017
@sanex3339
Copy link
Member

sanex3339 commented Jan 9, 2017

How i can reproduce this error?

js code:

console.log('it works!!!');

In all modes on ie8 when i close Development Tools, refresh page, then open Development Tools, i have no error and correct message in console - 'it works!!!'

With code:

window.console.log = function () {};
console.log('it works!!!');

i have no errors and no messages in all modes

@acgotaku
Copy link
Author

acgotaku commented Jan 9, 2017

Open IE8 and load test.html:

	<!DOCTYPE html>
	<head>
	</head>
	<body>
		<script type="text/javascript">
			console.log("Hello World");
		</script>
	</body>
	</html>

You will get this warning:
screenshot from 2017-01-09 23-05-31

I am sorry, this is Chinese.

On the bottom left corner, there's a warning tips. The alert is console undefined.

But If you open the developer tools and reload, the page can run normally.

My IE8 version is 8.0.7601.17514

screenshot from 2017-01-09 23-09-18

@sanex3339
Copy link
Member

sanex3339 commented Jan 9, 2017

Still cannot reproduce, same IE version.

But i made fix in separate branch, can you test it (for example temporary replace dist/index.js)?
https://github.com/javascript-obfuscator/javascript-obfuscator/tree/0.8.4

If it will work fine i publish new version to npm later today.

@acgotaku
Copy link
Author

acgotaku commented Jan 9, 2017

I have tested it.
No problem. Thank you!

@acgotaku acgotaku closed this as completed Jan 9, 2017
@sanex3339
Copy link
Member

[email protected] and [email protected] are out.

@acgotaku
Copy link
Author

nice job! Thank you!

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