Question

i am writing a NPAPI plugin for that i am using NPSIMPLE sample code from google chrome. i have to get the DOM of web page opened in the chrome browser. My plugin solution also includes background.html file. which when i open in chrome browser calls a method in NPAPI plugin. so my plugin can get the URL of this file. now i want to read the DOM structure of this File.

i have few questions:

  1. when a new page is opened in browser by user how i have to embed my plugin to that page and get the DOM of that page?

  2. whenever a new tab is opened how can i get the notification in My plugin?

  3. How to get the DOM mutation notification to my plugin?

  4. Does NPAPI provides API to get the DOM mutation notification or Content Script is the only option? if content script is the only option then how to establish communication between plugin and content_script?

i am trying to get this answers as well. any help greatly appreciated...

thanks in advance...

Was it helpful?

Solution

1) The only way you could do this automatically would be to put the plugin inside an extension and do it with the extension.

2) You can't, since plugins don't know anything outside of the page they are in. You might be able to jury-rig something using an extension, I suppose, but I'm not sure if that's possible or not.

3 and 4) Your best bet is probably to figure out how to get these notifications with javascript and inject javascript that will call back into your plugin.

Sounds like one of your main sticking points is that you aren't clear on what a plugin can do; you may want to read up a bit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top