Today's class was a presentation with Mark Finkle from Mozilla Corp. These are my notes.
Started off in proprietary software
Has only been with Mozilla for a year
The joy of extensions
- Primary way to get involved is through add-ons (extensions)
- Plug-ins killed the web (according to some) and are kind of discouraged
- Any app that uses the mozilla platform can be enabled to use extensions
- There's built in support in the UI, cross platform, platform APIs
Sometime people put their content in a .jar and then in the .xpi necessary for installation. Mark doesn't not advocate for this method because it can make things more confusing to new developers than need be.
He suggests keeping things as simple as you possibly can. Don't use jar files, multiple levels, keep manifests simple. Don't mimic other extensions that are often written by more experienced programmers.
Ted (:luser) has created a xul editor that can generate the skeleton for you, and if you use this then you have everything you need - just add content.
Use the pages on the MDC about the boilerplate aspects of creating extensions.
Stressed the importance of using the id of the rid firefox element to add your customized elements. Otherwise they may show up as document.getElementByID but they will not in fact appear. They will be in the ether until you merge them properly with the id. Examples are vbox id="appcontent" or statusbar id="status-bar". Not merging properly is 90% of what people get stuck on when working on the UI elements of their application and it's often that they are not using the id properly, don't have the proper id or a syntax error.
Best Slide: "Mozilla is like an Onion: It makes you cry, it smells, it has layers"
Mozilla's Tech Layers (1. XUL/JS/CSS, 2. XBL, 3. XPCOM)
Talking about layers he tells us that the top layer (the UI) is the easiest to get involved with and make changes to, but it's also the least documented and has no API. Whereas the XPCOM layer is clean and documented and has APIs so in some ways it's great to work with because it's designed to be extensible.
A demo follows about trying to dig into the code via DOM inspector.
Google searching hint - put MDC in the search criteria to help narrow the results.
Highlighting of the Code Snippets section in MDC which can really help point you in the right direction.
Thanks for coming and talking with us Mark. I look forward to working on extensions in the future.
Where I share my adventures as a Mozilla Build & Release Engineer and keep notes on my interests, participation, and development in F/LOSS.
Showing posts with label extensions. Show all posts
Showing posts with label extensions. Show all posts
Thursday, October 18, 2007
Monday, October 15, 2007
First extension
Is done.
First attempt lead to error messages about the malformed or non-existent install.rdf file. Well, I knew it existed because I brought it into existence. So I looked around the other mozilla documents and made a replacement install.rdf - no error.
After this point though, I hit a wall because I could install the extension and yet the tabs weren't being added to the side. So I checked the Error Console, no errors related to the addtabbeside extension. After entering some dump() messages in the addtabbeside.js file I try again, starting ff with -console. Nothing to go on.
Anyway, a while later I found mullin on IRC and we troubleshooted it. He knew that the xml spacing is all messed up with you copy and paste from the wiki - I started from scratch paying closer attention to the indentation and voila!
So what I have learned from this is to be careful of indentation when I copy and paste. I look forward to my next extension, when I can really get deeper into modifying the browser, like menu items and whatnot.
First attempt lead to error messages about the malformed or non-existent install.rdf file. Well, I knew it existed because I brought it into existence. So I looked around the other mozilla documents and made a replacement install.rdf - no error.
After this point though, I hit a wall because I could install the extension and yet the tabs weren't being added to the side. So I checked the Error Console, no errors related to the addtabbeside extension. After entering some dump() messages in the addtabbeside.js file I try again, starting ff with -console. Nothing to go on.
Anyway, a while later I found mullin on IRC and we troubleshooted it. He knew that the xml spacing is all messed up with you copy and paste from the wiki - I started from scratch paying closer attention to the indentation and voila!
So what I have learned from this is to be careful of indentation when I copy and paste. I look forward to my next extension, when I can really get deeper into modifying the browser, like menu items and whatnot.
Friday, September 28, 2007
Learning to debug - Part 1
So, I'm trying to hook up the Mozilla Symbol Server in order to better see how my attempts at knitting a source server to it will work.
First - I need to know what version of Firefox I should be doing this with. Currently I have 3 options: ff2, nightly build and my own build from yesterday's class. Talking with Dave on IRC, it seems like the nightly is the one to go with.
Now I need a sure-fire browser crashing bug. A few attempts at finding simple-seeming bugs in mxr is fruitless. I try a Gmail bug, the printer bug - no crash. Then bsmedberg provides me with this.
So, with my visual studio 2005 attached to the process that is Minefield, I install the toxic extension and restart Minefield - "Crash Bang Boom!" (i love this, btw). So now I can see some stuff in Visual Studio. What I'm looking at, I'm not exactly sure yet.
Then I did something and cleared out the results of the crash and now I can't get them back because Minefield crashes too fast for me to attach to process in VStudio. Bsmedberg gave me the following commands to try and get it back:
I'm fiddling with this as we speak.
Stay tuned for part 2 where I hopefully will start to see the use of symbols.
First - I need to know what version of Firefox I should be doing this with. Currently I have 3 options: ff2, nightly build and my own build from yesterday's class. Talking with Dave on IRC, it seems like the nightly is the one to go with.
Now I need a sure-fire browser crashing bug. A few attempts at finding simple-seeming bugs in mxr is fruitless. I try a Gmail bug, the printer bug - no crash. Then bsmedberg provides me with this.
So, with my visual studio 2005 attached to the process that is Minefield, I install the toxic extension and restart Minefield - "Crash Bang Boom!" (i love this, btw). So now I can see some stuff in Visual Studio. What I'm looking at, I'm not exactly sure yet.
Then I did something and cleared out the results of the crash and now I can't get them back because Minefield crashes too fast for me to attach to process in VStudio. Bsmedberg gave me the following commands to try and get it back:
set env NO_EM_RESTART=1
devenv -debugexe firefox.exe -P test
I'm fiddling with this as we speak.
Stay tuned for part 2 where I hopefully will start to see the use of symbols.
Sunday, September 23, 2007
Running 2 versions of Firefox
In IRC chat the other day I asked how often Ted (aka luser) did builds and he said not that often - pointing me instead to the nightly builds saying that he used these instead since they were updated automatically every day.
So I downloaded one and installed it.
Now, my favourite extension is the foxmarks synchronizer app because I find myself travelling between my desktop Mac at home and my PC laptop, as well I will often work at jobs where there's a need for a third foxmarks setup.
This extension doesn't work for 3.0 yet - so I've currently been opening the command window and opening each version with the -Profilemanager so that I can use my default profile for 2.0 (with foxmarks) and my "nightlyBuilds" profile for exploring 3.0
Now I read in a post that I can just manually change the version. Sounds great, but I don't know if I want to go through this everytime there's a new nightly version number.
Anyone else know a better way?
So I downloaded one and installed it.
Now, my favourite extension is the foxmarks synchronizer app because I find myself travelling between my desktop Mac at home and my PC laptop, as well I will often work at jobs where there's a need for a third foxmarks setup.
This extension doesn't work for 3.0 yet - so I've currently been opening the command window and opening each version with the -Profilemanager so that I can use my default profile for 2.0 (with foxmarks) and my "nightlyBuilds" profile for exploring 3.0
Now I read in a post that I can just manually change the version. Sounds great, but I don't know if I want to go through this everytime there's a new nightly version number.
Anyone else know a better way?
Subscribe to:
Posts (Atom)