Snap.svg icon indicating copy to clipboard operation
Snap.svg copied to clipboard

Not executable in Chrome App

Open Cloud-Automation opened this issue 10 years ago • 1 comments

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

Cloud-Automation avatar Aug 25 '14 12:08 Cloud-Automation

Possible solution here: https://github.com/adobe-webplatform/Snap.svg/issues/475#issuecomment-1948547780

mmacaula avatar Feb 16 '24 15:02 mmacaula