brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
694 stars 529 forks source link

Invalid signature data being generated from webapp on mobile #175

Open rioug opened 4 years ago

rioug commented 4 years ago

We running jsignature on Kiosk Browser for Androit : https://www.android-kiosk.com/#features

Every now and then we get invalid svg data, in the last month about 1% of generated signature had some invalid data. It's a low number, but still annoying as we need to ask our customer to resign form.

We call $element.jSignature('getData', 'svg') to generate the image data, which is then send back to the server, and is included into a generated pdf. We are running the app on Samsung tab A tablet, they are running android 5.5.1 and chrome 43.According to this : https://help.android-kiosk.com/en/article/webview-updates-1ru6hb7/, it uses android Webview based on the google chrome engine to render the application.

Sample data : Signature 1:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="NaN" height="NaN">
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M NaN NaN l 1 1"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M NaN NaN l NaN NaN"/>
</svg>

Signature 2:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="NaN" height="NaN">
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M NaN NaN l NaN NaN"/><path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M NaN NaN c -0.17 0 -7.05 -0.83 -10 0 c -7.02 1.97 -16.75 5.31 -22 9 c -2.47 1.74 -3.67 6.53 -5 10 c -2 5.2 -4.06 10.68 -5 16 c -1.01 5.72 -1.5 12.32 -1 18 c 0.46 5.2 1.7 12.88 4 16 c 1.45 1.97 6.79 2.71 10 3 c 3.7 0.34 9.46 -2.13 12 -1 c 2.29 1.02 4.53 5.9 6 9 c 1.42 2.99 1.46 7.02 3 10 c 3.97 7.7 9.77 20.74 14 23 c 2.53 1.36 10.81 -4.33 14 -8 c 10.92 -12.58 21.3 -31.69 32 -45 c 2.1 -2.61 5.95 -4.56 9 -6 c 2.33 -1.09 7.42 -2.23 8 -2 c 0.35 0.14 -2.56 2.68 -3 4 c -0.44 1.32 -0.77 3.94 0 5 c 2.83 3.91 8.32 9.29 13 13 c 4.8 3.81 10.67 8.6 16 10 c 7.35 1.93 17.44 1.37 26 1 c 6.65 -0.29 14.67 -0.55 20 -3 c 5.8 -2.66 14.06 -9.59 17 -14 c 1.34 -2.01 -0.33 -7.11 -1 -10 c -0.24 -1.04 -2.03 -3.06 -2 -3 c 0.24 0.49 9.05 19.14 14 28 c 1.24 2.21 3.24 4.77 5 6 c 1.15 0.8 3.47 1.12 5 1 c 2.47 -0.19 5.58 -1.12 8 -2 c 1.06 -0.38 1.99 -1.82 3 -2 c 2.24 -0.41 5.67 -0.5 8 0 c 1.96 0.42 3.99 2.53 6 3 c 3.32 0.78 7.72 1.2 11 1 c 1.6 -0.1 3.68 -0.95 5 -2 c 7.8 -6.19 19.08 -15.65 24 -21 c 0.64 -0.69 -1.29 -2.95 -1 -4 c 0.56 -2.06 2.97 -7.32 4 -7 c 1.82 0.56 5.63 7.63 9 11 c 11.75 11.75 36 34 36 34"/>

Signature 3:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="Infinity" height="Infinity">
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M Infinity Infinity l NaN NaN"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 158 4 c -0.07 -0.03 -2.64 -1.59 -4 -2 c -1.85 -0.55 -3.98 -0.93 -6 -1 c -6.96 -0.26 -14.24 -0.8 -21 0 c -6.94 0.83 -14.64 2.49 -21 5 c -5.81 2.29 -12.95 5.72 -17 10 c -6.37 6.75 -13.37 17.16 -17 26 c -3.57 8.7 -6 30 -6 30"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 131 34 l 1 1"/>
     <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 131 34 c 0.1 -0.3 5.08 -15.38 6 -17 c 0.18 -0.32 1.62 1.94 2 3 c 0.88 2.42 1.82 5.31 2 8 c 1.13 16.98 2 52 2 52"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 163 67 l 1 1"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 163 67 l 1 1"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 181 87 l 1 1"/>
    <path stroke-linejoin="round" stroke-linecap="round" stroke-width="2" stroke="rgb(51, 51, 51)" fill="none" d="M 181 87 c 0.02 -0.24 0.16 -9.78 1 -14 c 0.4 -2.01 2.21 -6.33 3 -6 c 1.68 0.7 5.72 7.72 9 11 c 2.96 2.96 6.55 5.34 10 8 c 0.97 0.75 2.24 2.11 3 2 c 1.05 -0.15 3.33 -1.74 4 -3 c 1.98 -3.74 2.75 -9.79 5 -14 c 2.93 -5.5 9.48 -12.19 11 -16 c 0.39 -0.98 -2.07 -3.88 -3 -4 c -1.08 -0.13 -3.86 1.73 -5 3 c -1.58 1.76 -3.2 4.61 -4 7 c -1.1 3.31 -2.35 10.18 -2 11 c 0.2 0.47 3.77 -2.41 5 -4 c 3.21 -4.12 6.64 -9.12 9 -14 c 2.88 -5.93 4.31 -12.8 7 -19 c 1.66 -3.84 4.9 -7.3 6 -11 c 1.41 -4.77 2.16 -15.68 2 -16 c -0.12 -0.25 -2.97 7.89 -4 12 c -1.32 5.29 -1.72 10.57 -3 16 c -2.84 12.05 -5.67 23.2 -9 35 c -1.08 3.82 -3.59 8.15 -4 11 c -0.13 0.88 1.14 2.57 2 3 c 1.98 0.99 5.63 2 8 2 c 1.81 0 4.2 -1.02 6 -2 c 5.36 -2.92 10.71 -6.33 16 -10 c 8.03 -5.56 22.17 -16.22 23 -17 c 0.21 -0.2 -4.8 1.01 -7 2 c -14.07 6.32 -27.49 13.94 -42 20 c -12.24 5.11 -36.35 12.78 -37 13 c -0.13 0.04 4.57 -2.5 7 -3 c 30.85 -6.35 61.94 -12.31 95 -18 c 53.68 -9.23 147.6 -23.88 155 -25 c 0.17 -0.03 -1.91 1.56 -3 2 c -13.28 5.43 -26.72 10.91 -41 16 c -20.52 7.31 -39.4 14.67 -60 20 c -26.25 6.8 -51.72 12.02 -79 16 c -90.08 13.13 -253.87 33.95 -264 34 c -2.78 0.01 42.49 -23.05 65 -33 c 21.11 -9.33 41.92 -18.19 64 -24 c 54.25 -14.28 109.21 -28.72 164 -36 c 44.72 -5.94 130 -7.12 137 -4 c 3.73 1.66 -41.49 27 -63 37 c -15.74 7.32 -33.27 10.84 -51 16 c -17.86 5.2 -52 14 -52 14"/>
</svg>