Since NPAPI provides a good framework for loading plugins based on MIME type and otherwise interacting with the browser, it may be reasonable to add the missing hook(s) to make custom script types possible.
When a custom script type is first detected on a page,
- Look for a plugin handling the script's type (can be cached)
- Query NP_GetValue to see if it supports custom scripts of the given type (can be cached)
- If so, NPP_New a windowless plugin instance to handle all scripts on the page. Otherwise use the current behavior of ignoring the script. (It might be good to print a status message or log an error.)
- NPP_Destroy this instance when the page is closed