0

I'm currently developping a chrome extension in order to watch youtube videos in a popup window while browsing an other website.

It works just fine, the problem is that if I click on a link or switch fullscreen app (Mac) the popup disapear, how can I make the popup bubble stay "for ever" ?

The manifest :

{
  "manifest_version": 2,

  "name": "One-Click Youtube",
  "description": "Youtube on one click",
  "version": "1.0",

  "permissions": ["tabs" , "contextMenus"],
  "browser_action": {
    "default_icon": "icon.png",
    "default_popup": "ytplayer.html"
  }
}
Nicolas Charvoz
  • 1,509
  • 15
  • 41

2 Answers2

1

There is an always on top window api for apps. A demo is here: https://chrome.google.com/webstore/detail/floating-youtube/jjphmlaoffndcnecccgemfdaaoighkel

Daniel Herr
  • 19,083
  • 6
  • 44
  • 61
  • +1 That's an interesting possible solution. The requirements did look like an app may be adequate. – Xan Sep 13 '14 at 00:26
0

You cannot. The popup will always close and destroy the page when it loses focus.

This behavior is by design; you need a different UI, maybe open a window with type: "popup".

If and when window type "panel" becomes available (probably never), your question can be solved better.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • Ok so for now I just can't do this .. That's a shame :/ I wanted to watch youtube vids at work without being noticed .. And extension on the Chrome WebApp Store are really bad .. (Not saying mine is the best you'll ever see haha but it works the way i want it to work) – Nicolas Charvoz Sep 12 '14 at 10:24
  • If you are writing this extension for yourself only, you can just use the `--enable-panels` flag for Chrome (or enable them in `chrome://flags/`) and build an always-on-top UI with panels. – Xan Sep 12 '14 at 11:17
  • Do you have any link ? Thx – Nicolas Charvoz Sep 12 '14 at 12:44
  • 1
    See [`windows` API](https://developer.chrome.com/extensions/windows) docs and [this proposal](http://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/panels). – Xan Sep 12 '14 at 12:46