Coder Social home page Coder Social logo

html2canvas-proxy-nodejs's People

Contributors

niklasvh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

html2canvas-proxy-nodejs's Issues

Proxy setup incorrect?

I set up a node/express project on heroku and made modifications to app.js following the instructions on the front page like so:

var proxy = require('html2canvas-proxy');
var express = require('express');

var app = express();
var port = (process.env.PORT || 3000);

app.use("/", proxy());
app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});
app.listen(port);

I put the url into the 'proxy' property of html2canvas like so. (The actual domain has been changed to protect the proxy.)

proxy: 'https://proxy.domain.com',  
height: $('.react-grid-layout').height(),
width: $('.react-grid-layout').width(),
background: '#FFFFFF',
allowTaint: false

I continue to get this error when trying to export canvases that refer to external image urls:

Image from origin 'https://proxy.domain.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://trays-staging.herokuapp.com' is therefore not allowed access. The response had HTTP status code 503.

https://proxy.domain.com/?url=http%3A%2F%2F7-themes.com%2Fdata_images%2Fuserpics%2Fu_18.gif Failed to load resource: the server responded with a status of 503 (Service Unavailable)

Image from origin 'https://proxy.domain.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://trays-staging.herokuapp.com' is therefore not allowed access. The response had HTTP status code 503.

https://proxy.domain.com/?url=http%3A%2F%2F7-themes.com%2Fdata_images%2Fout%2F41%2F6909460-colorful-spirals.jpg Failed to load resource: the server responded with a status of 503 (Service Unavailable)

canvas.toDataURL("image/png", 1.0) not working in IE11

canvas.todataurl displaying blank image in IE but working in Chrome and Firefox

<script> $('#h2c').click(function () { html2canvas(document.querySelector("#plotly_div")).then(function (canvas) { var imgageData = canvas.toDataURL("image/png", 1.0); document.getElementById("jpg-export").src = imgageData; }); }); </script>

No url specified" error

No url specified" error , i faced this error and I'm sure that my implementation is so street

Anyone have an idea how to use this with firebase functions?

We could run this, but I'm not sure we should be using the request and response object or not? Thanks for any pointers!

exports.helloWorld = functions.https.onRequest((request, response) => {
    // response.send("Hello from Firebase!");
    app.use('/', proxy());
});

Compatibility with 0.5.0-beta3?

Hi, I'm using 0.5.0-beta3 for SVG support. I was previously using the PHP proxy but switched to this node implementation and it appears that rather than html2canvas extracting the base64-encoded image from the response it's expecting a URL to the cached image.

Is this proxy implementation compatible with 0.5.0-beta3 and if so how do I configure html2canvas to work with it?

getting "No url specified" error

I am using the proxy like that in the code. In local setting, it works fine but when I deploy to prod, this error gets thrown. Does anyone know why this is happening or know what the error means?

Another thing I want to mention is that then that line is moved to the very bottom, no error gets thrown but it doesn't seem to work anymore since images become blank in screenshots.

code
error

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.