IRC Log Viewer » #firebreath » 2012-03-23

IRC Nick Time (GMT-7) Message
xgbi 03:03 hey guys
I'm looking for some help on NPAPI and CSS properties
I posted a question on SO but I'd rather discuss it here, if somebody knows a bit more than me
my question:
note that I'm not using firebreath
I work on an embedded platform, so firebreath seemed a bit overkill
my question, simply put: how can I implement CSS in NPAPI
like, the webpage sets up CSS properties for my object and modifies it throughout the webpage lifetime
problem is, I didn't implement CSS handling in my object (like, "style" property and all what comes below that, like height, width, margins etc..)
my hope is that the browser takes care of all that, and juste gives us a NPP_seWindow call
but it doesnt look like it
FUCK ME! I found the proble
spent 1 day on this and the solution is just madly simple
so I answer to myself: use = 150 + "px";
where + "px" is REQUIRED
reichi 04:03 yes it is
you may not set dimensions without units in css
xgbi 04:03 ok now, I have the logical next question:
how do I set CSS properties from my NPAPI code?
on my own object
I tried getting my own object through NPN_getValue() and do NPN_setValue( myobject, "style.width", "150px")
but that makes the vbrowser ask for the "style" property in my object, instead of impacting CSS
NPN_setProperty, by the way
not NPN_setValue
reichi 04:03 i am the wrong person to ask, sorry ;)
i guess you may have to wait for taxillian
xgbi 04:03 yep
that what I figured
reichi 04:03 he usually shows up in about 4-5h
xgbi 04:03 :)
k15 04:03 Hello!
xgbi 04:03 what time is it in his timeframe?
it's noon here
reichi 04:03 i guess it's about 3 or 4 o'clock
in the morning
xgbi 04:03 allllll right
reichi 04:03 yeah it's 11:40 here ;)
xgbi 04:03 fucking timezones
k15 04:03 Im having some problems with InvokeAsync for chrome since firebreath 1.5, some calls doesnt seem to reach their destination
Anyone else?
xgbi 04:03 I pass :)
k15 04:03 Okay :)
There was some kind of fix in 1.4.2, "Fixed potential crash on chrome when calling JSAPI methods".
xgbi 05:03 ok I found the way to do it
xgbi 05:03 ok reichi I found the solution here:
not trivial AT ALL
Sandro_ 06:03 Hi guys! I want to launch a new email in Thunderbird, with a pdf attached, from browser. Is it possible, with firebreath, to do that? Something like executing a command line: thunderbird -compose "to='[email protected]',subject='dinner',body='How about dinner tonight?',attachment='C:\temp\info.doc,C:\temp\food.doc'". I tryed a link mailto:... but thunderbird does not accept attachements this way.
reichi 06:03 yes you can
in a npapi plugin you exactly the rights of the user the browser runs with
so permission-wise it's not a problem
Sandro_ 06:03 thank you.
xgbi 09:03 hey guys
taxilian 09:03 hello
xgbi 09:03 I see that you answered my question on SO taxilian
about CSS properties
taxilian 09:03 yes
xgbi 09:03 along with this problem, I tried something else that is not working: getting style properties from the DOM about my NP object
do you know if it's possible?
taxilian 09:03 not sure I totally follow
xgbi 09:03 I tried the same way that I found for setting the attirbutes, but it falls trhough
yeah let me explain:
I do something like that: NPN_getValue( currentNPObject )
then NPN_getProperty( "style") on this object
this gives me the DOM-like style property
now, using NPN_setProperty( "width") on this style object works
(this is what I was looking for in the first place)
then I tried *accessing* the "style.width" property
using the same protocol, but in the end doing "NPN_getProperty( "width")
except this time, the browser dives into my NPAPI implementation instead of returning the DOM-style value
taxilian 09:03 so it'll always do that; it will always cal HasProperty on your NPObject
if you return false it'll usually fall back to the default
xgbi 09:03 normally, I return false (that's what I see in the traces of my plugin at least)
but then, getProperty fails
NPN_getProperty I mean
taxilian 09:03 interesting
I would seriously recommend putting it in a container div and then manage your size and position with that
I've seen a lot of oddities with doing it the way you're doing it; I think it'd work better with a container div
xgbi 09:03 problem is (as always with plugins), I won't be the user of the plugin
developpers will probably use CSS properties directly on it
taxilian 09:03 tell them not to =]
xgbi 09:03 (that's what I see on the draft implementations we're using)
taxilian 09:03 anyway, I don't know; it sounds like you've tried the things I would have tried
xgbi 09:03 I think I still have some tinkering with NPN_get/set to try
I'll fill up my answer on StackOverflow if I get some more information
taxilian 09:03 when you call GetProperty to get the width you're doing it on teh style object still, right?
xgbi 09:03 yep
taxilian 09:03 hmm
yeah, I don't know
wish I could help more :-/
xgbi 09:03 nopb, NPAPI seems to crystalize every single DOM/CSS/JS problems in the world
taxilian 09:03 yep
xgbi 09:03 this is not the last problem I'll get into
note, I tried to use firebreath when we started the project
taxilian 09:03 why did you decide not to?
xgbi 09:03 it seemed overly big for an embedded platform
taxilian 09:03 ahh. I can understand that
it was not designed for an embedded platform
xgbi 09:03 our platform is a set top box, so we're trying to streamline as much as possible
exceptions, etc.
reichi 09:03 mmh
xgbi 09:03 yep that's what I thought
reichi 09:03 let's see
i am working on a set-top-box plugin using FB ;9
but i didn't see any major "performance killing" thing in firebreath
so i decided to give it a go
xgbi 09:03 yeah, but memory footprint and executable footprint did make us think twice
reichi 09:03 well
we got enough of that
xgbi 09:03 anyway, I like how it abstracts the properties and methods of a C++/JS object
reichi 09:03 developing npapi plugins is pretty straight forward with FB :)
xgbi 09:03 I guess so
maybe we'll make an intern look at this
what's your architecture reichi ? if it's not too much asking?
on our side, we're running on SH4