Can you focus a popup window from a Chrome Extension

前端 未结 1 802
星月不相逢
星月不相逢 2021-02-13 14:16

I have a Chrome Extension that does a window.open() when the extensions icon is clicked. (It can\'t use the traditional Chrome extension popup due to an unrelated bug in Chrome)

1条回答
  •  北海茫月
    2021-02-13 14:29

    Instead of using window.open() use the Chromes chrome.windows.create... http://code.google.com/chrome/extensions/windows.html#method-create
    ...then in the call back you can record its window.id and then any time you want to make it focused you can use chrome.windows.update.

    0 讨论(0)
提交回复
热议问题