Skip to content
Hussain edited this page Aug 9, 2013 · 12 revisions

feedback.js - Feedback form with screenshot

This script allows you to create feedback forms which include a screenshot, created on the clients browser, along with the form. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.

How does it work?

The script is based on the html2canvas library, which renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements. This script adds the options for the user to draw elements on top of that image, such as mark points of interest on the image along with the feedback they send.

It does not require any rendering from the server, as the whole image is created on the clients browser.

No plugins, no flash, no interaction needed from the server, just pure JavaScript!

Browser compatibility

Firefox 3.5+
Newer versions of Google Chrome, Safari & Opera
IE9

Bugs to watch

Not all CSS properties are supported only most common ones so some will not render.

Same Origin Policy (SOP) cannot interact with Javascript or other Scripts like JQuery on other websites and therefore will not be able to render the images.

Does not render the Flash or Java applets.

Does not render iframe content unless it is under the same origin.

Scalable Vector Graphic images have issues rendering because they taint the Canvas.

Backend

The backend uses file called sendfeedback.php and uses PHPMailer to send emails with attached screenshot to any email address. The file sendfeedback.php can be edited to change To and From information along with options to embed or attach screenshot in the email.

Clone this wiki locally