4xx / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': #1254

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Setting allowedOrigins: ["*"] in config.js as per defined in documentation 
and version history.
2.Add image in editor from any other domain 
3.

What is the expected output? What do you see instead?
Expected output is, it should generate output but instead of getting output 
getting below error.

Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': 
Tainted canvases may not be exported. (server_opensave line #73)

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)
Chrome, Firefox

In what version of SVG-edit does the problem occur? (Latest trunk, 2.7.1,
etc)
Latest trunk, 2.7,

Please provide any additional information below.
Check attachment

Thank You
Sagar Dhande

Original issue reported on code.google.com by sagarne...@gmail.com on 26 Dec 2014 at 5:26

Attachments:

GoogleCodeExporter commented 9 years ago
Any help is appreciated, in terms of returns i can help SVG-Edit community to 
have new Look and feel as i am web designer with 8 years of experience.

Original comment by sagarne...@gmail.com on 26 Dec 2014 at 7:40

GoogleCodeExporter commented 9 years ago
The allowedOrigins relates to postMessage message passing (e.g., between an 
embedded editor and the actual editor). Your issue appears to be that the fact 
you are hosting on https is not allowing you to grab to http, and that is no 
doubt a browser restriction that can't be overcome short of changing both 
servers (the one hosting SVG Edit and the one hosting the image) to http or to 
https.

Original comment by bret...@gmail.com on 26 Dec 2014 at 8:46

GoogleCodeExporter commented 9 years ago
Hey Thanks Bro for help, 

i am using svg-editor.html, if i am trying to include image which is hosted on 
some server using https issue is same.

check screens for more reference.

Original comment by sagarne...@gmail.com on 26 Dec 2014 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
Screens

Original comment by sagarne...@gmail.com on 26 Dec 2014 at 9:34

Attachments:

GoogleCodeExporter commented 9 years ago
i have reviewed this error more. there error thrown in this function 

canvg(c, data.svg, {renderCallback: function() {
    var datauri = data.quality ? c.toDataURL('image/' + dataURLType, data.quality) : c.toDataURL('image/' + dataURLType);
    exportWindow.location.href = datauri;
    var done = $.pref('export_notice_done');
         if (done !== 'all') {
        var note = uiStrings.notification.saveFromBrowser.replace('%s', type);

        // Check if there's issues
        if (issues.length) {
        var pre = '\n \u2022 ';
        note += ('\n\n' + uiStrings.notification.noteTheseIssues + pre + issues.join(pre));
        }

        // Note that this will also prevent the notice even though new issues may appear later.
        // May want to find a way to deal with that without annoying the user
        $.pref('export_notice_done', 'all');
        exportWindow.alert(note);
    }
}

Specificly on this line 
var datauri = data.quality ? c.toDataURL('image/' + dataURLType, data.quality) 
: c.toDataURL('image/' + dataURLType);

File Name svg-editor.js Line #: 1087

Original comment by sagarne...@gmail.com on 26 Dec 2014 at 10:02