Chrome扩展程序最大化当前窗口 [英] Chrome Extension Maximize Current Window

查看:392
本文介绍了Chrome扩展程序最大化当前窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,有关如何操作窗口的说明可在此处找到。但我很难跟进,并会非常感谢,如果有人可以解释,例如,如何最大限度地利用当前窗口。



我知道如何使用chrome.windows函数创建一个窗口,但我不知道如何使用相同的函数来操作现有的窗口。



我知道我需要设置<一个href =https://developer.chrome.com/extensions/windows#type-WindowState =nofollow> WindowState 最大化。我只是不知道如何在动作脚本中这样做。

解决方案

您可以尝试使用chrome.windows.update :

$ p $ chrome.windows.update(yourWindowId,{state:maximized},function(windowUpdated){
//用最大化窗口
}来做任何事情);

您可以使用chrome.windows.getCurrent,chrome.windows.getLastFocused或chrome获取窗口的ID。 windows.getAll


I understand that directions on how to manipulate windows are found here. But I'm having a hard time following along and would greatly appreciate if someone could explain, for example, how to maximize the current window.

I know how to use the chrome.windows functions to create a window, but I'm not sure how to use the same functions to manipulate an existing window.

I know that I need to set WindowState to maximized. I just cant figure out how to do so inside of an action script.

解决方案

You could try to use chrome.windows.update:

chrome.windows.update(yourWindowId,{state:"maximized"},function(windowUpdated){
    //do whatever with the maximized window
});

You can get the window's id using chrome.windows.getCurrent, chrome.windows.getLastFocused or chrome.windows.getAll

这篇关于Chrome扩展程序最大化当前窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆