One of my goals during this rewriting of VandalSniper as a more general-purpose browser has been to reduce or eliminate the dependency on platform-specific glue libraries. JSCall# uses a C/C++ library to interact with the DOM, and this is just one more hurdle to be jumped over on the road to portability. Who wants to set up a build environment against Mozilla on Windows? Not me.
To make calls back, I copied an idea from JSCall#. The call is placed by constructing a string containing the function name and argument list, and the document title is set to this string, then immediately set back to what it was. This is picked up by the WebControl.TitleChange event handler, where the pieces are pulled apart into an array, the function name mapped to a delegate, and the delegate invoked with the arguments.
It’s one big kludge, but it works remarkably well.
10 Replies to “Glue-free JSCall#”
Nice idea! I will have to try this in AspNetEdit.. after I finish my exams, of course 🙂
Well, I did it anyway. It works!
PS Hutch: Your JSCall has got that issue, please test your code!
As for the modulo operator, good catch. I didn’t account for that since I’m not really using that operator at all.
(I’ve tried to post before but nothing happened, so I try again now).
I’ve put in place the mechanism as you described and it works pretty well.
It seems that, after setting document.title in js, it waits until the c# event handler function is completed, but while waiting, the webcontrol is not able to execute any other javasrcipt call.
Can you help me?
Thanks in advance!!!
That’s what I was fearing…
So, I’ll look for a different solution…
although I understand that this is not the best place where to post this question (we’re talking about JSCall here), I cannot find any other place where to find support.
This is my problem:
I’m running Ubunto 8.04. I’ve embed mozilla through Gecko# in my mono application. Everithing works, I can also see pages with Flash contents.
Unfortunatelly I cannot see pdf files, neither direclty opening the pdf itself, nor embedding them into html pages. In firefox 3 I can see them in both ways, with also pdf 3D support. What do I miss?
Thanks for you help!
Hi Chris, I’s me again… please forget my last question. I could solve the problem by using the .tag.gz installer from Adobe rather than .deb package from the same site.
Thank you very much.
so thank you very much for this simple and nice solution 🙂
p.s. I like ff very much, but still don’t understand why that simple task is SO complicated 🙁
Comments are closed.