Hi,
From xpfe/global/resources/content/printProgress.js file,I want to
close the browser.Completion of printing will be indicated through
progressListener's onStateChange function.So inside
if (aStateFlags &
Components.interfaces.nsIWebProgressListener.STATE_STOP) block,
I'm trying this code:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
win.BrowserCloseTabOrWindow();
But I'm getting the following error:
Call to xpconnect wrapped JSObject produced this error: *
[Exception... "'[JavaScript Error: "Components is not defined" {file:
"chrome://global/content/printProgress.js" line: 94}]' when calling
method: [nsIWebProgressListener::onStateChange]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "<unknown>"
data: yes]
But Components.interfaces etc has been used at other places in the same
file.If anybody has an idea regarding this,plz post it.
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom