Changes between Version 10 and Version 11 of I2P_Browser_develop_n_hacks


Ignore:
Timestamp:
Jun 10, 2019 5:20:18 PM (5 months ago)
Author:
Meeh
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • I2P_Browser_develop_n_hacks

    v10 v11  
    27273. Extensions based on the [https://addons.mozilla.org/en-US/developers/builder Add-on SDK]: these are based on a framework that produces restartless extensions. The Add-on SDK has its [https://addons.mozilla.org/en-US/developers/docs/sdk/1.7/ own API] which is very different from what you usually do in Firefox extension - but it is simple, and it mostly takes care of shutting down the extension so that you don't have to do it manually. Extensions here consist of a number of modules, with main.js loading automatically and being able to load additional modules as necessary. Once loaded, each module stays around for as long as the extension is active. They run sandboxed but you can still [https://addons.mozilla.org/en-US/developers/docs/sdk/1.7/dev-guide/tutorials/chrome.html leave the sandbox] and access XPCOM directly. However, you would probably use the [https://addons.mozilla.org/en-US/developers/docs/sdk/1.7/packages/api-utils/observer-service.html internal observer-service] module instead.
    2828
    29 
     29We mainly uses the classic one, but for launching the I2P router in the future we maybe need to use restartless internally - or just make firefox (without a extension) run it. People who wish to develop on our extensions are somewhat free to use the Add-on SDK API if they are afraid the ugly XPCOM monster will come and bite them, but currently we do not have any plans of using the API ourself as Meeh is now somewhat already known with XPCOM.
    3030
    3131=== Privileged Javascript, wtf? ===
     
    6262  return lines.join("\n");
    6363}
     64}}}
     65
     66
     67
     68=== How can I query the I2P health service? ===
     69
     70Just a note, the API was written quite quickly and is not pretty at all, it should change in near future so remember to check if the example bellow is up to date :)
     71(i2pbutton with the chrome/content/i2pbutton.js should contain our live example)
     72
     73{{{
     74let checkSvc = Cc["@geti2p.net/i2pbutton-i2pCheckService;1"].getService(Ci.nsISupports).wrappedJSObject;
     75  let req = checkSvc.createCheckConsoleRequest(true);
     76  req.onreadystatechange = function(event) {
     77    if (req.readyState === 4) {
     78      // Done
     79      let result = checkSvc.parseCheckConsoleResponse(req)
     80      i2pbutton_log(3, "I2P Console check done. Result: " + result)
     81      callback(result)
     82    }
     83  }
     84  req.send(null)
    6485}}}
    6586