-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions migration from puppeteer to astral #16
Comments
One of my core design principles is RELIABILITY. I've always been frustrated with puppeteer and my hope with astral is to make it as reliable as playwright (if not more so).
I'd be willing to accept a PR to do this, though I'm slightly concerned about the performance implication of doing it in JS land. I don't care too much since most of the time installing the browser is spent downloading and not unzipping the file. If you're not willing to make a PR, I could look into it.
I'm not quite sure what you mean by this. Could you clarify? Are you asking for the ability to change the cache directory? Definitely on the priority list, I've been meaning to add them. This will most likely be an argument to
Right now it would require using the raw bindings, but I've been meaning to add more events. I'm curious what your usecase is. Is it just to log the page console? This shouldn't be too hard to add.
There isn't one currently, but I was really curious because it doesn't seem to exist as an option in the CDP protocol. After some investigation, I found out why. Thanks for the comments and interest in astral! You make a lot of good points regarding how the library should move forward. I'm excited to hear back from you. |
I've been poc-ing it on github codespace and it doesn't look too bad actually, I'll try to open a pr 👍
Yeah basically. From my understanding currently it's written in
I have a PR almost ready for it if you want for this one 👍
Ok nice 🙂
Yeah basically it's mostly to be able to forward the browser log to deno logs for easier debugging
Personally I don't mind if as a user you need to set the background transparent by yourself, as what they've done seems indeed a bit hacky. So if they were a method to change the background color/transparacy before taking a screenshot I'd be fine with it Thanks for your quick response ! |
Great! Excited to review.
Seems reasonable. This makes sense to me.
That would be great!
That one is definitely a bit trickier, I have some ideas on how to tackle it though.
Should this be the default (or maybe just an option to
I'll look into exposing it somehow. Thanks for your interest! |
Nice !
I don't think this should be the default, because you may end up being flooded by logs, lots of website don't actually clean their debugging log 😅 Plus I don't know if it consumes a lot of resource to attach listeners to these events (though probably not that much) I guess if you'd like something more deno-ish it could be an API similar to But the callback API from puppeteer works too, it really depends what kind of API you want to offer. Personally, if the feature is there I'm happy 😆
Cool, if all of these get implemented, I think I'll be able to switch to Astro fully on my projects Another request, I noticed that the port |
Definitely possible, but I'm not really sure what the best way of automatically picking one is.
Hm, this may become a problem with us automatically downloading the browser. I assume it'll just crash because multiple processes are trying to write to the same file at the same time. |
Let me know if I missed anything, I opened tracking issues for each of the remaining requests. Thanks for issue! |
@lino-levan Perfect ! I'd say #21 and #24 are the features I'd like the most currently |
Hi !
I'm looking to possibly use this as a replacement of
npm:puppeteer
as the later isn't designed for deno which seems to cause some troubles on windows (SIGHUP unsupported, instances not properly closing) and during unit testing (leaking ops)So I'm considering switching to astral, as the others puppeteer-like libs are either outdated or have some caveats from what I tested.
I have a few questions and possibly features requests (if this is in the project scope) though:
{ sanitizeResources: false, sanitizeOps: false }
with puppeteer but the aim is to be able to have proper testing without any leaking ops (including windows).Deno.command
for the browser installation ? On windows requiring the access ofPowershell
which creates a big attack vector since you need to give a shell access. I haven't experimented it but it seems that it's possible to useDecompressionStream
to unzip the archive natively (ref: https://medium.com/deno-the-complete-reference/zip-and-unzip-files-in-deno-ee282da7369f)getBinary()
so it's possible to use the same cache as the app using it and have more controls about deno permissions ?Page.setContent()
Page.setViewport()
Puppeteer.connect()
page.on("console", (message: { text: () => string }) => console.debug("puppeteer: ${message.text()}"))
andpage.on("pageerror", (error: { message: string }) => console.warn("puppeteer: ${error.message}"))
on astral to log console message from the browser to your app ? Is it throughpage.addEventListener
omitBackground
for screenshot (unless it's enabled by default) ?Thanks in advance for your answer 😄 !
The text was updated successfully, but these errors were encountered: