Microsoft Screwed Up Activities API Docs - It’s addService NOT AddService
UPDATE: jst ROCKS! - I was able to do exactly what he said and I now have both cases of APIs working in my extension.
OK, this is really starting to bother me because Activities are starting to show up and they don’t work on Firefox because Microsoft screwed up the documentation.
The correct syntax for adding an Activity (per my conversation with Microsoft) is:
window.external.addService('FindInWikipedia.xml');as documented here
NOT
window.external.AddService('FindInWikipedia.xml');as documented here. (I have no idea what the whitepaper says - I can’t agree to the license agreement.
Note the lowercase a at the beginning. Even though both work on IE, USE THE LOWERCASE addService!
You would think people would have just cut and paste the code from the Activity Providers site and got it right.
Incidentally, if anyone knows how to create an API in Firefox that will work with either case, that would be great. Then I could work like Internet Explorer.
Comments
Comment from asdf
Date: March 26, 2008, 2:09 pm
window.external.IsServiceInstalled
window.external.AddService
that’s what in the whitepaper, but you probably knew that already ![]()
Comment from Albert
Date: March 26, 2008, 2:44 pm
The whitepaper mentions both addService and AddService, even on the same page. Looks like a quick & dirty job to me…
Comment from Johnny Stenback
Date: March 26, 2008, 4:49 pm
If you’re implementing this using XPCOM interfaces it would seem to me that you could create two unrelated interfaces (no inheritance relationship between the two), one defining “addService”, the other defining “AddService” and you advertise both these interfaces through an nsIClassInfo implementation callers should be able to call either function.
Comment from Bob
Date: March 31, 2008, 1:23 pm
Deep breath, man. Bugs happen. It’s a Beta (heck, it’s a Developer Preview).
Pingback from My first “Activity” « Coenwulf.0
Date: April 3, 2008, 12:53 am
[…] figure out how to get the information I wanted to put into the post to del.icio.us. Also, thanks to this post for causing me to think that it’s time to write […]
Comment from Thomy Kay
Date: April 7, 2008, 3:01 am
I created an activity xml according to a href=”http://msdn2.microsoft.com/en-us/library/cc289775(VS.85).aspx”>http://msdn2.microsoft.com/en-us/library/cc289775(VS.85).aspx.
IE is able to deal with namespaces correctly (os:* elements), your implementation is not. One reason is that it searches for element names without namespaces.
Would be good to support namespaces correctly in your plugin.
Pingback from Mike’s Musings » Update on Activities, Microformats and Operator
Date: April 29, 2008, 3:02 pm
[…] is much better, and I was able to support both the uppercase and lower case version of the API (which I complained about earlier). In addition, the code has been substantially rewritten so that it doesn’t affect the global […]

Write a comment