On Thu, Feb 2, 2012 at 5:50 PM, C Anthony Risinger <[email protected]> wrote:
> On Thu, Feb 2, 2012 at 5:27 AM, lkcl luke <[email protected]> wrote:
>> On Thu, Feb 2, 2012 at 5:40 AM, C Anthony Risinger <[email protected]> wrote:
>>>
>>> i am returning to mail app for now, but i've also been thinking of
>>> ways to hint to pyjs that pyjd is running, and thus prevent the app
>>> from loading twice.
>>
>>  ahh no don't do that: it's by design.  people may _want_ to run a
>> compiled app within the browser-engine-that-is
>
> yeah i don't want to disable JS (google maps/etc possibly), but i do
> want to stop the JS version of an app from loading right next to the
> python driven one.

 nnope - you don't :)

 seriously: don't go down that route.  pyjd loaders should load up a
*separate* HTML file which does *not* even have the "meta" tag in it.

 if people *do* have it, then it is an indication that they *want* it
to be loaded.


>>  what would be bloody good though would be finding a way to stop the
>> double-"onload" responses.  _every_ sodding engine does this - not
>> just the webkit one but the Trident engine _and_ xulrunner.
>
> this is all in the python code right (not JS onload)?

 JS onload === python onload, it's the exact same thing.  ok, allow me
to be a bit clearer.  the "onload" system is *exactly* the same, in
the browser engines.

 however, in pythonwebkit, and in MSHTML-with-a-pythonCOM interface
_and_ in xulrunner-with-pythonxpcom, you are allowed to add *python*
functions to events *not* just random bits of javascript.

 so in the pyjd/pywebkitgtknew.py, it's the call to
SetDocumentLoadedCallback.  this is equivalent to "body.onload = {foo
fn}" in javascript.
in MSHTML, you have to subscribe to the DWebBrowserEvents2 interface,
and a function "DocumentComplete" gets called... TWICE!

 it's the same with the hulahop.py code.

 i have _no_ idea why.


>  i think i know
> what your talking about, but not 100% ... you could be getting
> document load and DOM load IIRC, there are a couple different similar
> events.  i'll see if i can repoduce, but a little clarification or
> file:lineno would be helpful.
>
>>  i've had to put in a stupid, stupid hack which is a boolean "is app
>> loaded", the result of that is that you *can't* reload the damn
>> application using Window.open or by changing the URL with the Location
>
> yeah i didn't look hard at this point, but i did notice issues
> reloading ... right click -> reload seems to repull the html/css
> however.  i'll take a look at some point :-)
>
> --
>
> C Anthony

Reply via email to