IRC Log Viewer » #firebreath » 2011-10-24

IRC Nick Time (GMT-7) Message
vaiju 02:10 FB::VariantList mylist; Is there any function like mylist.unique()?
FireBreathBot 02:10 vaiju: 22 Oct 14:03Z <taxilian> tell vaiju that there are not currently any default "valid localhosts"; you need to register what a valid localhost is using registerValidLocalhost. I know that may not make sense, but it did make sense for the use case it was designed for — which is no longer used by anyone
vaiju: 22 Oct 14:03Z <taxilian> tell vaiju the main purpose of that function was actually to verify the DNS of the "localhost" to prevent dns spoofing to the localhost address
koby 04:10 quick question: how do i hide the mouse over my plugin?
anyone here?
staylor 05:10 in windows you'd need to use setcursor
not sure about mac/linux but they'll have very similar apis
::ShowCursor(false);
koby 05:10 what about FF hiding the cursor does not work because you are running in another process (sandbox)
staylor 05:10 show cursor is system wide, so you'll have to catch when you have focus or not
there might be an easier way but I don't know about that
koby 05:10 FF overrides the ShowCursor within the sandbox.
staylor 05:10 then I don't know sorry
koby 05:10 Thanks anyway.
staylor 05:10 hmm, are the javascript methods supposed to work from ie?
dougma 05:10 of course
wait what javascript methods?
staylor 05:10 err, oh I see
addEventListener is what's messing up
dougma 05:10 http://www.firebreath.org/display/documentation/Interacting+with+Javascript
staylor 05:10 yeah, according to MDN it should work in ie9 but it doesn't seem to
dougma 05:10 http://www.firebreath.org/display/documentation/Frequently+Asked+Questions
staylor 05:10 does anyone know how to get around the ie "allow blocked content" dialogue (ie9)?
oh I see it's just from html documents loaded from the hard drive
FireBreathBot 08:10 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-135 issue commented by miketalbot "Ok, thanks for that. Great work on firebreath btw :)"
taxilian 09:10 good morning, all
linearray 09:10 hi
kylehuff 09:10 morning
FireBreathBot 10:10 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-135 issue closed by richard
linearray 10:10 xcode 4.2 is awesome
srsrly
taxilian 10:10 lol
linearray 10:10 even though I don't get why I have to hit ^Space for completions.... but it works as well as VA X
taxilian 10:10 cool
I am considering replacing forums.firebreath.org with http://www.osqa.net/... thoughts?
linearray 10:10 as long as it has RSS, I'm fine
taxilian 10:10 I've been having trouble with djangobb, which is what forums is running on right now
this seems to be a bit more widely used
linearray 10:10 I know of uservoice.com, but it seems to cost money
taxilian 10:10 there seem to be quite a few people using osqa; it is most likely a reliable system. The question is whether or not the format would be better
I'm inclined to think it probably would be; the forums seem unwieldly
linearray 10:10 so this is a rewrite of stackoverflow?
taxilian 10:10 same idea, yea
linearray 10:10 another one: http://www.lampcms.com/
but yeah, I'm all for the change
taxilian 10:10 hmm. mongodb backend; that's not a bad thing
I'm not a big fan of PHP these days, however
linearray 10:10 http://shapado.com/
same thing with ruby
taxilian 10:10 nothing written in node.js? =]
staylor 10:10 stackoverflow interface is nice, that's what unity3d uses as well
taxilian 10:10 heh. and they use Qato, yet another QA thing
staylor 10:10 btw what's the leakfinder in firebreath from?
taxilian 10:10 an obscure blog post
staylor 10:10 I'm trying to find a good solution for tracking wmi com leaks, and still no valgrind for windows
taxilian 10:10 found it: http://blog.kalmbach-software.de/2009/11/01/stackwalker-moved-to-codeplex/
staylor 10:10 thanks
of course com requires special methods of detecting leaks
taxilian 10:10 it can, yes
it depends on how you're using it
staylor 10:10 unhappily, if that's a word
Sudi 10:10 good morninig!!
taxilian 10:10 good morning
Sudi 11:10 taxilian... is it possible from JSObj to call javascript method within iframe ?
taxilian 11:10 cross-domain script limitations most likely apply
but otherwise, I don't see why not
Sudi 11:10 hhmmm... ok.. because webkit plugin allows that
let me try
thanks
gphysics2014 11:10 I am working on a plugin which needs to detect when a specific page is loaded and inject JavaScript into the page. In the tips and trick section there is a section on getting the URL of the current page, but how can I go about getting my plugin to detect when a new page loads and test if it has the URL I am looking for?
taxilian 11:10 you can't
that's an extension
you could possibly write an extension that would do it, though
but it will be browser-specific
gphysics2014 11:10 OK. Thank You.
vaiju 11:10 FB::VariantList myList; myList.push_back("val1"); myList.push_back("val1"); myList.push_back("val2");myList.push_back("val3");myList.push_back("val3"); it there something like myList.unique() which will remove the duplicate entries ?
It will have only val1, va2 and val3 in the list?
taxilian 11:10 no, but you could build it in a std::set<std::string> and then convert that to a FB::VariantList
vaiju 11:10 using conver_cast?
taxilian 11:10 no
using a loop
actually, there may be a function somewhere that will do it as well
I think there is
you could use make_variant_list
see https://github.com/firebreath/FireBreath/blob/master/src/ScriptingCore/variant_list.h
if you have a std::set s
vaiju 11:10 Ok I will have a loot at it
taxilian 11:10 s.begin(), s.end(), outList.begin() or something like that
not 100% certain that would work exactly
but something like that
vaiju 11:10 actually I was trying to return list<string> value to the JS but it was giving compilation error
can I return STL set/list for JSAPI method?
taxilian 11:10 no; it has to be a FB::VariantList
you can *accept* a std::set
but only return certain types
vaiju 11:10 means?
taxilian 11:10 std::set can be a parameter
but not the return value
has to do with how templates work
vaiju 11:10 oh
I need to form a list with unique values
and return it
taxilian 11:10 so make a std::set
and then convert it to a VariantList
vaiju 11:10 k
Sudi 11:10 taxlilian.. what method to use to call javascript function from JSAPI with event or asynk call .. just the normal method call ??
taxilian 11:10 InvokeAsync will call the method asynchronously
Sudi 11:10 I mean without event or asynk
taxilian 11:10 Invoke will call it synchronously; be aware that using that from another thread has performance implications
Sudi 11:10 yes.. I am calling it from main thread ..
taxilian 11:10 just regular calls, then; Invoke, SetProperty, GetProperty
Sudi 11:10 ok.. so I just need to create a FB::JSAPIAuto obj and use Invoke for method call and SetProperty/GetProperty for propetry values right ?
taxilian 11:10 no, you need to create a javascript object
assuming that's what you want
!find createMap
FireBreathBot 11:10 Found 1 possible matches. Displaying 1
/^FB::JSObjectPtr Window::createMap() const$/ (f) found in src/ScriptingCore/DOM/Window.cpp: http://goo.gl/LlQeI
taxilian 11:10 or
!find createArray
FireBreathBot 11:10 Found 1 possible matches. Displaying 1
/^FB::JSObjectPtr Window::createArray() const$/ (f) found in src/ScriptingCore/DOM/Window.cpp: http://goo.gl/LlQeI
taxilian 11:10 I mean, I guess you could make a jsapiauto object
Sudi 11:10 ok.. thanks.. I will have a look at that.
taxilian 11:10 but that seems like overkill
Sudi 11:10 so is FB::BrowserHostPtr something different ??
taxilian 11:10 ...
different than...?
Sudi 11:10 JSObjectPtr
taxilian 11:10 err, yes
it's completely different
to the extent that I don't understand why you would need to ask?
Sudi 11:10 ok... I will look into the wiki .. thanks
taxilian 11:10 look at the code as well
you can learn a lot from the code
Sudi 11:10 yes.. thats very helpful
linearray 12:10 so... I know how to set FB's log level.
but how/where is that actually used?
because my own code always logs, regardless of log level
and I'd like to use log levels in my own code as well.
JSHANAB 12:10 ok, I have a brand new bug. IE only on loading of the plugin.
"can't execute javascript, window is null" in window_FB_CALL_178177130=function(delay,f,args,frame)
taxilian 12:10 JSHANAB: anything unique about your plugin or environment
?
JSHANAB 12:10 I dunno. (shoot me now if this is a FB 1.5 issue, i didn't get around to updating as prommised, i was sick)
There is a javascript/jquery wrapper that tries to determine if it is loaded by newing an object, but that has worked for a year.
taxilian 12:10 wait, you're on 1.5?
call me back after you've upgraded
if you still have the issue in 1.6 I'll help you debug it
JSHANAB 12:10 I was afraid of that LOL
ok, ok. upgrading....
JSHANAB 12:10 I think I made it a submodule but forgot how to update it. I do git submodle update and it returns quietly :-(
taxilian 12:10 change into firebreath
git checkout master
git pull
cd ..
git add firebreath
git commit
submodule update updates the submodules to the commit referenced by the parent project
it doesn't update the submodule to the latest version available — that might break your code
bbl, headed to lunch
JSHANAB 13:10 Ah. Thanks forgot the checkout master!
JSHANAB 13:10 I am getting an error on opening visual studio after a delete of build, update to 1.6 and re-prep. It says "error : unable to read the project file "PluginCore.vcxproj". line 520 position 7 the 'C1Include' start tag on line 499 position6 does not match the end tag of 'C1Compile'. Anyone know what did I do wrong?
JSHANAB 13:10 Maybe obvious if we look at the XML, the generated project has a "C1Include Include = ...." instead of "C1Compile Include = ..."
And is closed with ClCompile :-)
linearray 13:10 hmm
JSHANAB 13:10 I do not know the syntax for the project files but it looks like it just needs the opening ClInclude changed to ClCompile
Oh the irony, it is on the line for X11
JSHANAB 14:10 I tried changing those in my project files and it loads but I have over 200 errors all in {pluginname}_PluginAuto and all Mac stuff, but this is windblows :-(
JSHANAB 14:10 Almost like I am missing a bunch of files. Is there a new submodule I must update or a new variable I must set for the Proxy stuff or Mac stuff, My project was originally generated back in 1.3 days?
linearray 14:10 i have no idea... with a new FB release I usually update FB and then create a new project and copy my code over
taxilian 14:10 there is no reason you'd need to create a new project if your project worked in 1.5
there are no breaking changes
JSHANAB: did you delete the build directory?
JSHANAB 14:10 Yes I deleted teh build directory. I am wondering if my version of msbuild is stricter and just doesn't allow the ClInclude's to be closed with ClCompile. But getting past that by manually editing still doesn't build. Lots and Lots of Mac stuff
Could it be that since my FBGen was run in the 1.3 days and I have been continously updateing sense, that I missed something/?
taxilian 14:10 I doubt it
update CMake
I bet it's a cmake bug
JSHANAB 14:10 ok, I'll give that a shot. Cmake is at the system level, not part of FireBreath, Correct/
taxilian 14:10 correct
JSHANAB 14:10 Good call on Cmake. Updateing from 2.8.3 to 2.8.6 seemed to fix project file errors. building now
So let me ask a quick git question if I can. When my coworked gets back tomorrow and does a git pull of our top-level, will he automagically git the new firebreath? or does he have to manually pull it.
JSHANAB 14:10 1.6 fixes IE crash! Hey, the plugin seems faster, were there performance enhancements?
taxilian 14:10 probably
jshanab: when you git add firebreath it will save the new commit hash as the current revision
so then when your coworker does a git submodule update --recursive it will automatically update to that revision
JSHANAB 14:10 ok, Thanks!
Sudi 15:10 can we convert char *[] to varient_list ??
taxilian 15:10 yes
with a for loop
amazing things, for loops
you can do a lot with them
Sudi 15:10 ok.. there are no method that does the conversion without loops right ??
taxilian 15:10 no, there are no methods that do that conversion for you
Sudi 15:10 ok.. thanks
Sudi 15:10 taxilian.. do you have any example of conversion from char *[] to FB::variant_list
?
taxilian 15:10 Sudi: please go find a C++ tutorial
it's just an array where you loop over each char* and call .push_back on each value
Sudi 15:10 ok.. thanks..
JSHANAB 15:10 taxillian. I wish I could show you my screen(s) 1 video accroos the net into the server re-streamed to 1 each safari,chrome,Firefox and IE. 640x480 30fps 1 second delay
taxilian 15:10 nice
now don't you wish you'd just gone ahead and upgraded to 1.6 sooner?
JSHANAB 15:10 Yes. (exits stage left)
taxilian 15:10 =]
mhilmi 16:10 taxilian, how do you get the MIDL compiler to run with CMake? Did you write custom commands or is there some built in capability in CMake?
taxilian 16:10 heh. both, actually
it's a built-in capability
but it's broken
so I wrote my own
mhilmi 16:10 dang :(
taxilian 16:10 not hard to do, though
Sudi 17:10 taxilian..
sorry to disturb you again :)
void myPlugin::CallJSMethod(std::string MethodName, char *myArray[], int ArrCount) { FB::VariantList vl; for(int i=0;i < ArrCount; i++) { vl.push_back((std::string)myArray[i]); } FB::DOM::WindowPtr windowObj = m_host->getDOMWindow(); FB::JSObjectPtr = windowObj->getProperty<FB::JSObjectPtr>("document"); jsObjPtr->Invoke(methodName,vl); }
am I doing anything wrong here ??
taxilian 17:10 Sudi: if you're going to give me code and ask what is wrong, be sure to include the compile error
because I'm not a human parser, and I don't have time to examine your code line by line
particularly if you're going to try to paste it directly into IRC instead of somewhere you can turn on syntax highlighting...
Sudi 17:10 actually it compiles well but plugin crashes when running this line - jsObjPtr->Invoke(methodName, vl);
taxilian 17:10 well, the first thing I see if that you're trying to cast a char* to a std::string
you can't do that
try std::string(myArray[i])
not 100% sure, but that may help
and what is the crash?
Sudi 17:10 ok..
taxilian 17:10 "it crashes" is not much more helpful than "it doesn't work"
what line does it crash on? what is the error message/exception?
also, "FB::JSObjectPtr = windowObj->getProperty<FB::JSObjectPtr>("document");" doesn't make sense for a couple of reasons
first, you have no variable name
second, why call window.document when you could just call m_host->getDOMDocument()?
and where does jsObjPtr come from?
you realize that the global scope ofr javascript is the window object, not the document?
Sudi 17:10 oh. sorry .. it typed it wrong - its FB::JSObjectPtr jsObjPtr= windowObj->getProperty<FB::JSObjectPtr>("document");
taxilian 17:10 what are you actually trying to do?
Sudi 17:10 I am trying to to call the method passed in MessageName with arguments passed in char *[] (in Array)
in javascript there is a function like function display(string v1,string v2, string v3){...}
taxilian 17:10 okay, first of all, if you define a function like that it isn't going to be on the document
it's going to be on the window
Sudi 17:10 ok.. I corrected that
taxilian 17:10 second, it's probably better to getProperty the function and then InvokeDefault on it
Sudi 17:10 but I still need to pass the arg in that case
and need to convert char *[] to variantList
chris2_ 17:10 hey
anyone around?
taxilian 17:10 chris2_: nope. we ran away and joined the circus
Sudi: why are you using char*[] instead of a std::vector<std::string>?
chris2_ 17:10 crap .. i got scared
Sudi 17:10 code was there already so just wanted to keep that
chris2_ 17:10 I had a question for you about Core Animation and CALayer (safari) ... Can the CALayer be altered on a thread which isn't the main thread?
taxilian 17:10 I think so
Sudi 17:10 but now thinking of taking your advice and changing it to vector
taxilian 17:10 Sudi: I would *strongly* recommend it
Sudi 17:10 ok.. doing it right now and will try to run after that
chris2_ 17:10 hmmm, i find i can alter the see the changes to a CALayer when performed on main thread, however the same code, when hit from a pthread timer doesn't change the CALayer (as far as I can see)
I think I'll try a performanOnMainSelector and see if that helps
Sudi 18:10 chris: performanOnMainSelector will help.. I had a same issue
chris2_ 18:10 yeah i used performanOnMainSelector for core graphics model. I could see the use since I was calling NP functions (invalidateRect). This time I'm just trying to use a CALayer the browser provided
docs on this stuff are hard to find
Sudi 18:10 its woking after converting to vector :) thanks
taxilian 18:10 yw
chris2_: take a look at FireBreath's CA code; I think some things have to be on the main thread, other things can be wherever
bbl
Feeling 18:10 hi all
before, i asked the question about "update plugin on IE"
so, taxilian said " once you have registered the new dll, any new instances you create will use hte new one"
and " if you remove the object tag and add it again you'll get the new one"
but, can't getting new instance, just getting old instance until terminate IE browser
the Test code is here "http://goo.gl/Et4mY"
chris2_ 18:10 thx taxilian, works fine when running CALayer update on main thread using performanSelectorOnMainThread
Feeling 19:10 i tested that code on IE8
dougma 23:10 Feeling: yeah i always assumed IE did some caching around that. If you reload that page do you get the new version?
oh, he's gone.
taxilian 23:10 he seems to be gone
I've done it before w/ IE8, though
dougma 23:10 did you give it a new guid though?
taxilian 23:10 sure didn't
dougma 23:10 IE can be quite lazy when deleting plugins i've noticed
maybe he's seeing that.
taxilian 23:10 shouldn't matter; I've done it before and you could leave the old one running and the new one would still start a new server
dougma 23:10 cool.