On Thu, Feb 2, 2012 at 5:40 AM, C Anthony Risinger <[email protected]> wrote: > On Wed, Feb 1, 2012 at 5:46 AM, lkcl luke <[email protected]> wrote: >> On Wed, Feb 1, 2012 at 10:53 AM, C Anthony Risinger <[email protected]> wrote: >>> >>> i got distracted the last day or >>> so enhancing pywebkitgtk with various things i'll detail to others in >>> another post, >> >> cool! >> >> hmm, i should add you to the gnu project, then. > > oh, i meant the bits specific to pyjd,
ahh ok ah now you mention it i noticed those. >not pythonwebkit itself -- > though i'm happy to add those 5 patches we discussed previously (all > are safe, and already in trunk, so not necessary if you are updating > to latest WebKit). yep. > pywebkitgtk pyjd engine received a couple updates that have been > bothering me ... > > bug: > > ) properly destroy TOPLEVEL window and exit mainloop safely > i was connecting to the wrong shutdown event before (destroy), even > though it technically worked ... i think. changed to use > `delete-event` which is earlier, and can properly tear down the window > -- pywebkitgtk engine should no longer have any warnings or exceptions > from pressing the `X` (Ctrl^c still does, of course) ... if it does, > lmk. hurrah! > ) apply same-origin-ish policy to file URIs > i've enabled `enable-file-access-from-file-uris` internal webkit > option which should allow file:// URIs to work properly; _good_! that bugged me too. > cosmetic: > > ) sync GTK title with HTML <title> > the GTK window will now display the <title> of the document, and > should also work if the title is updated. that's a good idea. > ) scan <head> for icon-like uris for use as a GTK window icon > this one is kind of cool -- when the callback for `icon-loaded` > (favicon) fires, i also scan the rest of the <head> in search of > anything that looks like it could be an icon (CSS selectors): > > head link[rel~=icon][href] > head link[rel|=apple-touch-icon][href] > head meta[itemprop=image][content] > > ... and attempt to load each of them. i then choose the largest one > for use as the window icon (alt-tab, minimized, etc). it's a little > naive ATM -- no cache [needed?], no "good enough" threshold, probably > busted for file:// URIs [fixable], one-pass only -- but it works well. > WebKit offers network callbacks that could possibly be used to > inspect/hijack the data simpler/realtime, not sure whats possible > there. if no icons are found, fallback to themes `gtk-dialog-question` > (a large `are you sure?` icon) instead of the nasty `OMG! NOT > FOUND!!!1` icon. > > ... if you want to try, just update pyjd to HEAD, or just replace the > `pyjd/pywebkitgtknew.py` file on your system with the one from HEAD. > > 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 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. 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 API. l.

