Chrome应用程序outerBounds未正确设置

时间:2015-02-23 01:29:55

标签: javascript google-chrome background-process

我正在尝试制作一个悬挂在屏幕右侧的模块。这是我的background.js

chrome.app.runtime.onLaunched.addListener(function() {
  var users_screen_width = window.outerWidth, //these are both coming back as 0
      users_screen_height = window.outerHeight;
  chrome.app.window.create("index.html", {
    id: "testWindow",
    outerBounds:{
      width:40, //none of these bounds are being set correctly.
      height:250, //none of these bounds are being set correctly.
      left:1440, //none of these bounds are being set correctly.
      top:250 //none of these bounds are being set correctly.
    },
    frame:"none",
    resizable:false,
    alwaysOnTop:true
  },function(data){
     console.log(data); //this is below...
  });
});

记录响应

outerBounds: 
   height: 300
   left: 540
   maxHeight: null
   maxWidth: null
   minHeight: null
   minWidth: null
   top: 280
   width: 458

是否有最低高度和宽度要求?如果是这样,我没有在任何文档http://developer.chrome.com/apps/app.window.html

中阅读此内容

有人能告诉我这里有什么问题吗?另外,如何使用eventListener动态移动窗口?

0 个答案:

没有答案