Andros: Dash: they could if subfunctions/subcalls could yield for the generator that called them
Linzie: Instance: I thought you said the point was to see if .prop was defined
Deluna: Ifcurrentsitemap && currentsitemap.nav
Trucchi: Instance: the problem is, you can’t just check for the existence of a property on an object if the object itself also may not exist
Brochure: Dash: because I could wrap the code of a .js file in a generator, then call yield everytime a certain chrome.with_result_immediate function is called in the function implementation
Jeffress: Dadada: yes, this is called “threads” :
Mcguinnes: Dash: then it would be effectively paused
Sapara: Dash: which would mean I could run_javascript in the main scope
Gundersen: Dash: to set the return value
Jeffress: And has enough well-known problems that the language designers are pretty dead set against it
Shadix: Dash: no, actually I could generator.next”return value”
Trucchi: Dadada: wait, you’re talking about interacting with the JS from C++?
Scharbach: Trucchi: unfortunately not, that would give me more possibilities
Yagoda: Trucchi: I’m writing a browser in python that interacts with webkit2gtkwhich is gobject/c/c++ through gobject introspection
Trucchi: Instance: keep in mind that that could give you false negatives – if currentsitemap.nav is a falsey value, for example
Linzie: Trucchi: a falsey object?
Bongiardina: Dash: my only “solution” currently is busy-waiting and channeling the return value through some cookies or localstorage, talk about ugly
Bellucci: Dash: not to mention that busy-waiting eats cpu
Shreeves: Dash: I would even be glad about goto/label at this point
Trucchi: Dadada: curious about the hypotheticals – can you not use generators?
Jeffress: Dadada: wait, are you writing this in js or in python
Trucchi: It sounds like “both” but I’m not sure where the limitation is
Trucchi: Sounds like the JS side
Jeffress: Sounds like something to fix on the python side
Fenderson: Dash, Trucchi, it works like this, are you ready?
Mazikowski: Webkit2gtk is webkitc++ and a c/gobject layer to easier interface with it all, some abstractions for downloads, loading pages, cookies, injection javascript into a webpage and so on
Decosta: Indeed lots of good abstractions
Gager: But I wanted to write something in my favorite language of course, which is why I recreated most of chrome’s UI in python/webkitgtk
Mierzejewski: Recreated, not exactly but mostly
Sperry: And I want chrome.* API too, so I implemented it by webscraping
Charle: The api reference on google.com :-
Hurford: That sc****r creates a js file
Gheewala: That contains every module/function of chrome.*
Klima: And basically sends a message to the UI process python
Litzau: Window.webkit.messageHandler.someAction.postMessage”chrome.extension.setUrl AND paramters in JSON”
Boden: Really, the JS discussion channel is *BY FAR* the most active channel
Mainero: The UI process gets that message and does something with it in example creating a tab or changing a bookmark
Coville: Atleast of the channels im in P:
Tout: If the chrome.* function sets a callback
Nowland: The python UI also makes sure that callback gets called
Plough: I created a CallbackManager in the js file
Soukup: The ui process runs javascript webkit.webview.run_javascript”CallbackManager.get_by_id”callback id””
Mabary: My setTimeoutgetNewData, 10000; method fires before 10s
Huelskamp: What am I doing wrong?
Brickley: So it works perfectly for results as long as they are asynchonous