Annoucement! New project goals. I’m trying bug 625344, and bug 624302 (if time permits). So, my overall CP3108 Mozilla project can be described as “Improving some features of Firefox Clear Recent History”, isn’t it?
About bug 625344 : Clear All History dialog window missing accesskeys for Cancel and Clear
I’ve listed the approaches for this problem: first, because I’ve figured out where the exact location of the function Clear Recent History (sanitize.js, see my older post), I tend to call some method that (maybe?) allow an accesskey for the Clear Now and Cancel button. Secondly, I will try to find the XUL file which contains the Clear Recent History layout, than add the accesskey command (this approach was made after going around MDC). The third approach is, using DOM Inspector to edit the Clear Now and Cancel button (?). The last approach seems like the easiest, however I didn’t use DOM Inspector much before, so everything is still in the dark.
For the first approach, after spent quite some time looking on mxr and learn how other source file can use the accesskey, I can see that there is no such method allow accesskey for a button. Instead, they use HTML and XUL to add the accesskey attribute to the button. This is easy to do because you only have to modify one line of code. And this led to the second approach.
For the second approach, I can find the sanitize.xul quite fast, and it contains almost everything of the Clear Recent History dialog, but… the Clear Now button (as you can see in the link). Then I tried to search for more, and find browser.properties, sanitize.dtd, which also contain the Clear Recent History dialog information, but still I couldn’t find out how to edit the ClearNow button. Anyway I think I’ll spend more time in the weekend for this, and hope that I can finish it by the next Monday
.
About bug 624302: Clear Recent History should clear the Find box
As the tile says, I think you can know that now the Clear Recent History doesn’t clear the Find box (the little find bar appears after you press Ctrl+F on Firefox). So the clear purpose of this bug is to clear anything inside the Find box, which sounds logical to me.
So I spend time figuring out how the find bar is created, initialized and and also how it works. Nevertheless the main use of find bar is for XUL, not Javascript (and the code I want to add to clear the find box is in Javascript, sanitize.js), so I searched to see if any other .js files use the find bar. They do, but after learning and using them into my code, it doesn’t work. I guess I’ll spend more time on this then…
Anyway, that’s it. The project is on the way, and let’s have it done before the final presentation!
Preference :
https://developer.mozilla.org/en/XUL/Attribute/accesskey
https://developer.mozilla.org/Talk:en/XUL_Tutorial/Keyboard_Shortcuts
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sanitize.xul#108
http://mxr.mozilla.org/mozilla-central/source/browser/locales/en-US/chrome/browser/browser.properties#126
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sanitizeDialog.js
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sanitize.xul#63