Chrome Pack app, always in the top window

I am writing a text editor, I need the application window to always be on top when switching to a browser or e-book reader software. as I know, for Windows users, chrome does not provide any solution. Is there any parameter to send when creating the window so that the window is always on top?

or can I provide any button in the application to enable or disable this feature?

The code I use to create the window in bg.js is:

var launch = function () {
chrome.app.window.create('index.html', {
  type: 'shell',
  width: 440,
  height: 680,
  minWidth: 440,
  maxHeight: 680,
  id: 'paat-start'
});
};
chrome.app.runtime.onLaunched.addListener(launch);
chrome.commands.onCommand.addListener(launch);

Thanks for any suggestion.

+4
source share
2 answers

, (v33 v34) alwaysOnTop chrome.app.windows.create. , manifest.json . :

background.js
chrome.app.window.create('window.html', {
  alwaysOnTop: true,
}, function (appWindow) {
  // Window created and will remain on top of others.

  // Change the property programmatically via:
  //appWindow.setAlwaysOnTop();
});
manifest.json
"permissions": [
  "alwaysOnTopWindows"
]

, , 26427002, 159523002 issue 48113024 !


, alwaysOnTop, ".

issue 326361, , alwaysOnTopWindows. , , Google dev dev (, ).

, , , .

+8

chrome.app.window.create boolean alwaysOnTop Chrome. - , , dev .

+4

All Articles