JavaScript Deobfuscator Reloaded
페이지 정보

본문
A few weeks in the past I launched JavaScript Deobfuscator 2.Zero - finally something that works with present Firefox versions once more. Why did it take me a yr to fix this compatibility challenge? Well, it really wasn’t that easy. After considering all of the prospects I decided that rewriting it from scratch was the only risk, and that was onerous to perform in my spare time. Before I proceed with the technical details, permit me to introduce JavaScript Deobfuscator in its new reincarnation: it now provides a panel to Firefox Developer Tools. Instead of messing with filters your view is limited to the current tab routinely. Both compiled and executed scripts go into the same list, with some textual content indicating whether or not we’ve seen the script being compiled or executed or both. Starting with Firefox 39 even code running in Web Workers will likely be displayed. And JavaScript Deobfuscator will beautify the code as a substitute of counting on the JavaScript engine to do so.
The draw back is that solely Firefox is supported now - different applications simply don’t have Developer Tools to integrate with. Also, debugging add-ons or the browser itself isn’t attainable-- Developer Tools run in a separate course of for that, no add-ons installed there. Finally, the search functionality is completely rudimentary proper now, that’s something I hope to enhance finally. Now to the technical particulars. The reason for this overhaul is the brand new debugging interface which changed the one JavaScript Deobfuscator was using. The outdated debugging interface was conceptually different, it was designed as a single hook to collect all information. The brand new one then again collects data about individual compartments and it’s up to you to figure out which of them you need. After just a few unsuccessful attempts to proceed collecting all data in JavaScript Deobfuscator I realized that it made much more sense to have a look at particular person tabs.
Using the new debugging API turned out to be difficult to say the least. Did I link to MDN above? Sorry about that, I ought to have linked to the SpiderMonkey source code. It’s very much like the MDN documentation however the later is outdated. And even when you look at the SpiderMonkey source, much of the documentation is merely wishful thinking, listing options that were by no means carried out. A new UI idea had to be developed as properly, and the only good possibility agreement template for services per-tab debugging could be integrating into the Firefox Developer Tools. That’s where the enjoyable actually started. Then I checked out what TargetType is and how present instruments work with it - this was the point where I realized that there are so many implementation details concerned that an extension can't probably do it. So I gave up. After i got here again just a few months later things improved, barely. Somebody wrote an Add-on SDK module to create new Developer Tools panels.
While I didn’t use that module instantly, it confirmed properly which parts of the API are contractual and which of them are merely implementation particulars. It additionally showed that things aren’t too unhealthy when you limit yourself to a single goal kind - a neighborhood tab. Handling remote connections to browser and add-ons is extra difficult, but as I mentioned above extensions can not do that anyway. Now that article stops at the purpose where you "merely" want to make use of the remote debugging protocol to speak with the constructed-in debugging actor. Well, maybe it is de facto easy however I couldn’t work out how to do that - and whether that protocol is one thing I can rely on. See, the built-in instruments will definitely be adjusted when the debugging actor or/and the protocol change. My extension however might be broken, and I’ll need to take a position time into figuring out what changed and how my code must be adjusted while staying suitable with older Firefox variations.
So JavaScript Deobfuscator makes use of the debugging interface directly, with out relying on the debugging actor of the Developer Tools. And it beautifies JavaScript code utilizing its own copy of a library fairly than relying on code utilized by Developer Tools - JavaScript beautification in Developer Tools is currently an implementation detail that extensions can not rely on. JavaScript Deobfuscator additionally duplicates the styles of the two Developer Tools themes to verify it appears to be like similar to the existing panels - just using the kinds from Developer Tools would have seemingly precipitated a disaster after only a few Firefox releases. Not that the constructed-in types are actually defined in a generic method, there is admittedly numerous inconsistencies there and every panel is styled somewhat otherwise. These are only some examples, there's extra code duplication. Developer Tools aren’t at the moment constructed to permit extensions to reuse their code. Still, I’m pretty proud of the consequence, and i hope that the largest chunk (JavaScript beautification) will go away finally. From the usability standpoint the brand new model is a huge leap forward, getting there could have been simpler nonetheless.
- 이전글Jak tanio urządzić mieszkanie bez kompromisów 26.08.21
- 다음글Jak urządzić dom jednorodzinny, by nie zwariować przy codziennych wyzwaniach 26.08.21
댓글목록
등록된 댓글이 없습니다.