I am trying to create a new window using the code below :
var createData = {
"url" : wikiUrl ,
"type" :"popup" ,
"top" : 5 ,
"left" : 5 ,
"width" : Math.round((chrome.windows.getCurrent().width)/2),
"height" : Math.round((chrome.windows.getCurrent().height)/2)
chrome.windows.create(createData,function(){}) ;
But get
Error at parameter 'createData': Error at property 'width': Invalid type: expected integer, found number.
The values of width
and height
are being set as NaN
(through debugging) .
But setting the height and width like below :
"width" : ((chrome.windows.getCurrent().width)),
"height" : ((chrome.windows.getCurrent().height))
does create a new window with lesser dimensions than the current window .
why does this happen ?
I'm guessing there is some kind of limit to dimensions of the new windows created, But I don't find any documentations regarding it .