Changes between Version 4 and Version 5 of I2P_Browser_develop_n_hacks
- Timestamp:
- Jun 10, 2019 4:42:31 PM (20 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
I2P_Browser_develop_n_hacks
v4 v5 14 14 The fact is that most of Firefox's source is probably Javascript, without me fact checking now. Yes, Firefox contains quite a lot of C++ and some Rust etc. 15 15 16 However the glue to make all those different components together to a usable browser is privileged Javascript. It's about the same as regular, but totally 17 different environment and APIs. You can launch firefox/i2pbrowser with the --jsconsole argument to spawn the browser console at launch. If not, ctrl+shift+J and cmd+shift+J for OSX users. 16 However the glue to make all those different components together to a usable browser is privileged Javascript. It's about the same as regular, but totally different environment and APIs. 17 18 You can launch firefox/i2pbrowser with the --jsconsole argument to spawn the browser console at launch. If not, ctrl+shift+J and cmd+shift+J for OSX users. 18 19 19 20 {{{ … … 26 27 const {classes: Cc, interfaces: Ci, manager: Cm, results: Cr, utils: Cu, Constructor: CC} = Components; 27 28 }}} 29 30 31 === Common methods to solve problems === 32 33 In firefox they use a lot of the concept "observer". We use it ourself to enable the I2P Health check, and in the future to launch I2P itself. 34 35 Here is a example on a object registering for "firefox global" events. "quit-application" is self-explained, but for "profile-after-change" it is 36 the first event we as a plugin and not base firefox can hook ourself into. 37 {{{ 38 function myExt() {} 39 myExt.prototype = { 40 observe: function(aSubject, aTopic, aData) { 41 switch (aTopic) { 42 case "quit-application": 43 stopServer(); 44 obs.removeObserver(this, "quit-application"); 45 break; 46 case "profile-after-change": 47 startServer(); 48 obs.addObserver(this, "quit-application", false); 49 break; 50 } 51 } 52 }; 53 }}} 54 55 To read more about all the different notifications a observer can receive please check out [https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Observer_Notifications Observer Notifications at Mozilla wiki]. 28 56 29 57