My query is similar to this global.html is unable to load NPAPI plugin from safari-extension builder but its loading from the direct link.
How can I load a NPAPI Plugin from a Safari extension?
My query is similar to this global.html is unable to load NPAPI plugin from safari-extension builder but its loading from the direct link.
How can I load a NPAPI Plugin from a Safari extension?
The simple answer is that you can't. Unlike firefox and chrome extensions, Safari extensions don't allow you to embed npapi plugins in them.
You can create toolbar in Safari extension
Load npapi to the toolbar
On start extension make it invisible
Get toolbar object
Get plugin object from toolbar object
try {
var toolbarWindow = safari.extension.bars[0].contentWindow;
safari.extension.bars[0].hide();
var doc = toolbarWindow.document;
var plugin = doc.getElementById("plugin");
if (plugin)
plugin.samefunction();
} catch(e) {
}
tested on Safari 5.1, 6.0