MozillaZine

about: URL: Ignoring unrecognized chrome manifest directive

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

Post Posted October 16th, 2010, 11:48 am

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

Philip Chee

User avatar
 
Posts: 6469
Joined: March 1st, 2005, 3:03 pm

Post Posted October 16th, 2010, 1:23 pm

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

Post Posted October 17th, 2010, 9:33 am

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?

Philip Chee

User avatar
 
Posts: 6469
Joined: March 1st, 2005, 3:03 pm

Post Posted October 17th, 2010, 11:46 am

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

Return to Extension Development


Who is online

Users browsing this forum: Noitidart and 1 guest