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

IRC Nick Time (GMT-7) Message
dougma 00:10 hey Feeling: how goes the installer?
Feeling 00:10 not good
probably i will use the OnError Event from object tag
dougma 00:10 i will be getting to my install process next week
Feeling 00:10 me too
how about process the update plugin on IE?
dougma 00:10 i was going to wrap the msi in a cab
Feeling 00:10 but if you use msi. should terminate to IE browser when update plugin. isn't it?
dougma 00:10 but have a link to the msi too (in case their settings reject cab)
taxilian suggests that's not necessary
Feeling 00:10 i know but that is not IE.
i think.
dougma 00:10 dunno... i've never had problems with cabs in the past
Feeling 00:10 probably ie don't release plugin instance
cab is ok, i mean use msi. maybe you don't use msi like cab.
dougma 00:10 can't offer you much help as i haven't tried to get it working yet
Feeling 00:10 ok.
when are taxilian come here?
dougma 00:10 maybe ~8 hours from now?
Feeling 00:10 hmm. ok. thanks. see you tomorrow.
dougma 00:10 bye
linearray 07:10 can anyone tell me how to use log levels in my own code?
taxilian 08:10 linearray: I can tell you how it's supposed to work
I'm not actually 100% sure it's working
linearray 08:10 I'd love to hear it :)
taxilian 08:10 you're supposed to just return the loglevel from a function in your Factory.cpp file
and it should log at that level and above
linearray 08:10 hehe now i have two problems
navigator.plugins.refresh(false); is supposed to reload existing plugins, yes?
ok, that was the wrong assumption... I tried changing the loglevel in Factory.cpp but it never reloaded my plugin ;)
taxilian 08:10 no, that doesn't reload existing plugins
that reloads the plugin list
you have to remove it from the page and add it again to reload a plugin
linearray 08:10 interesting
linearray 09:10 some forum threads really crack me up
taxilian 09:10 so I now have the owner of gecko's NPAPI plugin module on my skype contact list
can anyone think of any questions I should ask him?
linearray 10:10 I can only think of ugly ways to reload the plugin.... is there anything nicer than this?
taxilian 10:10 that's pretty much the only way I know
linearray 10:10 k
Then I'll add it to the wiki :)
taxilian 10:10 okay =]
linearray 10:10 hm!
so what if a plugin is used on several pages... I guess it would need to be unloaded on all of them
taxilian 10:10 probably
Feeeling 10:10 hi taxilian and dougma
Feeling 10:10 taxilian: did you see my past question?
time is AM 1:27. hmm. very sleepy....
Sudi 10:10 Good Morning to all FB experts!!
taxilian 11:10 g'morning
Feeling: repeat your question please
I probably saw it, but I'm too busy to read back through the logs again to find it, and this way I can be sure
taxilian 11:10 kylehuff, you around?
kylehuff 11:10 oui
taxilian 11:10 I have a task for you, for the good of all… when you have time
I want you to submit a bug on that they should add support for private npapi plugins in extensions
be detailed as to exactly what you want, how it should work, how you would use it, and what problems it solves
think you can find time for that?
kylehuff 11:10 I think I can do that...
(I would also like to see it happen, so it is meaningful to me)
taxilian 11:10 and that is why I want you to file it instead of me
kylehuff 11:10 so, you don't personally have a use for it?
taxilian 11:10 me? no
kylehuff 11:10 just a "for the good of mankind" kind of deal?
taxilian 11:10 but lots of people have asked for it
Josh Aas recommended that we file it rather than him (since consumer bugs are more highly rated than developer bugs) and that anyone who wants to use it add a polite message explaining how they would use it and why they need it
if we can show that a lot of people would use it then it will get higher priority
kylehuff 11:10 makes sense
Sudi 12:10 Taxilian.. if I need to use same instance of plugin between pages is it possible ?? can we do something like singleton and not destroy when page changes and only destroy it when browser is closed ??
staylor 12:10 question about KeyEvent, how can I capture the alphanumerics on the keyboard?
Sudi 12:10 does onyone know how can I check from plugin if javascript method exists ???
taxilian 12:10 if (plugin.methodName)
Sudi 12:10 Richard.. u there ???
taxilian 12:10 yes
staylor 12:10 taxilian, any idea on the KeyEvent or do I have to implement a native version?
Sudi 12:10 I have a small question - > if I need to use same instance of plugin between pages is it possible ?? can we do something like singleton and not destroy when page changes and only destroy it when browser is closed ??
in MAC
taxilian 12:10 staylor: presumably using the keycode
take a look at PluginWindowWin at how keyevent is created
Sudi: no, you can't use the same instance of the plugin, but you can use static or global methods and clean them up in StaticDeinitialize
you can use StaticInitialize to set them up if needed
I have used that before to communicate between instances or to have a singleton that is shared between instances
Sudi 12:10 hhhmmm.. ok.. thanks
one more question.. I have a iframe within page and that iframe has method that I want to call from plugin -- write now i am using getProperty<FB::JSObjectPtr>("Window") - is there a way I can access something like "window.myIframe" .. will that work ?
taxilian 12:10 subject to the same restrictions that apply to javascript, I suspet
but I haven't confirmed that
you can try it
Sudi 12:10 ok.. let me try that
EL45 13:10 Hey all, I was eventually able to get the FBTestplugin to compile on OSX yesterday with your help. However, now it does't seem to be registering with my browsers. I ran 'cp -a FBTestPlugin.plugin/ /Library/Internet\ Plug-Ins/' and verified it made in to the plugins folder. However about:plugins in chrome and firefox do not display the plugin.
Sudi 13:10 I am getting EXC_BAD_ACCESS.. KERN_PROTECTION_FAILURE at 0x00000000000000000
taxilian 13:10 EL45: first of all, I don't recommend putting it in /Library; I'd put it in ~/Library instead
Sudi 13:10 so there is no way I can access the iframe
EL45 13:10 Ok. Noted. However I have tried both.
taxilian 13:10 Sudi: you're getting better; you gave us the error message. this time, however, you didn't tell us what you were doing =]
EL45: are you compiling it 64 bit only by chance?
EL45 13:10 xcode says: 'DEBUG | ALL_BUILD| x86_64
taxilian 13:10 try compiling it for i386
it may be only building 64 bit for some reason
rather than copying it, I'd just make a symlink
linearray 13:10 EL45: ln -s buildex/projects/FBTestPlugin/Debug/FBTestPlugin.plugin ~/Library/Internet Plug-Ins/
first remove the plugin you copied, then do this ^^
EL45 13:10 Thank you. linearray. It's building. Ill let you know how it goes in a sec.
Im building with MinSizeRel/ i386 But it still takes significantly longer than my Windows PC. Is there something im missing?
taxilian 13:10 wait, *Mac* is taking significantly longer than your windows PC?
linearray 13:10 probably the lack of precompiled headers?
or does it have them? no idea ... :)
taxilian 13:10 I've tried turning on PCH on mac before… it didn't help
linearray 13:10 k
taxilian 13:10 rather it didn't make a significant difference
mac has always been so much faster to build that I haven't worried about it much
EL45 13:10 Hmm.
linearray 13:10 maybe your windows PC is a lot faster? :)
EL45 13:10 Haha perhaps... But it costed so much less?? :p
linearray 13:10 hehe, a mystery
EL45 13:10 Ok. just finished building. I added symlink, opened firefox and still same story.
linearray 13:10 curious.
I'm kinda out of ideas
EL45 13:10 Ok. :/ Thank you for all of your help though!
linearray 13:10 but if the plugin really is in ~/Library/Internet Plug-Ins then the browser either can't read it (permissions), or it doesn't like what it's reading (build problem)
EL45 13:10 The interesting thing is that when I build my custom plugin it registers with the browsers, however when I make any calls to my plugin it fails.
Sudi 13:10 This is what I did.. I have a test page with <iframe id="a" name="a" page="iframe.html" ....> and within that iframe I have myFunction() that I want to call from plugin... now in plugin I am calling like this - FB::JSObjectPtr jsObjPtr = windowObj->getProperty<FB::JSObjectPtr>("window.a"); jsObjPtr->Invoke(methodname,arg); ---- after running this the Safari browser crashed and when I cliecked report error I got what I typed above.
EL45 13:10 My symlink was incorrect. Working now. Still dont know why is wasnt before. Oh well. Thanks again guys.
taxilian 13:10 Sudi: you can't do getProperty("window.a")
you can do getProperty("window")->getProperty("a")
(each time casting as a JSObjectPtr)
Sudi 13:10 that is what i was thinking as well
but i dont see anything that i can do there
taxilian 13:10 then you need to check the return value of each thing because your crash comes from the JSObjectPtr being NULL
Sudi 13:10 wath do you mean by return value for each thing ??
taxilian 13:10 getProperty("window")
check the return value
check the return value
!find getElement
FireBreathBot 13:10 Found 8 possible matches. Displaying 5
/^ virtual ElementPtr getElement(const int idx) const$/ (f) found in src/ScriptingCore/DOM/Element.h:
/^ virtual ElementPtr getElement(const std::string& name) const$/ (f) found in src/ScriptingCore/DOM/Element.h:
/^FB::DOM::ElementPtr Document::getElementById(const std::string& elem_id) const$/ (f) found in src/ActiveXCore/AXDOM/Document.cpp:
/^ElementPtr Element::getElementById(const std::string& id) const$/ (f) found in src/ScriptingCore/DOM/Element.cpp:
/^std::vector<FB::DOM::ElementPtr> Document::getElementsByTagName(const std::string& tagName) const$/ (f) found in src/ActiveXCore/AXDOM/Document.cpp:
taxilian 13:10 you probably actually want getElement, though
not getProperty
property will work but will give you the JSObject instead of the DOM::Element
Sudi 13:10 ok... let me play around for a while and see if that works.. I did that in webkit using webView
staylor 13:10 is there a way to post to the plugin's message loop? I need to force a redraw from another thread.
taxilian 13:10 staylor: just call the plugin window's InvalidateWindow
I believe that will automatically marshall to the main thread if needed
staylor 13:10 but the window pointer could be invalid by a onWindowAttach/Detach right?
taxilian 13:10 yes; you should have already stopped your drawing thread in the detach function, though, so that will never happen, right?
staylor 13:10 would the old window pointer still be valid within the Attach/Detach events?
taxilian 13:10 within the events, yes
after the events, no
rather after detached and before attached
staylor 13:10 ah okay, then it's all good
I was concerned that the pointer would be invalid before I could do anything about it
taxilian 13:10 that would be a problem
staylor 13:10 but as long as I can protect the window pointer with a mutex everything's good
taxilian 13:10 should work
just make sure you're not still doing anything after detached finishes
staylor 13:10 the drawing thread acquires a lock then checks for the window pointer to not be nullptr before calling invalidate, then the attach/detach events will also get a lock before going so that should work fine.
taxilian 13:10 sounds good
Sudi 14:10 !getElementById
taxilian 14:10 !find getElementById
FireBreathBot 14:10 Found 2 possible matches. Displaying 2
Sudi 14:10 !find getElementById
FireBreathBot 14:10 /^FB::DOM::ElementPtr Document::getElementById(const std::string& elem_id) const$/ (f) found in src/ActiveXCore/AXDOM/Document.cpp:
Found 2 possible matches. Displaying 2
/^ElementPtr Element::getElementById(const std::string& id) const$/ (f) found in src/ScriptingCore/DOM/Element.cpp:
/^FB::DOM::ElementPtr Document::getElementById(const std::string& elem_id) const$/ (f) found in src/ActiveXCore/AXDOM/Document.cpp:
/^ElementPtr Element::getElementById(const std::string& id) const$/ (f) found in src/ScriptingCore/DOM/Element.cpp:
taxilian 14:10 !wiki getElementById
FireBreathBot 14:10 2 results found. Note: Results limited to 8
"class FB DOM Element getElementById":
"class FB ActiveX AXDOM Document getElementById":
taxilian 14:10 may also be useful
Sudi 14:10 thanks
Sudi 14:10 !find FB::DOM
FireBreathBot 14:10 Could not find any tags matching FB::DOM
Sudi 14:10 !find FB::Element
FireBreathBot 14:10 Could not find any tags matching FB::Element
Sudi 14:10 !wiki FB:DOM
FireBreathBot 14:10 0 results found. Note: Results limited to 8
taxilian 14:10 what are you looking for?
Sudi 14:10 need some example of putting window -> a together and returing jsObj ptr
taxilian 14:10 I gave you one
Sudi 14:10 getProperty("window")->getElementById("a") will not work because belongs to diff class
taxilian 14:10 you never call getElementById on window
you call it on document
window.a is a deprecated method of accessing something by id anyway
Sudi 14:10 that will return JSObjectPtr right ?
taxilian 14:10 probably will return a FB::DOM::Element
which should work just as well
if not better
Sudi 14:10 ok.. let me give it a shot
ok its returning FB::DOM::ElementPtr
so now I neen to call Invoke from FB::JSObjectPtr for method within that iframe element that i just created
can I convert elementPtr to JSObjectPtr directly ??
taxilian 14:10 ->getJSObject or some such
look at the class
Sudi 14:10 sure
!find FB::JSObjectPtr
FireBreathBot 14:10 Could not find any tags matching FB::JSObjectPtr
Sudi 15:10 !find getJSObject
FireBreathBot 15:10 Found 3 possible matches. Displaying 3
/^ virtual FB::JSObjectPtr getJSObject() const { return m_element; }$/ (f) found in src/ScriptingCore/DOM/Node.h:
/^ JSObjectRef getJSObjectRef() const {$/ (f) found in src/WebKitCore/JSObjectRefAPI.h:
/^ JSObjectRef getJSObjectRef() {$/ (f) found in src/WebKitCore/JSObjectRefObject.h:
Sudi 15:10 FB::DOM::ElementPtr elem = m_host->getDOMDocument()->getElementById("a"); FB::JSObjectPtr jsObjPtrIframe = elem->getISObject(); jsObjPtrIFrame->Invoke(methodname, args);
did I do somrthing wrong here ???
it is still not able to find the method
taxilian 15:10 add a elem->getProperty<FB::JSObjectPtr>(methodname) and then ->InvokeDefault that
Sudi 15:10 ok
Sudi 15:10 you mean I need to add elem->getProperty<FB::JSObjectPtr>(methodname) after FB::DOM::ElementPtr elem = m_host->getDOMDocument()->getElementById("a"); and jsObjectPtrIFrame call InvokeDefault
I mean instead of jsObjectPtr use elem->InvokeDefault
bit confused here
taxilian 15:10 no, you want to use JSObjectPTr
to invokedefault
just get an extra property
Sudi 15:10 ok.. doing that right now
taxilian 15:10 basically in javascript there are no real methods
pretty much everything is a function
so get the function as a property and then invoke it
Sudi 15:10 got it what you are trying to say
I am getting error when trying to use InvokeDefault with JSObjectPTr
guess it is in element class
taxilian 15:10 "it"?
InvokeDefault is not a method of the element class
it's a method of the JSObject class
well, JSAPI specifically
Sudi 15:10 class FB::JSObject has no member named InvokeDefault <- this is what I am getting as an error
!find InvokeDefault
FireBreathBot 15:10 Found 2 possible matches. Displaying 2
/^bool NPJavascriptObject::InvokeDefault(const NPVariant *args, uint32_t argCount, NPVariant *result)$/ (f) found in src/NpapiCore/NPJavascriptObject.cpp:
/^bool NpapiBrowserHost::InvokeDefault(NPObject *npobj, const NPVariant *args,$/ (f) found in src/NpapiCore/NpapiBrowserHost.cpp:
taxilian 15:10 oh, wait
I'm sorry
you're right
i'm half asleep
Invoke("", ...)
just give empty string for the method name
Sudi 15:10 ok..
jsObjPtrIFrame->InvokeDefault("",args) <- will that work ?
taxilian 15:10 no, just Invoke
Invoke("", args)
InvokeDefault is a NPAPI thing
I just have NPAPI on my brain today because I was talking to one of mozilla's dev managers this morning
Sudi 15:10 I tried that as well
hehe :)
linearray 15:10 what did he say? anything newsworthy?
Sudi 15:10 that is good thing.. NPAPI rocks
taxilian 15:10 linearray: well, he did confirm that firefox7 can handle upgrading a plugin without restarting hte browser
Sudi 15:10 any header file that I need to add ??
taxilian 15:10 Sudi: what type is jsObjPtrIFrame?
and what is the error?
Sudi 15:10 same
taxilian 15:10 pastebin the code snippet
Sudi 15:10 FB::JSObjectPtr
FB::DOM::ElementPtr elem= m_host->getDOMDocument()->getElementById("a"); FB::JSObjPrtIFrame = elem->getProperty<FB::JSObjectPtr>(methodName);
jsObjPrtIFrame = InvokeDefault("",vl);
linearray 15:10 you are assigning to a type, not a variable
taxilian 15:10 Sudi: is that the actual code? are you copying and pasting, or typing? because if you're copying and pasting you're way off in nowhere land
Sudi 15:10 i am typing
taxilian 15:10 please copy and paste the code into a pastebin or gist or something
dont' ype
Sudi 15:10 I have 2 sys
taxilian 15:10 so open a web browser in the other
Sudi 15:10 working on mac and chatting on win
taxilian 16:10 you're making so many mistakes copying your code that you are hardly coherent
Sudi 16:10 ok.. I will copy that
taxilian 16:10 install colloquy; it's a irc chat program for mac
then you can work and chat on mac
Sudi 16:10 ok
linearray 16:10 we have webchat as well
linearray 16:10 btw. would you agree it's a good idea to always refer to a boost::shared_ptr<classA> as a classAPtr for consistency?
taxilian 16:10 I generally feel that is the case
which is why I have tried to do so in FireBreath
mainly it's just shorter to type, though
linearray 16:10 k
taxilian 16:10 you know about the FB_FORWARD_PTR macro, right?
linearray 16:10 yes
taxilian 16:10 good
Sudi 16:10 was out for a while.. Richard can you paste the pastebin link
taxilian 16:10 .pb
FireBreathBot 16:10 When you need to share code, logs, or anything else longer than a couple of lines, use a pastebin.,, and are all good options
Sudi 16:10 <- this is what I am using
taxilian 16:10 what...
why are you getting the dom window and then trying to get the .window property?
wel,l that's effectively a no-op since you aren't using it
but it's pointless, just FYI
and as I said several times, Invoke("", vl), not InvokeDefault
Sudi 16:10 please ignore the FB::DOM::WindowPtr windowObj = m_host->getDOMWindow(); FB::JSObjectPtr jsObjPtr = windowObj->getProperty<FB::JSObjectPtr>("window");
taxilian 16:10 InvokeDefault is NPAPI, not JSAPI
Sudi 16:10 that was something I did for testing
taxilian 16:10 so line 19 in the paste should just be Invoke
Sudi 16:10 to use directly
taxilian 16:10 trying to help you understand; saying getDOMWindow()->getProperty<..>("window") is like saying var l = window.window; in javascript
Sudi 16:10 ok.. can you look at this one ->
that is what is should look like
the addtional two like was when I started and tested
so <- this looks good or I am missing something ?
taxilian 16:10 Sudi: there is no InvokeDefault
there is only Invoke
that is the sole thing I todl you to change before and you didn't change it
Sudi 16:10 but I am doing elem->getProperty<FB::JSObjectPtr>(methodName) <-- so I am already providing method name
taxilian 16:10 yes
I know
which is why you pass emptystring in as the method name when you call "Invoke"
I have already explained at least 4 times that InvokeDefault is what it translates into in NPAPI, but in JSAPI (what you are using) it is Invoke
Sudi 16:10 do I need to call Invoke without first argument like Invoke("", vl);
taxilian 16:10 You need to go back and read what I have already told you
I have given you the exact syntax you need at least 3 times
and I am really starting to lose patience
Sudi 16:10 I need to send you some beer to get your patience back :) .. thanks for your explanation..
I will do exeatly like you said
taxilian 16:10 hehe. I actually don't drink alcohol, but I appreciate the sentiments =]
Sudi 17:10 :) <- I changed it but same result :(
taxilian 17:10 and what result is that? please paste the exact error message
Sudi 17:10 Exception Type: EXE_BAD_ACCESS
taxilian 17:10 then one of the things returned was NULL
you need to check for null
Sudi 17:10 Exception Codes: KERN_PROCTION_FAILURE at 0x000000000000000
taxilian 17:10 my guess is that your getElementById is returning NULL
Sudi 17:10 ok.. let me check that as well
taxilian 17:10 remember those are smart pointers
I'm out of time to help you with any of this today; you may need to call getJSObject() to check for the NULL pointer
as in:
if (elem->getJSObject()) { // it isn't null }
and if (jsObjPtrIFrame) { // it isn't null }
Sudi 17:10 you are right.. it is null
I will have a look why it is null .. thanks for all your help
Sudi 17:10 if (elem->getJSObject()) <-- is not null but if (elem->getJSObject()) is null
which means elem->getProperty<FB::JSObjectPtr>(methodName); <- tihs is not working
taxilian 17:10 then that object doesn't have the method you're looking for
Sudi 17:10 it has it but it is a iframe and has different file for it..
that diff file has method
in it ..
taxilian 17:10 and are methods inside the iframe normall accessible from the iframe itself?
the iframe element?
is that how you'd get it in javascript? document.getElementById("a").methodName ?
Sudi 17:10 yes
taxilian 17:10 and can you access it from javascript?
does it work from javascript?
Sudi 17:10 let me check calling iframe method directly from javascript of main page
Sudi 17:10 not working when document.getElementById("a").<methodName> used but it is used by calling Window.a.<methodname>
taxilian 17:10 then there is something strange going on
and I don't know why it would work that way
You can try the other route, I suppose; getDOMWindow()->getElement("a")->getProperty<FB::JSObjectPtr>(methodName)
checking for nulls, of course
Sudi 17:10 ok.. I will fo that
taxilian 17:10 which browser are you in, btw?
Sudi 17:10 If I need to invoke method without argument Invoke(methodname, "") <- will it work ??
Safari 5.0
taxilian 17:10 it might, but safer to get the property
Sudi 17:10 or Invoke(methodname, null)
Sudi 17:10 getDOMWindow()-> does not have getElement() defined
taxilian 18:10 hmm. probably need getNode, then
Sudi 18:10 ok.. will try that later.. i guess did enough for today.. thanks Richard ..
I will look into it today sometime later
taxilian 18:10 good luck
Sudi 18:10 thk :)
you know what ... I changed "window" to "a" and it worked
taxilian 18:10 I already told you you don't need to get "window"
that's what getDOMWindow() returns you
Sudi 18:10 m_host->getDOMWindow()->getProperty<FB::JSObjectPtr>("a")
direct property within window
I will do some more test this evening.. but you saved my day
like you said it was like window.window so i tried to make it like window.a and it worked
taxilian 18:10 glad you got it working. I'm off for now; good luck
Sudi 18:10 thanks .. would have not been possible without you
have a nice day
Feeling 18:10 hi all~
taxilian 20:10 lol. "A SQL query walks into a bar and joins two tables"
taxilian 23:10 FIREBREATH-1