Reputation: 925
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.
Upvotes: 3
Views: 3191
Reputation: 572
In case you are using a multi-monitor setuo, you need to cascade the calls from the creation because the max mode applies where the window is currently located, therefore, its best to chrome.windows.create in any monitor you may like and then to set the maximized state with the chrome.windows.update.
chrome.windows.create(createData, function onCreated(window) {
console.log('Created');
chrome.windows.update(window.id, {state:'maximized'}, function onUpdated() {
console.log('Maximized');
});
}
});
Upvotes: -1
Reputation: 5118
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
Upvotes: 6