GithubHelp home page GithubHelp logo

Comments (3)

5r1m avatar 5r1m commented on June 26, 2024 4

We also tried with setting the crossorigin attribute to "anonymous" for the image being drawn on to canvas but this resulted in the below error even with access origin='*':
[Error] Origin null is not allowed by Access-Control-Allow-Origin.
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.

from cordova-plugin-wkwebview-engine.

rjurado01 avatar rjurado01 commented on June 26, 2024

Same error, I have an image with this src: "file:///var/containers/Bundle/Application/27131FF1-0862-4240-851F-FBDFFDDC47D4/HelloCordova.app/www/49dfd8c7f5effbcd57afcb1c060d6322.png"

When I run this code:

const image = document.getElementById("image");
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.drawImage(image, 0, 0);

canvas.toDataUrl();

I get this error: SecurityError: The operation is insecure.

Using UIWebview this code works.

Update

I have fixed this error migrating to cordova-plugin-ionic-webview plugin. Read this doc

from cordova-plugin-wkwebview-engine.

jcesarmobile avatar jcesarmobile commented on June 26, 2024

This plugin doesn't use custom scheme handlers, so I don't think the issue is caused by it.

from cordova-plugin-wkwebview-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.