Hi All,

First thing first, The BrowserCore is not WebCore of Webkit, its our own. We are only using JavaScriptCore Library from WebKit.

The Platform we are working on is Gtk on Linux.

Methods/Properties of Browser Objects or Custom Objects are registered as Callbacks using JSClassDefinition structure(JavaScriptCore APIs) in our Interface Code for SquirrelFish and BrowserCore.


Best Regards,
Mohit

 


On Thu, Oct 28, 2010 at 12:30 AM, Oliver Hunt <oliver@apple.com> wrote:
Hi Mohit, it's good to see a new project using the JavaScriptCore APIs.

Unfortunately what you're describing clearly involves the entirety of WebKit (because you're interacting with a webpage). So we need some more information before we can provide meaningful assistance.

The most important information we need to know is what platform you are using webkit on as they all have slightly different APIs -- are you using the Mac, Gtk, Qt, or Windows, etc port?

Following on from that how are you injecting your new methods and properties?

--Oliver


On Oct 27, 2010, at 11:56 AM, mohit kingra wrote:





Dear all,

Below is the problem i'm stuck at in a Project.


The scope of the problem: - It is related to the interfacing of browser core and Squirrelfish JS Engine via exposed C interfaces by use of JSClassDefinition.

Problem Statement
: As per our understanding for every DOM document (HTMLPage with JS), we create context and register the DOM objects in engine and at runtime we set or retrieve or process an event via callback mechanism.
                          The problem arises when we try to communicate between the DOM Objects in two different contexts. To explain it further, we have the following html page:
<html>
<head> <script> function showAlert(){“I am able to call parent function as well!!!!”); </script></head>
<body> <iframe  src=”frmsrc.html”> </body>
</html>
The content of the frmsrc.html is given below: -
<html>
<head>
<script> function child() {alert(“I am able to call child function”);} </script> </head>
<script> child(); parent.showAlert(); </script>
</html>
In ideal case in any browser, it should display both the alert messages.
                                                                                                    In our case, we are getting the alert message in the frmsrc.html i.e: “I am able to call child function”. But when it is trying to access the showAlert()  in the parent html it is not accessible.  Basically it is not able to access the non standard (user defined) properties/functions of DOM objects in different contexts.

Our understanding: Whenever we encounter a page we create a context and initialize Window Object using Squirrelfish APIs. We are not very clear what to be done for the previous context while creating the new context for the new page.
                                                       We have the browser core code in C so we are forced to use the callback mechanism to interact with Squirrelfish Engine. (i.e; - registering all attributes and functions for the Object during context creation while initializing the Window Class and then getting callback at run time). We are not sure what is do be done for communication of DOM objects across contexts.

Best Regards,

Mohit Kingra

_______________________________________________
squirrelfish-dev mailing list
squirrelfish-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/squirrelfish-dev