Open latot opened 3 years ago
Hi ... you can't call directly a python method, because the client/html needs to wait for guy to establish the socket. In your case, you will need to explicitly wait, and start the initialization with guy.init()
Like that :
<script src="guy.js"></script>
<body></body>
<script>
async function test() {
list = await self.elements()
console.log(list)
}
guy.init( test )
</script>
guy.init will start the test method, when the socket will be ready ... (nearly immediatly) and it will work like you expected ...
Hi, I don't know why, but i never get the mail with your answer, I really really would like to know this before, and really thank to let me know this :) I'll test all this now.
Hi hi, sadly is not working D:
I'm testing in this way:
<body style="display='none'">fuuuuuu fooooo</body>
<script>
async function start() {
await self.start()
document.style.display=""
}
guy.init( start )
</script>
In my tests, there is some weird things.
First, If I start the start
function manually after some time, it completes all in a few seconds and I can use the things.
If I use guy.init(start)
takes a lot of time to start the function, and even more to finish, in all my runs, I still can't complete the start
function.
How I know the function finish when I start it manually? because the start
function load tables, and I can see them.
I don't know why start the function take soo much time..., I have overloaded the init
function in this way:
def __init__(self):
Guy.__init__(self)
...do more things....
And the more things are pretty simple things, shouldn't take more than a few seconds...
I'm confused D:
Okey..., I found why this, here is weird thing, and not about the lib :D
If we refresh mozilla will do weird things, is like don't connect directly to the server, maybe try to use the cache or something, if I force to reload two time mozilla I get a message in python that I'm trying to connect, to force this I need to use the anonymous mode., With that, all works....
Maybe try from guy disable the cache?
Hi hi, I'm starting to learn how to use this, sadly I don't have idea why this don't works, I try several things but still can't solve this, but is too similar to the minimal examples of the documentation...
Checking in the explorer, I get the next message:
I'm using the latest version from pip3.
Thx!