TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Encode any JavaScript with only six characters

17 点作者 antichaos超过 13 年前

7 条评论

endtwist超过 13 年前
For those curious, the trick works by creating strings (such as "NaN" or "Infinity") and integers, then treating the strings as arrays and selecting out characters. The [], +, ! and () are assembled in sequences that result in these strings/integers (thanks to Javascript's liberal language rules).<p>Here's a dictionary/more information: <a href="http://sla.ckers.org/forum/read.php?24,33349,33405" rel="nofollow">http://sla.ckers.org/forum/read.php?24,33349,33405</a>
jballanc超过 13 年前
While this might seem like nothing more than a neat parlor trick, there is an important lesson to take away: NEVER, under ANY circumstances insert untrusted values into your scripts. No amount of white-listing/black-listing/escaping/etc. will protect you.
hasegawayosuke超过 13 年前
In the past, this was worked on Chrome and Firefox. but now JSF*ck is worked only Opera. Sorry, but I have no patience to fix it.<p>-- Yosuke HASEGAWA / utf-8.jp
laserDinosaur超过 13 年前
Oddly I could not get it to work in chrome or firefox, and it managed to crash all my tabs in chrome.<p>The other demos seem to work much better though: <a href="http://utf-8.jp/public/jjencode.html" rel="nofollow">http://utf-8.jp/public/jjencode.html</a>
jr62超过 13 年前
On Chrome 14 (Linux), when I click "eval" it doesn't show the alert dialog. Even leaving the default text there. It's an interesting concept though, would definitely be good to see an explanation of how it works.
评论 #3279120 未加载
brayker超过 13 年前
Want to know how it works? view-source:<a href="http://utf-8.jp/public/jsfuck.html" rel="nofollow">http://utf-8.jp/public/jsfuck.html</a>
LeafStorm超过 13 年前
This is an...interesting hack. However, it's not entirely clear how it works.
评论 #3279108 未加载