سؤال

I'm building a NPAPI plugin for Chrome/Firefox.

From the plugin I would like to get the focus of the browser, and select the tab in which my plugin is rendered, from wherever the user are in OS UI.

For now I'm able to get focus of the browser, by using SetForegroundWindow(HWND); or SwitchToThisWindow(HWND, BOOL); on parent HWND of plugin window. Also I'm able to select tab, by making alert inside it. Anyway alert dialog is ugly, and it's impossible to close it.

Is there some way to select the right tab from NPAPI native code? Or from JavaScript?

NB: I'm using Firefox Nightly for tests.

هل كانت مفيدة؟

المحلول

You cannot control anything outside of your own plugin window from NPAPI because NPAPI is unaware of anything outside of the page. NPAPI does not know anything about the browser itself or other pages. This is by design. If there is any way without using system APIs to do what you're trying to do it'd be an extension thing, but I doubt it.

Frankly, this just isn't the sort of thing that plugins are supposed to be able to do =]

see http://npapi.com/extensions

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top