Your SlideShare is downloading. ×
0
Add-ons para MozillaFirefox.addon-sdk
addon-
Requisitos• Python 2.5 o 2.6• Una versión compatible deFirefox• SDK
Preparando el entornoAbrir la consola como administrador1.d:2.cd d:addon-sdk3.binactivateWelcome to the Add-on SDK. Run cf...
cfxcfx docs: Ver la documentación.cfx init: Crear el esqueleto deladdon.cfx run: Ejecutar el addon en el
cfx run–p PROFILEDIR: Ejecutar el addonusando un perfil.--addons=ADDONS: Ejecutar el addon einstalar los addons especifica...
Preparando el entorno5.mkdir d:Tuto6.cd d:Tuto7.cfx init* lib directory created * data directory created * test directoryc...
package.json1. {2. “name": "Tutorial”3. “license": "MPL 2.0",4. "author": "Comunidad Firefox Cuba",5. "version": "0.1",6. ...
9. "preferences": [{10. "name": "texto",11. "title": "Texto a utilizar",12. "description": "Teclee el texto a utilizar",13...
package.json17. "description": "",18. "type": "integer",19. "value": 0,20. "title": "Cantidad"21. }]22.}
cfx run
dataCarpeta derecursos.icon.pnghtmljs css
libmain.jsAquí va toda la lógica del addon.
APIsHigh-Level APIs.Low-Level APIs.
widget1. var widgets =require("sdk/widget");2. var data = require("sdk/self").data;3. var widget = widgets.Widget({4. id:"...
cfx run
widget -> onclick1. widget.on("click", function(){2.console.log("probando");3. });
cfx run
notifications1. var notifications =require("sdk/notifications");2. …3. notifications.notify({4. title: "Alerta",5. text: "...
cfx run
simple-prefs1. var sp= require("sdk/simple-prefs");2. …3. console.log(sp.prefs.texto);4. console.log(sp.prefs.entero);
cfx run
page-mod1. var pageMod = require("sdk/page-mod");2. pageMod.PageMod({3. include: /.*addon-sdk.*/,4. contentScript: window....
cfx run
¿Preguntas?
Addon sdk
Addon sdk
Addon sdk
Upcoming SlideShare
Loading in...5
×

Addon sdk

640

Published on

Conociendo las principales API del Addon-sdk

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
640
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Addon sdk"

  1. 1. Add-ons para MozillaFirefox.addon-sdk
  2. 2. addon-
  3. 3. Requisitos• Python 2.5 o 2.6• Una versión compatible deFirefox• SDK
  4. 4. Preparando el entornoAbrir la consola como administrador1.d:2.cd d:addon-sdk3.binactivateWelcome to the Add-on SDK. Run cfx docs forassistance.4.cfx docs
  5. 5. cfxcfx docs: Ver la documentación.cfx init: Crear el esqueleto deladdon.cfx run: Ejecutar el addon en el
  6. 6. cfx run–p PROFILEDIR: Ejecutar el addonusando un perfil.--addons=ADDONS: Ejecutar el addon einstalar los addons especificados.
  7. 7. Preparando el entorno5.mkdir d:Tuto6.cd d:Tuto7.cfx init* lib directory created * data directory created * test directorycreated * doc directory created * README.md written * package.jsonwritten * test/test-main.js written * lib/main.js written *doc/main.md written Your sample add-on is now ready. Do "cfx test"to test it and "cfx run" to try it. Have fun!
  8. 8. package.json1. {2. “name": "Tutorial”3. “license": "MPL 2.0",4. "author": "Comunidad Firefox Cuba",5. "version": "0.1",6. "fullName": " Taller de Firefox ",7. "id": "jid1-ecYeRVPoGsu8Zg",8. "description": "Aprendiendo addon-sdk" ,
  9. 9. 9. "preferences": [{10. "name": "texto",11. "title": "Texto a utilizar",12. "description": "Teclee el texto a utilizar",13. "type": "string",14. "value": ""15. }, {16. "name": “entero",package.json
  10. 10. package.json17. "description": "",18. "type": "integer",19. "value": 0,20. "title": "Cantidad"21. }]22.}
  11. 11. cfx run
  12. 12. dataCarpeta derecursos.icon.pnghtmljs css
  13. 13. libmain.jsAquí va toda la lógica del addon.
  14. 14. APIsHigh-Level APIs.Low-Level APIs.
  15. 15. widget1. var widgets =require("sdk/widget");2. var data = require("sdk/self").data;3. var widget = widgets.Widget({4. id:"tuto",5. label: "Tutorial",6. contentURL: data.url("icon.png"),
  16. 16. cfx run
  17. 17. widget -> onclick1. widget.on("click", function(){2.console.log("probando");3. });
  18. 18. cfx run
  19. 19. notifications1. var notifications =require("sdk/notifications");2. …3. notifications.notify({4. title: "Alerta",5. text: "Probando la alerta",6. iconURL: data.url("icon.png"),
  20. 20. cfx run
  21. 21. simple-prefs1. var sp= require("sdk/simple-prefs");2. …3. console.log(sp.prefs.texto);4. console.log(sp.prefs.entero);
  22. 22. cfx run
  23. 23. page-mod1. var pageMod = require("sdk/page-mod");2. pageMod.PageMod({3. include: /.*addon-sdk.*/,4. contentScript: window.alert("Laurl +5. contiene: addon-
  24. 24. cfx run
  25. 25. ¿Preguntas?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×