-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
.$detach() returns null when being used on image element #274
Comments
It seems like detach is indeed broken here. You could look in the logs/session database to try to figure out if there's any kind of error shown. However, this won't work in detached dom in any case. Canvas doesn't produce dom changes, and we haven't yet built anything to record all the canvas changes that occur. i think your best option is actually to use toDataURL() on the image itself in page. Does that api not work? |
image doesn't have such method "toDataURL" if I am not wrong Regarding canvas - I use canvas on NodeJS side:
|
Sorry, I confused myself on this one. The 1st option is the preferred approach if these are http images (eg, not page drawn) since it won't require any extra work. The backend is already loading the image, so this is just a step of sending it to client. It will also exist in your session database if that's preferable. Is there a reason not to use 1st? |
I guess you are wanting base64. The data will be raw buffer, so you would just add toString('base64') on a modern version of node. |
This approach also acceptable for me and i am using it right now, works perfectly as well. But i would leave this issue open if you don't against. Thank you for your reply, and whenever i will have some free time, i will try to figure out why detach is not working on image elements, and maybe even will try to contribute to fix this issue |
Also .$detach() returns null when hero instance is created with |
I am trying to extract image element from page to get it's as base64, there is few approaches that i see:
I prefer third approach as it is not intend to make extra calls and can be reused as many times as i want without affecting performance. I know for sure that .$detach() on image element worked before, because i tested it and had successful results... but now it returns NULL instead of ISuperElement
Here is snippet to replicate issue:
The text was updated successfully, but these errors were encountered: