IRC Log Viewer » #firebreath » 2010-12-18

IRC Nick Time (GMT-7) Message
Jamil 07:12 Hi all
I want to use NPN_PostURL to send data to the server from my plugin. Whay is the NPP instance in firebreath?
taxilian 09:12 Jamil: there are two ways you can approach this
there is the "good way" which would require a little work but would help all future FireBreath users
and there is the "hacky way" which would get you going fast
the BrowserHost can be cast to a NpapiBrowserHost
and then you can call PostURL on the NpapiBrowserHost, which has the NPP
that's the hacky way
not sure how you'll instrument things back to your plugin from the NpapiPlugin class
the "good way" would be to add POST capability to the current BrowserStream object
to do that "properly" you'd want to add it to the IE side as well, but if you do one half we might be able to find someone else to do the other half if you don't care about IE
Jamil 10:12 taxilian:is there a "hacky way" to POST data to the server using IE?
taxilian 10:12 I suspect that on IE the hacky way would be harder than actually adding post support to BrowserStreams
Since BrowserStream already has IE support for GET, so you'd just be adding a new feature to it; the "Hacky" way would be to just write your own WinInet code to do the post
Jamil 10:12 this was my question, the using of winInet as I am doing now with my old plugin version
so better to go with the "good way"
can you help me to do that?
taxilian 10:12 that would be much appreciated, particularly if you're willing to contribute back =]
I can try; I'm no expert on WinInet, but I know the browserstream object model, more or less
you'll want to do it on the 1.4 branch; I won't put a change like that in 1.3, since 1.3 is stable
1.4 is just the master branch on github currently
hypothetically it probably won't be too hard to do what you want to do
Jamil 10:12 Let me think on that tomorrow...I need to go now...if you have any guidance please write
taxilian 10:12 nitrogenycs wrote the current code
so he can probably help when he's here
I won't be on tomorrow
I don't work on Sundays
and Mon-Wed I'll be at work (I normally work remotely), so I don't know how much I'll be around
just FYI
the code isnt' too bad, though
Jamil 10:12 ok
taxilian 10:12 if you have a few minutes now I could point out the general structure, but if you've got to run that's fine
Jamil 10:12 you can write any information here so I can check it tomorrow or send to me an email to [email protected]
I really need to go
taxilian 10:12 ok. I'll try to find some time to do so
good luck
nitrogenycs 12:12 hey guys, somebody asked about NPN_PostURL earlier, has this been answered?
I came across today and I am wondering why it isn't enough to provide upload streams. Was the reason that you need to have the entire data in a file or in memory before you can use it? Or was the reason that there's no way to get the upload progress?
taxilian 14:12 nitrogenics: you still around?
it's hypothetically possible that it might work, but my understanding is that you can only upload files to a remote server using FTP, not HTTP. Presumably that means that NPN_PostURL doesn't support multipart/mime
however, since you just give it the POST data, it's possible that we might be able to provide the multipart/mime stuff ourselves
so aparently one cannot use NPN_Construct on javascript objects
jshanab 15:12 Good Afteroon people
In windows, are there multiple ways to draw video frames into a browser window? I have a firebreath codec that pulls from my archive server and displays video, but it uses GDIPlus and I think the performance couldbe better
taxilian 16:12 hey, sorry, didn't see you wrote anything
you still here, jshanab?
nitrogenycs 18:12 taxilian: This is part of the PostURL docs: "For HTTP URLs only, the browser resolves this method as the HTTP server method POST, which transmits data to the server."
the postnotify version allows to send custom data and headers, so multipart mimes should be possible I think
this could solve your problems with uploading. To get progress you could just query the server at like 1 second intervals
upload progress I mean
e.g. my server middleware has built-in support to do this
also "Possible URL types include HTTP (similar to an HTML form submission)"
What I don't like is this: "If a file is posted with any protocol other than FTP, the file must be text with Unix-style line breaks ('\n' separators only).". Binary could be base64 encoded I guess.