Ashish
(Ashish Sapkale)
1
Hi,
I want to open Popwindow, in center using button click.
var buttons = require('sdk/ui/button/action');
var button = buttons.ActionButton({
id: "My-Button",
label: "My Button",
icon: {
"16": "./16x16.png"
},
onClick: handleClick
});
function handleClick(state) {
var { openDialog } = require('sdk/window/utils');
var window = openDialog({
url: "http://www.google.com",
name: 'MyWindow',
features: 'width=600,height=650,center, minimize=true'
});
}
I am using above code and its opening Popup window, but the window does not has “minimize button” as well as it does not open in Center"
Could you please help me with it?
Regards
Ashish Sapkale
You should check this out for the features you can specify:
https://developer.mozilla.org/en-US/docs/Web/API/Window/open
What you are looking for is the minimizable
property or dialog=false
.
The documentations speaks of “yes” and “no”, this should be “true” and “false”.
For centering, I think you need to look at the top
and left
properties.
Ashish
(Ashish Sapkale)
3
Sorry,
I forgot to mention
I am trying to open Window from Add-on.
erosman
(erosman)
4
Have you tried ‘centerscreen’ instead of ‘center’?
Still, those are the features you can specify for the sdk as well.
Ashish
(Ashish Sapkale)
6
Thanks MartijnJ and erosman,
features: ‘width=600,height=650,center, left=50, top=50, minimizable=yes, chrome=yes, centerscreen=yes’
This feature worked for me. 
Just wanted to confirm, are there any new updates with Firefox 41?
Because “browser.newtab.url” is missing in preferenes 
Thanks again for your help…
erosman
(erosman)
7
It has been replaced with
const NewTabURL = require('resource:///modules/NewTabURL.jsm').NewTabURL;
NewTabURL.override(preferences.prefs['url'] || 'about:newtab');
Look here:
New Tab Override (browser.newtab.url replacement)
noitidart
(Noitidart)
8