sito web screenshot sul mio server a seconda UTENTE
-
26-10-2019 - |
Domanda
mi sono imbattuto in molte domande simili come questo, ma non riuscivo a trovare una risposta semplice. Il mio obiettivo è quello di creare la mia pagina web delle miniature sul mio server per un particolare utente (a seconda del SESSION
). Sito web è un mezzo dinamico per ogni diversi cambiamenti di contenuto dell'utente come quello contenuto di utenti su Facebook.
Che cosa devo fare qui è di generare uno screenshot quando l'utente si verifica un problema con l'applicazione e fare clic sul pulsante di cattura
ho avuto molte opzioni come
- libwkhtmltox
- wkhtmltopdf
, ma non ottenendo che dovrei usare anche suggerire altri se meglio.
ho server Linux e utilizzando PHP nucleo e avere accesso shell ad esso.
non si riferiscono sito esterno in quanto sono in grado di ottenere un'istantanea nel mio caso (come ho detto variabile SESSION
viene mantenuta per ogni utente).
Si prega di aiutarmi con il tutorial.
Grazie in anticipo
Soluzione
libwkhtmltox
and wkhtmltopdf
are both great technologies for capturing images of web pages. However, the problem is that it's really hard to get these technologies to have the same session as your user, if not impossible. Additionally, many errors users experience aren't reproducible on a second request. (Errors caused by db connection errors, caching, etc.) So doing something like this will have limited value. One alternative would be to throw a popup when they click your send errorpage snap
that explains how to take a screenshot.
If you absolutely want to go down this path of automating the screenshot, here's a crazy, probably stupidly insecure idea. As wkhtmltopdf
is built on webkit, there are options to set cookies. As long as your php session
is cookie based, you could pass the user's session_id
to wkhtmltopdf
, and hijack your own user's session, thereby recreating the page when wkhtmltopdf
makes the request. I'm so getting downvoted for suggesting this...