- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道有一个最大化功能,但我的老板希望能够单击他的 yosemite mac 上的绿色小按钮。
这曾一度有效,但现在绿色小按钮被禁用。
我正在使用这样的窗口大小:
service.setChromeToMinSize = function(){
var monitorWidth = window.screen.availWidth;
var monitorHeight = window.screen.availHeight;
var top = Math.round((monitorHeight / 2) - (568 / 2));
var left = Math.round((monitorWidth / 2) - (400 / 2));
chrome.app.window.current().innerBounds.maxWidth = 400;
chrome.app.window.current().innerBounds.maxHeight = 568;
chrome.app.window.current().innerBounds.minWidth = 400;
chrome.app.window.current().innerBounds.minHeight = 568;
chrome.app.window.current().innerBounds.top = top;
chrome.app.window.current().innerBounds.left = left;
chrome.app.window.current().innerBounds.width = 400;
chrome.app.window.current().innerBounds.height = 568;
};
service.setChromeToVideoSize = function(){
var monitorWidth = window.screen.availWidth;
var monitorHeight = window.screen.availHeight;
var videoWidth = Math.round(monitorWidth/2);
var videoHeight = Math.round(videoWidth * 9 / 16);
var top = Math.round((monitorHeight / 2) - (videoHeight / 2));
var left = Math.round((monitorWidth / 2) - (videoWidth / 2));
chrome.app.window.current().innerBounds.maxWidth = 10000;
chrome.app.window.current().innerBounds.maxHeight = 10000;
chrome.app.window.current().innerBounds.minWidth = 1;
chrome.app.window.current().innerBounds.minHeight = 1;
chrome.app.window.current().innerBounds.top = top;
chrome.app.window.current().innerBounds.left = left;
chrome.app.window.current().innerBounds.width = videoWidth;
chrome.app.window.current().innerBounds.height = videoHeight;
};
但即使有这么多评论,我也遇到了同样的问题。
我像这样启动应用程序:
chrome.app.runtime.onLaunched.addListener(function(launchData) {
chrome.app.window.create(
'index.html',
{
id: 'mainWindow',
bounds: {width: 400, height: 568},
minWidth: 400,
minHeight: 568,
maxWidth: 400,
maxHeight: 568
}
);
});
问题:如何启用绿色小按钮?
最佳答案
正如评论中所指出的,您必须将innerBounds maxWidth
和maxHeight
设置为null
,而不是一个很大的数字。
来自the bounds type documentation :
A value of null indicates 'unspecified'.
虽然没有提到对全屏模式的限制,但在设置 maxWidth/Height 的情况下禁用全屏模式在某种程度上是有意义的。
关于javascript - Chrome 应用无法最大化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30866497/
给定一个包含 n 个非负整数的数组:A1、A2、...、AN。如何找到一对整数 Au, Av (1 ≤ u ans) { ans=arr[i] & arr[j
有人知道这段代码的正确解决方案吗? BOOL maximized = [myWindow isMaximized]; 最佳答案 也许看看 isZoomed 关于cocoa - NSWindow 最大化
当前有一个 MySQL 数据库,但遇到 MySQL 以 600% CPU 使用率运行的问题。 规范: 2.3 GHz Intel Xeon® E5-2686 v4 (Broadwell) 处理器或 2
我已将 Skype 配置为在 Windows 启动时最小化启动。 现在我需要通过全屏应用程序按钮中的一个按钮将 Skype 置于最前面。我有这段代码: For Each p As Proces
我已经有一段时间没有做任何生疏的程序了。我正在研究代码以最大化和最小化其他应用程序。所以我找到了一些基本的东西,这就是我所拥有的,对原来的东西稍作修改。它希望我生成一些我所做的 FindWindow
我有一个 Windows CE 应用程序,它记录移动设备的击键。有一个用于初始化录制功能的按钮,它通过调用强制主窗口最小化: ShowWindow (hWnd, SW_MINIMIZE); 在最小化窗
我想显示一个占据尽可能多屏幕空间的对话框。 所以,这是一个示例: AlertDialog dialog = new AlertDialog.Builder(ctx)......create(); Wi
对Wndows用户来说,最小化/最大化/关闭按钮放在系统窗口的右上角是肯定的。而大多数朋友都是成为Wndows用户之后才成为Ubuntu用户的,因此Ubuntu程序窗口中将这些按键放在左上角使用起来
1.Ctrl+Alt+T调出终端 2.首先安装gconf-editor: sudo apt-get install gconf-editor 会提示叫你安装 gconf-editor 安装完成
Width最大化窗口时,屏幕的属性似乎没有更新到完全最大化的宽度。如果我调整它的大小,一切正常,但在最大化时就不行。 我的代码如下: private void Window_SizeChanged(o
我正在这个 fiddle 中使用指令和 = 绑定(bind)。我收到以下错误: Uncaught Error: 10 $digest() iterations reached. Aborting! W
是否有任何快捷方式可以最大化您在 Eclipse 中使用的选项卡?假设我正在处理代码的一部分,并且我想最大化选项卡而不是使用鼠标双击它,有人知道一种方法吗? 最佳答案 CtrlM 将最大化/恢复编辑器
在 Glassdoor 评论中遇到这个问题,觉得很有趣。 Given an integer consisting of 4 digits, we need to maximize it in 24 h
在 VB6 中,我创建了一个带有一些文本框、列表框和命令按钮的表单。我使用类似 的方法设置所有这些控件的 X-Y 位置 control2.Top = form.Height * 0.50 'set
到处都有人告诉我使用这个: frame.setExtendedState(JFrame.MAXIMIZED_BOTH); 但问题是我的 JMenuBar 时断时续地消失(发生在我身上的奇怪错误),并且
我有一个 JDesktopPane 和一个 JInternalFrame。我希望 JInternalFrame 在创建后自动最大化。如何对“最大化窗口”事件进行硬编码? 最佳答案 使用JInterna
这个问题已经有答案了: JFrame doesn't take the actual screen size (2 个回答) 已关闭 3 年前。 我想最大化我的 JFrame,就像按下“关闭”旁边的按
我正在使用 vim 和 python 编程,并使用 tpope's vim-dispatch通过运行当前文件 :Dispatch python main.py 程序的打印输出被定向到quickfix窗
假设我们有一个名为 total 的 NSDecimal 常量,它包含 3.33333333 除以 10/3 的值。 10 和 3 都是NSDecimalNumber。我们希望 Swift 中的 NSD
有谁知道如何在发生特定操作后最大化 JFrame?我将在下面发布我的代码,我是一个不评论我的代码的恶魔(我会在某个时候这样做)但它应该是相当 self 解释的。我试图做的是在从菜单中选择选项后使框架最
我是一名优秀的程序员,十分优秀!