I
I
Ilya Sevostyanov2013-09-03 13:46:52
Mozilla
Ilya Sevostyanov, 2013-09-03 13:46:52

Modifying native js libraries in Thunderbird/FireFox (omni.ja)?

Good day to all,
I need to solidly customize the Thunderbird mail client, and it seemed like no other great fit for this role, the program directory in the omni.ja JAR package contains the source codes for almost all the basic functionality, and the logic of its work. The code was quickly read, disassembled, modified as needed (for a start, just a little change in just a couple of lines in one of the js files), after which the codes were reassembled into a JAR package (using jar.exe from the JAVA JDK).
Thunderbird launched successfully, even showing the code with the changes made in its JavaScript Debugger.
And then the biggest disappointment awaited me - the added code simply does not run!
No errors, nothing, it just doesn’t execute, intuition tells me that some kind of cunning system of protection against modification of these same source codes is working ( XPCSafeJSObject - I traced such a thing, didn’t I?).
But some preliminary googling led me to the fact that it works and people do modify omni.ja.
I ask for help from the habrareason, who may have already stepped on such a rake.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Sevostyanov, 2013-09-04
@RUVATA

The problem turned out to be not in protecting code files, but in the special caching option nglayout.debug.disable_xul_cache set to true by default (caches XUL and JavaScript code, just what we are changing), and my thoughts were already going in this direction, but I'm naive assumed that the option to clear the cache from the client interface resets the cache in principle, but no, thus only the “user cache” is reset, and the “service cache” is a separate entity.

G
GDApsy, 2013-09-03
@GDApsy

I read about XPCSafeJSObject on SO and judging by the answer, this thing does not protect the code itself from changes, but protects the data in objects and variables from changes by user code. You can change through XPCSafeJSObject, but not bypassing it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question