Hi David,<br> <br> i am working on the same problem with Ankush.<br> <br> We tried your solution and it worked, but we have one additional<br> problem, WebFrame::windowObjectCleared() is triggered for each frame<br> refresh so our handler gets called each time.
<br> <br> Before our handler is called, the frame gets destroyed and we see a<br> segmentation fault in our handler.<br> <br> Can you suggest any way by which prevent calling of our handler for each frame refresh.<br> <br>
Thanks<tt></tt><br>
Ashish<tt></tt><br>
<br>
<br><br><div class="gmail_quote">On Jan 19, 2008 6:05 PM, David Carson <<a href="mailto:dacarson@gmail.com">dacarson@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ankush,<br>I have run into this same problem too, and I was pointed to<br>WebFrame::windowObjectCleared(). If you re-attach your handler in that<br>method, everything will work, including frames and iframes.<br><br>For Mac look at:
<br>WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm<br>WebKit/mac/WebCoreSupport/WebFrameBridge.mm<br>Windows:<br>WebKit/win/WebFrame.cpp<br>Gtk:<br>WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp<br><br>Cheers<br>Davidc
<br><div><div></div><div class="Wj3C7c"><br>On Fri, Jan 18, 2008 at 10:48 AM, <<a href="mailto:jligman@mindspring.com">jligman@mindspring.com</a>> wrote:<br>><br>> Hi Ankush,<br>><br>> Not sure if this is exactly the right way to do this, or what your looking
<br>> for, but I think something like the following might work.<br>><br>> KJS::Window* window = KJS::Window::retrieveWindow(frame);<br>> if (window) {<br>> ExecState* exec = window->interpreter()->globalExec();
<br>> window->put( exec, "your object name here", your object here,<br>> KJS::DontDelete );<br>> }<br>><br>> Thanks<br>> Joe<br>><br>><br>><br>> -----Original Message-----<br>
> From: ankush tiwari<br>> Sent: Jan 18, 2008 7:55 AM<br>> To: <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br>> Subject: [webkit-dev] Runtime JSObject<br>><br>> Hi All,<br>
><br>> We are creating a run time JSObject "myImplementation" by using the NPN<br>> framework (C binding) available in webkit. Currently we are facing a problem<br>> that our object is not getting recognized when we navigate to a new page.
<br>><br>> (Note: Our object is not released, its just not getting recognized in the<br>> new page's interpreter context)<br>><br>> We want to retain our object till the time the interpreter is valid but we
<br>> are not able to do so. We observed that for every script handler a context<br>> is created and if we put our code in KJSProxy::evaluate and insert our<br>> object every time its working fine.<br>><br>> But this way we are creating too many unnecessary instances of our object.
<br>><br>> Can someone suggest a better way for retaining the object throughout the<br>> interpreters life cycle?<br>><br>> Thanks,<br>> Ankush.<br>><br></div></div>> _______________________________________________
<br>> webkit-dev mailing list<br><div class="Ih2E3d">> <a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org</a><br></div>> <a href="http://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">
http://lists.webkit.org/mailman/listinfo/webkit-dev</a><br>><br>><br>_______________________________________________<br>webkit-dev mailing list<br><div class="Ih2E3d"><a href="mailto:webkit-dev@lists.webkit.org">webkit-dev@lists.webkit.org
</a><br></div><a href="http://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">http://lists.webkit.org/mailman/listinfo/webkit-dev</a><br></blockquote></div><br>