Closed
Bug 676029
Opened 14 years ago
Closed 14 years ago
Need module to create non-browser windows
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: christoph, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build ID: 20110413222027
Steps to reproduce:
I wish to open a window that will persist its own position and sizing.
Actual results:
Using the `WINDOWS` module will only create browser windows (windowtype="navigator:browser") that if moved or resized affect the position and size of the browser windows after restart.
Expected results:
I need a way to create a window that is not of windowtype="navigator:browser".
Comment 1•14 years ago
|
||
You can create arbitrary windows using the very-low-level nsIWindowWatcher XPCOM interface. To access the interface, do the following:
const { Cc, Ci } = require("chrome");
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
Then use the interface's openWindow method <http://mxr.mozilla.org/mozilla-central/source/embedding/components/windowwatcher/public/nsIWindowWatcher.idl#101> to open the window. See various openWindow calls in the core packages for examples, including one in run-tests.js <https://github.com/mozilla/addon-sdk/blob/master/packages/test-harness/lib/run-tests.js#L45>.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 2•14 years ago
|
||
Will page-mods still work with this window? If not how can we get them working?
Comment 3•14 years ago
|
||
I think page-mods will work with a browser or iframe element inside a custom chrome window, but I'm not sure. cc:ing Alex, who might know.
Comment 4•14 years ago
|
||
page-mod use "content-document-global-created" event, so only "content" documents are going to be matched by page-mods.
So all documents inside a <browser type="content" /> are going to work.
And it may work with your main window document, if you omit "chrome" from windows feature while calling nsIWindowWatcher.openWindow.
You need to log in
before you can comment on or make changes to this bug.
Description
•