IRC Log Viewer » #firebreath » 2011-11-07

IRC Nick Time (GMT-7) Message
vaiju 05:11 I have developed a FB plugin on windows using VC++, It's NOT using any platform specific function/code. I want to build the same plugin for linux, How can it be done?
using VC++
johannes 05:11 no patience ...
damian_ 05:11 hi
dougma 05:11 hello
damian_ 05:11 hello dougma
how are you?
dougma 05:11 i am well thanks.
damian_ 05:11 i need the help from a firebreath's genious!
i'm working on this example
<html> <body> <embed src="blabla" type="myType"> </body> </html>
when i execute this html, there's a file .aspx which is downloaded
i would like to add or edit a method to my plugin to handle the file
handle means read the file
dougma 06:11 damian_: do you mean you want to download a file? that is very possible
damian_ 06:11 no i don't
i want to receive the file as a method's parameter
dougma 06:11 the file body or the file name?
damian_ 06:11 the body
dougma 06:11 you can't
damian_ 06:11 are you sure?
there's a big problem for me now...
dougma 06:11 90%
damian_ 06:11 jaja
very sure!
dougma 06:11 quite
damian_ 06:11 the file is an xml file
is just a string...
dougma 06:11 why not download it from the plugin?
damian_ 06:11 what if i want my plugin to edit some fields of the xml and then save it
dougma 06:11 save it where?
you can do anything...
damian_ 06:11 in some folder...
dougma 06:11 download it, edit it, email it, print it, save it.
all possible.
damian_ 06:11 how do i edit it?
from the plugin
dougma 06:11 you tell me!
the plugin is something you code!
damian_ 06:11 ok
let me ask you another question
could i save it in a particullary directory and the open ir from the plugin?
dougma 06:11 yes
damian_ 06:11 can you tell me how do i do it?
dougma 06:11 are you a programmer?
damian_ 06:11 yes i am
but i dont know firebreath
dougma 06:11 ok, so firebreath is a c++ framework to help you write plugins.
it doesn't help you edit xml files
damian_ 06:11 particullary i would like to know how to save the file in a particullary directory
linearray 06:11 use boost::filesystem
damian_ 06:11 oka
let do it easier
i want my plugin to save whatever file in C:/tmp/myDir
how do i do it?
linearray 06:11 you use boost::filesystem
or you don't, it's up to you.
johannes 06:11 damian_: do you want to upload it to a server?
damian_ 06:11 fine
i know that
i dont know where should i edit the plugin
where is the plugin looking for the path to save the file?
johannes 06:11 Nobody here has an idea what yourquestion is. What your problem is.
damian_ 06:11 oka
let's do it easier
whcih is the equivalent on FireBreath to npapi's npp_write method
damian_ 06:11 johannes
you are right
i want to upload the file to a server
BUT, i cannot get it from the filesystem
i know how to send the file
i dont know how to receive the file
i mustnt get the file from the file system
johannes 06:11 so where does the file come from?
damian_ 06:11 the file is downloaded when i execute a URL in my browser
i'm thinking on SimpleStreamHelper
emicastro 07:11 The StreamEvents are making reference to what? Could someone give me an example of an StreamEvent ?
taxilian 08:11 emicastro: Stram events tell you about browser streams
For an example, look at SimpleStreamsHelper
emicastro 08:11 I have read a question on stackoverflow that you has asked taxilian... And, I have the same question: This is the question: What is the equivalent of NPP_NewStream,NPP_WriteReady,NPP_Write,NPP_DestroyStream for ACTIVEX controls in IE ? And I want to know if the ask is "use BrowserStream" or "SimpletreamHelper"...
taxilian 08:11 emicastro: there are no equivilents in IE directly
in IE you have to use something like WinHTTP or WinInet
however, in FireBreath the BrowserStreams have an abstraction that does all that for you
nirvdrum: just curious, have you actually used mongodb or just been reading about the issues people have started reporting recently?
reading about / commenting about
emicastro 08:11 ok... So... I will try with BrowserStreams... I think that this is point
taxilian 08:11 emicastro: the easiest way to use it is SimpleStreamsHelper
nirvdrum 08:11 I used it a couple of years ago and its speed claims were grossly exaggerated.
taxilian 08:11 but if that's not enough SimpleStreamsHelper itself is a great examplke
nirvdrum 08:11 But I don't care for their unsafe defaults. And I don't like the way 10gen conducts itself.
taxilian 08:11 nirvdrum: ahh. in its defense, it has come a long, long way in the last couple of years; I wouldn't have used it 2 years ago either. I am using it now, and have been fairly pleased, but I think my use case and stack works better than most and I haven't been able to put true load on it yet
what specifically about how they conduct themselves are you referring to? (I have a friend who started working there recently; I think he'd apprciate the feedback)
nirvdrum 08:11 The problem is for the past two years they basically ignored their real issues at first, blamed other people, then turned around and fixed them.
They established a trend of selling snake oil, IMHO.
taxilian 08:11 huh. yeah, I guess I've seen that a bit
nirvdrum 08:11 So while the product may be good now I just don't care to use it.
taxilian 08:11 from things I've heard from Steve I think they're trying to fix that (both in their image and in their behavior), but I can understand why that would make you wary
I'll admit part of my willingness to use it comes from the fact that I have an "in" with the company so I know I can get help if I need it :-P
we're also using node.js, and the unsafe defaults translate into working exactly how node likes to work
making it very apparent if I'm doing things in an unsafe or a safe way
nirvdrum 08:11 node.js is just more snake oil :-)
taxilian 08:11 lol. I disagree with that one, though if you're going to use node.js you need to understand what it is and not just make assumptions
I've been absolutely blown away with how nice it is… for things it is good for
nirvdrum 08:11 Don't get me wrong there are some really smart people at 10gen. Some I'd even call friends. But I've come across too many sales people that just don't have a clue what they're talking about. And by sales people I mean developers trying to sell me mongo.
taxilian 08:11 heh. agreed
that's part of why I don't use Ruby, to be perfectly honest… the type of people that usually try to tell me how awesome it is are usually the kind that I think "hmm; if they use this, I probably don't want to"
node is similar in many aspects, but it's actually working really really well for us
though I miss the power of python, I don't miss django
nirvdrum 08:11 I attended a talk with a 10gen employee where point after point he made was either just plain wrong or misleading. For example, he claimed RDBMS don't support native arrays. That hasn't been true for about 20 years.
taxilian 08:11 hmm. I'm not sure I follow on that one
nirvdrum 08:11 I've tried node on a couple occasions. I could make it segfault quite trivially.
taxilian 08:11 really? I haven't ever managed it
maybe there was something wrong with the build?
or maybe they fixed that
I've only been using it for about 2 months
nirvdrum 08:11 Plus I have concerns about using a system designed for browsers as the basis for server applications.
It's definitely gotten better. But again the apologists just swept the issues under the rug, rather than having a real conversation about it.
That kind of shit I can't stand.
taxilian 08:11 heh. unfortunately, that's exactly what seems to happen with *every* major programming language. Python people do it with the GAC, java people do it, c++ people do it...
nirvdrum 08:11 It's a new system, I expect it to be buggy. But don't try to convince me there aren't any problems with it.
taxilian 08:11 hehea
nirvdrum 08:11 I think Java and Python people are more critical of their problems. I think it's a matter of maturity of the community.
taxilian 08:11 I've met java people that were as blind as any javascript, ruby, or mongo person I've ever talked to; I think you're right, but mostly because when the community matures you start getting more thoughtful people in addition to all the opinionated lemmings =]
the lemmings are still there, unfortunately
nirvdrum 08:11 It seems all the Ruby and node communities have are lemmings.
linearray 08:11 except for communities that actually started out with knowledgable people
taxilian 08:11 lol. i've met some others as well
they're just quieter, so you don't notice them as much =]
nirvdrum 08:11 Heh.
Fair enough.
linearray 08:11 e.g. erlang and haskell people can generally deal with criticism
of course that's because their field never really took off :)
taxilian 08:11 so you're saying they just have lots of practice? =]
linearray 08:11 no, I'm saying they didn't attract a significant number of ignorant people because they didn't really attract anyone at all
mkoch 08:11 hi
taxilian 09:11 hello
mkoch 09:11 is there any code example or open source plugin which draws in the pluginwindow on mac, other then the BasicMediaPlayer?
taxilian 09:11 not that I am aware of
mkoch 09:11 too bad :(
taxilian 09:11 feel free to make one =]
mkoch 09:11 I tried to integrate the BasicMediaPlayer to an empty plugin generated with the most recent scripts, but due to the lack of my boost and deeper c++ knowlege, not to mention the obj-c, it's still not working :S
taxilian 09:11 which drawing model are you trying to use?
mkoch 09:11 first I'd like to try CA
taxilian 09:11 that's one of the harder ones, since it requires objective c
mkoch 09:11 how much effort is to expand an empty generated plugin skeleton so that it simply displays a rectangle or whatever with CA in the most easy way? (for someone who knows firebreath and objC too?)
taxilian 09:11 probably not very hard
mkoch 09:11 it would be very helpful not just for me but for anyone who is new to this whole thing
taxilian 09:11 unfortunately, I won't have time to do something like that for quite some time
mkoch 09:11 sure I understand. maybe someone else from the community?
taxilian 09:11 are you volunteering? =]
mkoch 09:11 I'd be happy to do that but I miss the knowlege yet, that's the point, that's what I need it so badly :D
taxilian 09:11 well, I'd recommend doing the best you can and then asking for help
particularly if you did it as an example to help others as well, I'm sure several of us could help you
you could put the project on github or something so we could see the code
mkoch 09:11 that sounds good
linearray 09:11 oh wow, just read that webkit plugins are no longer supported
and it's been like that for a while
taxilian 09:11 since Safari 5.1 came out
staylor 10:11 does anyone have any pointers for handling plugin updates, specifically in windows? do you just package up the msi into a cab file for ie?
same, so open to suggestions!
taxilian 10:11 actually, sometimes I have needed to put it in an EXE
staylor 10:11 I guess I could download updates from inside the plugin itself
taxilian 10:11 I've done that
ti's very messy, particularly from IE
if you need automatic updates, I would use omaha
but it's up to you
staylor 10:11 omaha?
ah google update thanks I'll look into that
taxilian 10:11 it's a royal pain to set up
but it's the cleanest way I know of to do automatic updates
staylor 10:11 damn doesn't support windows xp
err, read that wrong
mkoch 10:11 is this supposed to work in the most recent versions of FB too?
taxilian 10:11 yes
staylor: yes, xp and later are all supported
mkoch: yes, that works
mkoch 10:11 "PluginWindowMacCocoaCA is not a member of FB"
emicastro 11:11 Compiling... log4cplus.cpp ..\..\..\..\src\PluginAuto\log4cplus\log4cplus.cpp(23) : fatal error C1083: Cannot open include file: 'log4cplus/config/defines.hxx': No such file or directory
taxilian 11:11 hmm. which branch are you on?
emicastro 11:11 I'm download the .zip with the code
taxilian 11:11 from which branch?
emicastro 11:11 isn't a checkout... from the download page
Download the latest (as of right now) FireBreath 1.6 build (recommended)
taxilian 11:11 okay, then you're downloading it from the firebreath-1.6 branch
that was my question
emicastro 11:11
taxilian 11:11 download it again; there were some fixes in master that hadn't made it into firebreath-1.6
I just pushed them
emicastro 11:11 this compiling error was trow it, when I was traying to compile the FireBreath solution
taxilian 11:11 download it again; there were some fixes in master that hadn't made it into firebreath-1.6
I just pushed them
and make sure you rerun the prep script
emicastro 11:11 ok, from which branch?
taxilian 11:11 the same one
emicastro 11:11 taxilian: problem resolved.
the update solved the problem
taxilian 11:11 I'm glad
emicastro 12:11 Exists one way to catch the stream of one file. For example: if you have an URL like this Could my plugin check the content-type of the http header and catch all the content of the file ?
taxilian 12:11 emicastro: your plugin can download the file, if you choose
but what do you mean by check the content-type of the http header?
you mean automatically for every file downloaded?
emicastro 12:11 when I registered the content-type that my plugin will manage, the plugin will create when a content-type manage by my plugin will found for the browser right?
taxilian 12:11 your plugin will be instantiated when the browser finds an object tag with that content-type
emicastro 12:11 ok
now... if this content-type is given in the http header instead of in an <object> into the html.... My plugin will instantiated as well, right?
taxilian 12:11 theoretically, if you load such a file in the location bar that may be the case, but FireBreath does not support it
mainly because nobody has taken the time to figure out how to make that work
mainly because you're only the second person in almost 2 years to even ask about it
emicastro 12:11 :)
I'm soo lucky! :)
taxilian 12:11 but I still don't think what you want to do will work
first because you can't take over the text/xml mimetype
emicastro 12:11 my backend server create a new mimetype something/xyz
and send me a xml with this mimetype
taxilian 12:11 okay; and how did you request the file?
emicastro 12:11 but... in the way that I'm describred below
this is the hard point! :)
taxilian 12:11 aparently
did you open the xml file the same way you'd open an html file?
did you get it through ajax?
there are really only two options
it shouldn't be that hard
emicastro 12:11 be right back in a moment, I have a live meeting
thanks for your help, always :) I will back in a few moment
VJ 13:11 Can I access http headers in the plugin?
taxilian 13:11 VJ: what kind of http headers?
and from what?
I mean, where did these mysterious http headers that you want to access come from?
VJ 13:11 I want to check Access-Control-Allow-Origin header
I mean whether it exists, and if yes then what is the value
taxilian 13:11 great
but what headers?
you mean the headers from the page when it was initially loaded?
VJ 13:11 yes
taxilian 13:11 or headers on something you downloaded?
no, you can't access those
VJ 13:11 which are sent by the server
taxilian 13:11 maybe an extension could
but those aren't part of the page
VJ 13:11 oh ok, then what is the way to access those headers in the plugin?
taxilian 13:11 there isn't a way that I know of
VJ 13:11 ok :-(
npapi doesnt support it ?
taxilian 13:11 correct
VJ 13:11 ok, thanks
linearray 13:11 !wiki console
FireBreathBot 13:11 5 results found. Note: Results limited to 8
"Invoking methods on the DOM":
"Tips and Tricks":
"Debugging Plugins":
"Performance Considerations":
taxilian 14:11 linearray: what are you looking for?
linearray 14:11 was making sure cout goes to /var/log/system.log on os x
taxilian 14:11 it doesn't always
but usually does
linearray 14:11 I'm having weird issues with log4cplus
taxilian 14:11 I highly recommend using logging
linearray 14:11 maybe I'm using it wrong :)
but e.g. sometimes when I concatenate a log message string with a value I get from a network buffer, it will _remove_ some characters from the log message
or I log "count: " + someVector.size() and instead of showing 0 it will show nothing at all
taxilian 14:11 err, yeah, that's to be expected
this is ++
you can't do "count: " + some size
because it'll actually take the pointer "count: " and add that size
linearray 14:11 doh
taxilian 14:11 i.e. "count: " + 3 == "nt: "
use << instead
linearray 14:11 isn't that only defined for streams?
taxilian 14:11 FBLOG_ERROR("fdsafsda", "Count: " << someVector.size())
it's a stream
you just don't realize it
behind the scenes there is actually a std::stringstream being used
linearray 14:11 aha!
I thought it implicitly constructs a string and uses + on that
taxilian 14:11 nope; stringstream is more efficient
you could have gotten away with std::string("count: ") + ...
but not with just a string literal
and as I said, that'd still be less efficient
like so much else, FireBreath's logging abstraction is much more powerful than most people realize...
linearray 14:11 haha, that also explains why _sometimes_ it segfaults on "foo" + dataFromSocket;
taxilian 14:11 mostly because I dont' document things well :-P
yes, that would do it =]
linearray 14:11 awesome, thanks
emicastro 14:11 the htmlLog method log to the javascript console?
taxilian 14:11 yes, but it does not perform well - I don't recommend using it in production
emicastro 14:11 ok
emicastro 14:11 to debug with visual studio... I have to attach me to the browser? This is only that I have to do?
taxilian 14:11 you need to attach to the correct process
see the debugging page on the wiki
linearray 14:11 is unloading/loading the plugin a reliable way to load a new version?
taxilian 14:11 you mean removing it from the DOM, adding it back in?
has been for me
linearray 14:11 yes
If the browser actually removed the plugin process and created a new one, I'd be less uneasy
taxilian 14:11 it won't
linearray 15:11 let me tell you that boost::asio is amazing, but I've long passed the point where its benefits still outweighed learning all of its complexity.
in other words: it'd be done for the longest time had I used BSD sockets hehe
taxilian 15:11 lol
JSHANAB_ 15:11 I used boost asio in my plugin and had to rip it out. To slow for video data, it gave it to me in big chunks. libcurl gave it to me so fast I had to aggregatt eh mtu sized packets together to save some processing. I may have been using it wrong, but after 5 days the pressure was on and I had to rip it out.
staylor 15:11 you can do short reads with asio as well, I've been using it a lot for a few years now and don't have performance issues
but there's so many ways to do things with it, and not the best "here's how you do things" type of documentation
linearray 16:11 I definitely recommend using asio in FB, simply because it is platform-independent. But if all you need to do is a bit of socket reading, then the asio socket API is maybe a better fit than the abstractions.
taxilian 19:11 so I'm looking again at the possibility of setting up OSQA to replace, and I got thinking: would it be better to just tell people to ask questions on stackoverflow?
dougma 20:11 forums suck
imo. :)
taxilian 20:11 this one is worse than most =/
which is why I need to get rid of it in favor of something else
dougma 20:11 consolidating from google-group + forum + stackoverflow -> one place would be good
taxilian 20:11 google group I think needs to be there, if only as a place for announcements
dougma 20:11 i check the group more than the forums
taxilian 20:11 but perhaps just tell everyone that the official place to ask questions is stackoverflow...
you can subscribe to an rss feed on both the current forum and stackoverflow firebreath tag
I was fine with just the group, but a lot of ppl didn't want to join a mailing list just to ask one question
and yeah, I know you don't have to receive email, but nonetheless
dougma 20:11 options are good then. :)
you've talked me our of consolidation
our = out
taxilian 20:11 lol
well, something needs to be done about the forum… it keeps crashing on people
dougma 20:11 kill it with fire.
taxilian 20:11 and I'm not going to take the time needed to fix it
roshanjrp 23:11 hello i need help
is anybody there
dougma 23:11 .ask
FireBreathBot 23:11 If you need help, just ask your question and wait for people to come back.
roshanjrp 23:11 i have a site that converts any site to our native language on mouse over
i need to install a plugin to the browser so that when i type an address in the url it automaticaly gets pased to my site when u click the plugin button
dougma 23:11 sounds more like an extension, not a plugin
roshanjrp 23:11 can u do this with firebreath or not
dougma 23:11 read this