Snap.svg
Snap.svg copied to clipboard
Not executable in Chrome App
Snap is not executable in Chrome Apps due to the function call
return Function("val", "return Snap.path.toString.call([" + b + "])");
in the equal.js file. Evaluating Javascript as a string is not valid in packaged chrome apps.
How can I change that?
function getPath(path) {
var k = 0, i, ii, j, jj, out, a, b = [];
for (i = 0, ii = path.length; i < ii; i++) {
out = "[";
a = ['"' + path[i][0] + '"'];
for (j = 1, jj = path[i].length; j < jj; j++) {
a[j] = "val[" + (k++) + "]";
}
out += a + "]";
b[i] = out;
}
return Function("val", "return Snap.path.toString.call([" + b + "])");
}
Thanks Stefan
Possible solution here: https://github.com/adobe-webplatform/Snap.svg/issues/475#issuecomment-1948547780