0

I need to inject a piece of JavaScript code into current page on my browser, either from an external .exe or from C++ code via XPCOM call. I suppose if I write an addon/extension and use a C++ .dll to call its code via XPCOM, the .dll is loaded into the browser process, so it should be possible to access current page elements from it.

Of course I'm not asking this for some nasty hacking purposes, I just need a way to inject a JavaScript into the page without exposing its code.

Tiago Sippert
  • 1,324
  • 7
  • 24
  • 33
user1617735
  • 451
  • 5
  • 16
  • The moment you inject that code it becomes visible to [JavaScript Deobfuscator](https://addons.mozilla.org/addon/javascript-deobfuscator/) and other JavaScript debugging tools - so the value of that solution will be limited. – Wladimir Palant Aug 23 '12 at 06:33
  • Well my goal is at least to make it as hard as possible to catch and deobfuscate the code. – user1617735 Aug 23 '12 at 06:56
  • Actually I was thinking to split the code into GUI and logic part, put the logic part in C++ and use XPCOM to call it. That way I'll at least have half of my code invisible. The big question is, does XPCOM only work for FF, or chrome and IE as well? – user1617735 Aug 23 '12 at 07:45
  • Obviously, XPCOM is a Mozilla-specific technology... – Wladimir Palant Aug 23 '12 at 07:54
  • Is there any adopter/extension for chrome, or any other chrome based technology that allows to do something similar for chrome? – user1617735 Aug 23 '12 at 08:33

0 Answers0