Summary: | NPN_PostURLNotify not initiating NPP_NewStream with Flash 6 Linux plugin | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Ed Millard <emillard> |
Component: | nsplugins | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jason.poynting |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Ed Millard
2002-10-26 22:30:32 UTC
I should add this may well be a bug in the Flash plugin but its not clear why it works OK in Mozilla and not Konqueror NPN_PostURL and NPN_PostURLNotify are still unimplemented in nspluginviewer. I'm currently working on this. *** Bug 54201 has been marked as a duplicate of this bug. *** Hi Till, any update on this? Subject: kdebase/nsplugins/viewer CVS commit by staikos: Untested partial implementation of NPN_PostURL I think it will do the post ok, but it won't return the results as it is supposed to, and only http/https urls work. CCMAIL: 49746@bugs.kde.org M +40 -4 nsplugin.cpp 1.79 --- kdebase/nsplugins/viewer/nsplugin.cpp #1.78:1.79 @@ -232,10 +232,45 @@ NPError g_NPN_GetURLNotify(NPP instance, -NPError g_NPN_PostURL(NPP /*instance*/, const char* /*url*/, const char* /*target*/, - uint32 /*len*/, const char* /*buf*/, NPBool /*file*/) +NPError g_NPN_PostURL(NPP /*instance*/, const char* url, const char* target, + uint32 len, const char* buf, NPBool file) { - kdDebug(1431) << "g_NPN_PostURL() [unimplemented]" << endl; +//http://devedge.netscape.com/library/manuals/2002/plugin/1.0/npn_api13.html + kdDebug(1431) << "g_NPN_PostURL() [incomplete]" << endl; + QByteArray postdata; - return NPERR_GENERIC_ERROR; + if (file) { // buf is a filename + QFile f(buf); + if (!f.open(IO_ReadOnly)) { + return NPERR_FILE_NOT_FOUND; + } + + postdata = f.readAll(); + f.close(); + } else { // buf is raw data + postdata.duplicate(buf, len); + } + + if (!target) { + // Send the results of the post to the plugin + } else if (!strcmp(target, "_current") || !strcmp(target, "_self") || + !strcmp(target, "_top")) { + // Unload the plugin, put the results in the frame/window that the + // plugin was loaded in + } else if (!strcmp(target, "_new") || !strcmp(target, "_blank")){ + // Open a new browser window and write the results there + } else { + // Write the results to the specified frame + } + + KURL u(url); + + if (u.protocol() == "http" || u.protocol() == "https") { + /*job = */ KIO::http_post(u, postdata, false); + } else { + // FIXME - must implement this + return NPERR_INVALID_URL; + } + + return NPERR_NO_ERROR; } @@ -244,4 +279,5 @@ NPError g_NPN_PostURLNotify(NPP /*instan uint32 /*len*/, const char* /*buf*/, NPBool /*file*/, void* /*notifyData*/) { +//http://devedge.netscape.com/library/manuals/2002/plugin/1.0/npn_api14.html kdDebug(1431) << "g_NPN_PostURL() [unimplemented]" << endl; I updated my plugin to flash 6 but I cannot get that demo to work. It gives me a blank screen. I don't see any debug output from it trying to call PostURL* either. Are there other problems triggering this? It seems to work better in Netscape 4.x, but that also errors out with: Network Communication Error. A communication error occured with the Pet Market application. This might be caused by: Subject: kdebase/nsplugins/viewer CVS commit by staikos: Make POST work in some cases. See before and after on: http://examples.macromedia.com/petmarket (must have Flash 6) This does not handle POST where the data gets returned anywhere except back to the plugin. That is, it doesn't allow the post results to appear in a browser frame yet. This is because I left: // FIXME there which of course doesn't do much. It's all documented though. Also these functions only support "http" and "https" and nothing else. I have no personal intention to go any further with this, but I think it's supposed to be possible to do other URLs too, at least that's what I figured from reading the specs. One other thing that does not work is plugins which put the POST data in a file and pass the file name in to be POSTed. I just haven't written the header parser here. If you find a site that uses it, show me, send beer/pizza, and I'll do that for you too. CCMAIL: kfm-devel@kde.org, 49746-done@bugs.kde.org M +1 -1 Makefile.am 1.21 M +59 -7 nsplugin.cpp 1.88 M +7 -4 nsplugin.h 1.36 |