mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-28 13:39:44 +07:00
18 lines
459 B
JavaScript
18 lines
459 B
JavaScript
chrome.app.runtime.onLaunched.addListener(function() {
|
|
// Center window on screen.
|
|
var screenWidth = screen.availWidth;
|
|
var screenHeight = screen.availHeight;
|
|
|
|
var b = {
|
|
width: Math.round(screenWidth * 2/4),
|
|
height: Math.round(screenHeight * 2/4),
|
|
left: Math.round(screenWidth * 1/4),
|
|
top: Math.round(screenHeight * 1/4)
|
|
};
|
|
|
|
chrome.app.window.create('window.html', {
|
|
id: "keyboardWinID",
|
|
outerBounds: b
|
|
});
|
|
});
|