Skip to content
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

Screenshot of current screen in feedback #93

Open
danielgary opened this issue May 31, 2018 · 2 comments
Open

Screenshot of current screen in feedback #93

danielgary opened this issue May 31, 2018 · 2 comments

Comments

@danielgary
Copy link
Contributor

Using the html2canvas plus the HTML5 canvas toDataUrl('image/png') method, we can effectively capture a screenshot of the current page. This would be great for feedback. The flow should be:

  1. FeedbackButton click
  2. html2canvas called on body
  3. convert to dataUrl
  4. Show feedback modal with image src set to dataUrl
  5. Append dataUrl to request
@danielgary
Copy link
Contributor Author

html2canvas available here: http://html2canvas.hertzen.com/
or
npm install --save html2canvas

@danielgary
Copy link
Contributor Author

danielgary commented May 31, 2018

Sample code for converting to dataUrl:

html2canvas($('body').get(0), {
  onrendered: function(canvas) {
    var win = $w.open();
    win.document.write('<img src="'+canvas.toDataURL("image/png")+'"/>');
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant