Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.29 KB

README.md

File metadata and controls

60 lines (46 loc) · 1.29 KB

Feedback Lite

Small feedback library inspired by https://github.com/ivoviz/feedback Gets screenshot, url, browser info, html, and comments from user.

Filesize minified/compressed: ~6KB (html2canvas not included)

screenshot

Usage

  <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.5.0-beta4/html2canvas.min.js"></script>
  <script>
  var feedback = new Feedback({ onSubmit: function(data) {
    // do something
    console.log(data);
  } });
  feedback.showButton();
  // or
  // feedback.attach(document.getElementById('my-feedback-btn'));
  </script>

Use feedback.showButton to render a button or attach to your own with feedback.attach.

Options

  • onSubmit Callback that receives feedback data object
  • html2canvas Pass html2canvas object. Default: window.html2canvas
  • includeBrowserInfo: Default: true
  • includeUrl: Default: true
  • includeHtml: Default: true
  • Returned Data

    {
      browser: <Object>
      html: <String>
      img: <String>
      url: <String>
      note: <String>
    }
    

    Development

    npm install
    // run weback dev server
    npm start
    // build dist
    npm run build
    

    License

    MIT