0
votes

I'm writing an npapi plugin in Qt. My plugin works perfectly on firefox and opera. The problem in chrome i guess is regarding the "process-per-plugin" setup. What happens is, when i first open a page, the plugin is injected and all works as per expected. But when i navigate from that page to another one, in the new page, the plugin seems to get injected but even its constructor isnt called.

To examine the issue, I tried killing my plugin process via the chrome task manager before i navigate to the new page. When i do this, the plugin works as expected in the 2nd page too. I'm unable to comprehend what is happening here. Any help would be appreciated.

Thanks

1
Are you using Qt in a plain NPAPI plugin or a QtBrowserPlugin?Georg Fritzsche
I'm using a Qtbrowserplugin. I solved this issue by doing a display:none before i leave a page. This seemed to call the destructor of the plugin and hence solved my problem. THanks!kambamsu

1 Answers

0
votes

The creation and destruction of browser plugin depends on the browser. So if your constructor is not being called means that your plugin has not been destroyed. So you have to handle your object construction and destruction in plugin's window attached and window detached events.