about: URL: Ignoring unrecognized chrome manifest directive

Talk about add-ons and extension development.
Post Reply
Calimo
Posts: 12
Joined: October 8th, 2004, 8:37 am

about: URL: Ignoring unrecognized chrome manifest directive

Post by Calimo »

Hello,

I would like to add an about: URL to my extension.
I followed the instructions in https://developer.mozilla.org/En/Custom_about:_URLs . I created a file "registerExcerpts.js" and put it in the "components" directory.

However, when I put the EXTRA_PP_COMPONENTS to my chrome.manifest, I get the following errors in the error console after restarting:

Code: Select all

Warning: Ignoring unrecognized chrome manifest directive 'EXTRA_PP_COMPONENTS'.
Warning: Ignoring unrecognized chrome manifest directive 'aboutMyService.js'.
Warning: Ignoring unrecognized chrome manifest directive '$(NULL)'.

This is in Firefox 4 beta6. In 3.6 I get more generic errors (Warning: Ignoring unrecognized chrome manifest instruction) but it doesn't work either.

I guess the "Manifest" file mentioned in the tutorial is not chrome.manifest, but which one is it? Where do I put the js code?

Thanks,
Calimo
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: about: URL: Ignoring unrecognized chrome manifest direct

Post by Philip Chee »

Urm,

That URL is about adding a new about: *TO* Firefox (or your Mozilla based application). For adding a JS component to your own extension you will need to see:
https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_2.0#Component_registration

Phil
Calimo
Posts: 12
Joined: October 8th, 2004, 8:37 am

Re: about: URL: Ignoring unrecognized chrome manifest direct

Post by Calimo »

Thanks for your answer.
Now I get the following error:

Code: Select all

While creating services from category 'profile-after-change', could not create service for entry 'aboutMyService', contract ID '@mozilla.org/network/protocol/about;1?what=myservice'


In my chrome.manifest:

Code: Select all

component {8ae875d5-a210-4996-8788-489248f18d74} components/aboutMyService.js
contract @mozilla.org/network/protocol/about;1?what=myservice {8ae875d5-a210-4996-8788-489248f18d74}
category profile-after-change aboutMyService @mozilla.org/network/protocol/about;1?what=myservice
and in components/aboutMyService.js:

Code: Select all

 […]function aboutMyService() { }

aboutMyService.prototype = {
classDescription: "about:myservice",
contractID: "@mozilla.org/network/protocol/about;1?what=myservice",
classID: Components.ID("{8ae875d5-a210-4996-8788-489248f18d74}"),
[…]
What's still wrong?
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: about: URL: Ignoring unrecognized chrome manifest direct

Post by Philip Chee »

Calimo wrote:In my chrome.manifest:

Code: Select all

component {8ae875d5-a210-4996-8788-489248f18d74} components/aboutMyService.js
contract @mozilla.org/network/protocol/about;1?what=myservice {8ae875d5-a210-4996-8788-489248f18d74}
category profile-after-change aboutMyService @mozilla.org/network/protocol/about;1?what=myservice

For an about redirector you don't need the last line:

Code: Select all

category profile-after-change aboutMyService @mozilla.org/network/protocol/about;1?what=myservice

Phil
Post Reply