开发者

nsIDOMNSHTMLElement IID change

I am writing Firefox extension which would be compatible with Firefox's 3.0 to 3.6 versions.

I am using nsIDOMNSHTMLElement interf开发者_如何学Goace pointer for setting inner text of html element. I am getting nsIDOMNSHTMLElement interface pointer by calling QI on nsIDOMElement

But IID of nsIDOMNSHTMLElement changes from Firefox's 3.0 to 3.6 versions as gecko version changes.

How can I use nsIDOMNSHTMLElement interface?

How can I compile my extension so that It will work with above mentioned Firefox versions.

Thanks, Vaibhav.


https://developer.mozilla.org/en/Working_with_Multiple_Versions_of_Interfaces

Basically, when building your component, prepare all versions of the changed interfaces (e.g. from 3.0 and 3.6) and their IIDs, then in code first try to QI by the newer IID (and use the newer class declaration for the interface), and if that fails, QI using the old IID (and use the old declaration of the interface).

P.S. And I do recommend you to stop wasting your time and write in JS, whenever possible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜