In Firefox when I am running the following code:
var clazz = Components.classes["@mozilla.org/messenger;1"];
This error is coming:
TypeError: Components.classes is undefined
Please see this link: http://jsfiddle.net/BbrvX/
For information about Components.classes
visit the following link:
https://developer.mozilla.org/en/docs/Components.classes
Components.classes
is for chrome code, extensions or browser development. You don't have access to it in content pages.
If you are developing your addon using the Addon SDK you should use this idiom:
var { Cc } = require("chrome");
var clazz = Cc["@mozilla.org/messenger;1"];
where Cc stands for Component.classes. You can read more on this here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With