Chrome扩展程序最大化当前窗口 [英] Chrome Extension Maximize Current Window
问题描述
据我所知,有关如何操作窗口的说明可在此处找到。但我很难跟进,并会非常感谢,如果有人可以解释,例如,如何最大限度地利用当前窗口。
我知道如何使用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屋!