I need to inject an object named "smth" to window on pages with specific URLs with nsIDOMGlobalPropertyInitializer. Is there any way to implement this? It'll be ok if window.smth returns undefined on the other pages.
// currently
init: function(aWindow) {
let self = this;
let window = XPCNativeWrapper.unwrap(aWindow);
if (window.location.href !== pageURL) {
return;
}
return {
// ...
}
}
Now window.smth returns XPCOM wrapped nsISupports object on the other pages :(