Created Using the Firefox add-on code from a bootstrap add-on (markdown)
parent
dab5652248
commit
2d0d1c3284
1 changed files with 27 additions and 0 deletions
27
Using-the-Firefox-add-on-code-from-a-bootstrap-add-on.md
Normal file
27
Using-the-Firefox-add-on-code-from-a-bootstrap-add-on.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Thanks to @chrmod for this in #144:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function loadDatomish() {
|
||||||
|
var global = {
|
||||||
|
datomish: null,
|
||||||
|
require: function (moduleName) {
|
||||||
|
var module;
|
||||||
|
switch (moduleName) {
|
||||||
|
case 'chrome':
|
||||||
|
module = {
|
||||||
|
Components,
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case 'sdk/timers':
|
||||||
|
module = {
|
||||||
|
setTimeout,
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return module;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Services.scriptloader.loadSubScript("path-to/datomish.js", global);
|
||||||
|
return global.datomish;
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in a new issue