Changes between Version 4 and Version 5 of I2P_Browser_develop_n_hacks


Ignore:
Timestamp:
Jun 10, 2019 4:42:31 PM (9 days ago)
Author:
Meeh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • I2P_Browser_develop_n_hacks

    v4 v5  
    1414The 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.
    1515
    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.
     16However 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
     18You 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.
    1819
    1920{{{
     
    2627const {classes: Cc, interfaces: Ci, manager: Cm, results: Cr, utils: Cu, Constructor: CC} = Components;
    2728}}}
     29
     30
     31=== Common methods to solve problems ===
     32
     33In 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
     35Here is a example on a object registering for "firefox global" events. "quit-application" is self-explained, but for "profile-after-change" it is
     36the first event we as a plugin and not base firefox can hook ourself into.
     37{{{
     38function myExt() {}
     39myExt.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
     55To 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].
    2856
    2957