MozillaZine

id="mainKeyset" on XUL keyset, yes or no?

Talk about add-ons and extension development.
another_sam

User avatar
 
Posts: 22
Joined: August 15th, 2007, 9:46 pm

Post Posted August 15th, 2007, 10:39 pm

These days I'm trying to make an extension for Firefox that uses a keyboard shortcut.

I have just found that, in a Firefox (2.0.0.6 or 3a8pre) with no extensions, keyboard shortcut doesn't work if keyset id is not "mainKeyset", but if I install Adblock Plus to that Firefox, keyboard shortcut work both with id="mainKeyset" or with no specified id.

Why occurs this? It's "a bug or a feature"? It's pretty rare isn't?

I've posted a discussion also in http://developer.mozilla.org/en/docs/Ta ... _Shortcuts

note: I think this also occurs with commandset id="mainCommandSet" in XUL or Noscript as extension, but I have not tested it thoroughly.

Thanks,

mikelward
 
Posts: 29
Joined: November 14th, 2002, 12:31 am
Location: Melbourne, Australia

Post Posted November 13th, 2007, 11:17 pm

I think this is the reason my version of <a href="http://mikelward.com/software/firefox/mac-shortcuts">Mac Shortcuts</a> works in Firefox, but not in Sunbird. Firefox's main keyset has an id, but Sunbird's doesn't.

Will be easy to test...

mikelward
 
Posts: 29
Joined: November 14th, 2002, 12:31 am
Location: Melbourne, Australia

Post Posted November 13th, 2007, 11:23 pm

I'm probably wrong. I tried removing the mainKeyset attribute from my Firefox extension, and it still seems to work. (Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9)

np

User avatar
 
Posts: 301
Joined: October 18th, 2007, 6:31 pm
Location: Winnipeg

Post Posted November 14th, 2007, 9:39 pm

Keysets don't need that ID to work. They may need that ID if you're using them in an overlay and you're expecting them to be applied to the document you're overlaying. I don't know why having Adblock would be different - maybe it's doing something to get around that restriction and your keys are going along for the ride.

johny146
 
Posts: 13
Joined: July 27th, 2007, 5:25 pm

Post Posted December 18th, 2007, 4:19 am

They should mention this in a big fat bold red font on the MDC cause i waisted hours searching for this info, until a nice forum member gave me the answer. I am really getting annoyed about those little things which aren't documented clearly and make the development of my extension so much harder.

(PS Really, if i knew this before i started with the firefox extension i would have tried my luck on IE. At least msdn does have some solid documentation, which is a shame cause the possibilities with FF are almost limitless if you at least know how to use it)

Zoolcar9

User avatar
 
Posts: 2224
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted December 18th, 2007, 5:14 am

On Overlays and ID Attributes, MDC wrote:The layout engine uses the ID attribute to determine where the elements in the overlay file will be merged. Use the same IDs in the base XUL file and the XUL overlay; otherwise, the new elements will not appear at all. In the base file, the parent nodes for the overlay elements must be ID'd if they have not been already.

johny146 wrote:They should mention this in a big fat bold red font on the MDC cause i waisted hours searching for this info, until a nice forum member gave me the answer. I am really getting annoyed about those little things which aren't documented clearly and make the development of my extension so much harder.

Go to http://developer.mozilla.org/en/docs/Overlay#Overlays_and_ID_Attributes, click [Edit], and changed the text format to big fat bold red font.

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest