npapi

Safari plugin crashes on NPN_GetValue

纵然是瞬间 提交于 2019-12-12 06:23:10
问题 My plugin code crashes when I call the NPN_GetValue. Basically I created a scriptable object which has a 'getDevice' method that can return a device array to JavaScript. Below is the code snippet. static bool mainNPObjectInvoke(NPObject *obj, NPIdentifier identifier, const NPVariant *args, uint32_t argCount, NPVariant *result) { printf("create main object"); MainNPObject *mainObject = (MainNPObject *)obj; if (identifier == methodIdentifiers[METHOD_ID_GET_DEVICES]) { NPObject *windowObj = NULL

NPAPI alternative for live file editing

∥☆過路亽.° 提交于 2019-12-12 02:52:20
问题 I currently have a web app, which allows users to download files to their computers, edit them with their own editors and automatically sends them back to server upon saving and sends some extra data when closing the file. It utilises a Java applet to handle the client side processing which includes file download, sending request to lock the file, opening the file in default desktop app, watching for changes, file upload back to server, sending request to unlock the file upon closing. Since

JavaScript and Scriptable NPAPI plugin string data on Google Chrome

♀尐吖头ヾ 提交于 2019-12-12 02:34:17
问题 I created a simple scriptable npapi plugin. It works fine to pass string between JavaScript and plugin on FireFox. But it will generate some extra random characters on Google chrome if the string contains hyphen (-) symbol. For example, in my JavaScript code, I have plugin.method("a-b"); on my npapi code, I have bool ScriptablePluginObject::Invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) { char* outString = args[0].value.stringValue.UTF8Characters; char*

Npapi plugin crash in firefox

让人想犯罪 __ 提交于 2019-12-12 01:53:19
问题 I'm writing a npapi plugin can sign pdf document, my plugin worked in chrome, ie but in firefox when my plugin export a dialog as image i can't input anything then my plugin is crashed. Can you tell me why i can't input anything when my plugin call a dialog of windows? 回答1: From the response to the same question you asked on the firebreath-dev group: You must never block the main (UI) thread in a plugin. Run your dialog on another thread and it'll probably work. 来源: https://stackoverflow.com

how to display a input box on safari with NPAPI plugin

我的梦境 提交于 2019-12-11 17:53:49
问题 As we all know, we can show input box with html element.like this.<\input type="text" name="" value="" >. but now I want to display this input box on safari with NPAPI plugin. when I embed this plugin the box should show on safari. I found a npapi sample named "NPAPI Core Animation Movie Plugin" in https://developer.apple.com/library/archive/samplecode/NPAPI_Core_Animation_Movie_Plugin/Introduction/Intro.html . In this sample, it draws anything that will show on safari. But I want to know

Return an integer/String from NPAPI plugin to JavaScript(Not using FireBreath)

筅森魡賤 提交于 2019-12-11 14:32:17
问题 Could anyone please explain with a sample...? How can I return an integer/String from NPAPI plugin( Not using FireBreath ) to JavaScript? I searched a lot ..but can't get a relevant answer. 回答1: You need to make a Scriptable class of NPObject: Simple class definition and implementation You can this post use in Firefox/Chrome browser. Its very similar to your question and has code for the invoke and the JavaScript/html. here. If you have not read through at least part 1-3 of taxillian's blog

npWindow->window gives 0 value in NPP_SetWindow function, plugin for Safari browser on Mac

守給你的承諾、 提交于 2019-12-11 13:57:46
问题 A plugin, which works fine in firefox on windows, is being now ported to safari on Mac. we are using Xcode for development. we want a window in safari browser over which a video can be displayed. I read a code regarding NSwindow being used in NPP_SetWindow function as following: NPError NPP_SetWindow(NPP instance, NPWindow* npWindow) { // Get a Cocoa window reference of the browser window NP_CGContext* npContext = (NP_CGContext*)npWindow->window; WindowRef window = npContext->window; NSWindow

Is it possible to create a binary extension that can run on Chrome OS?

ε祈祈猫儿з 提交于 2019-12-11 13:32:02
问题 Chrome supports binary extensions on all platforms. But I cannot decide whether Chrome OS supports them too... 回答1: Nope, they are disabled on purpose. See this, this, this. 回答2: They don't support NPAPI, but they do support the new native client architecture NaCL. For more information regarding the difference: http://dev.chromium.org/nativeclient/getting-started/getting-started-background-and-basics If your binary extension uses PPAPI rather than NPAPI, it will definitely work on Chrome OS.

How do I get an NSView in a cocoa event model NPAPI plugin

旧城冷巷雨未停 提交于 2019-12-11 13:02:31
问题 I've followed the NetscapeCocoaPlugin example from the nightly Webkit build, and I'm able to build a NPAPI style plugin that uses the Cocoa Event Model. My question now, is how I can get the NSView inside NPP_SetWindow. A poster in this thread, says that it's possible using [NSView focusView], but I haven't been able to get this to work My current function looks like this: NPError NPP_SetWindow(NPP instance, NPWindow* window) { PluginObject *obj = instance->pdata; obj->window = *window; NSLog

NPAPI plugin hang ui shows after modal dialog popup on firefox

允我心安 提交于 2019-12-11 11:53:40
问题 Here is what I am trying to do: My partner's NPAPI plugin calls a function in my vc dll, My function displays a modal dialog and accepts user input. But after the dialog shows, firefox's plugin-hang-ui will popup after a few seconds and I have to manually close it or the NPAPI plugin will crashes after another few seconds. HANDLE hThread - AfxBeginThread(DialogProc);//dialog diaplays in this thread MsgWaitForMultipleObjects(1,&hThread,FALSE,INFINITE,QS_ALLINPUT); Besides, my dialog will cause