即使只有单个固定元素,chrome应用程序滚动也不起作用

asd*_*asd 1 html javascript scroll google-chrome google-chrome-app

我有以下Chrome应用。运行它时,显示主窗口,但鼠标滚轮不起作用。当我在Chrome中打开main.html时,滚动效果很好。如何解决?

manifest.json:

{
  "name": "Scroll not working",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Scrolling in this chrome app is not working",
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

background.js:

// Background script (displays main window)
'use strict';
chrome.app.runtime.onLaunched.addListener(function () {
    chrome.app.window.create('main.html');
});
Run Code Online (Sandbox Code Playgroud)

main.html:

{
  "name": "Scroll not working",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Scrolling in this chrome app is not working",
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

Day*_*ang 5

chrome打包的应用程序应用了一些默认CSS。Chrome打包的应用最常用于不滚动主体内容。将以下内容放入CSS应该会重新启用滚动:

html, body {
    overflow-y:auto;
}
Run Code Online (Sandbox Code Playgroud)