{"action":"opened","issue":{"url":"https://api.github.com/repos/niklasvh/html2canvas/issues/577","labels_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/577/comments","events_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/577/events","html_url":"https://github.com/niklasvh/html2canvas/issues/577","id":70509770,"number":577,"title":"window.html2canvas","user":{"login":"mattdell","id":2536442,"avatar_url":"https://avatars.githubusercontent.com/u/2536442?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdell","html_url":"https://github.com/mattdell","followers_url":"https://api.github.com/users/mattdell/followers","following_url":"https://api.github.com/users/mattdell/following{/other_user}","gists_url":"https://api.github.com/users/mattdell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdell/subscriptions","organizations_url":"https://api.github.com/users/mattdell/orgs","repos_url":"https://api.github.com/users/mattdell/repos","events_url":"https://api.github.com/users/mattdell/events{/privacy}","received_events_url":"https://api.github.com/users/mattdell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T20:48:46Z","updated_at":"2015-04-23T20:48:46Z","closed_at":null,"body":"I was prototyping with 5.0-alpha1 a few months ago and we got the all clear to put it into production so today I've added html2canvas back into our node packages list. Using my exact same code as previously, I am getting loads of errors about window.html2canvas being undefined.\r\n\r\nThe easiest way I found to trigger this is by trying to turn on logging.\r\n```javascript\r\nvar Html2Canvas = require('html2canvas');\r\n\r\nvar ScreenshotUtils = {\r\n\r\n\ttakeScreenshot: function() {\r\n\r\n\t\tHtml2Canvas(document.body, {\r\n\t\t\tonrendered: function(canvas) {\r\n\t\t\t\t// Do something\r\n\t\t\t},\r\n\t\t\tlogging: true\r\n\t\t});\r\n\t},\r\n};\r\n\r\nmodule.exports = ScreenshotUtils;\r\n```\r\n\r\nWhen I execute ScreenshotUtils.takeScreenshot() I get the following error:\r\n```javascript\r\nUncaught TypeError: Cannot set property 'logging' of undefined\r\n```\r\n\r\nWhich gets thrown on this line of the html2canvas source code:\r\n```javascript\r\nfunction html2canvas(nodeList, options) {\r\n    var index = html2canvasCloneIndex++;\r\n    options = options || {};\r\n    if (options.logging) {\r\n        window.html2canvas.logging = true; // <--- Error here!\r\n        window.html2canvas.start = Date.now();\r\n    }\r\n    ...\r\n```\r\n\r\nIs it just me? Does html2canvas really need to exist on window?\r\n\r\nAny feedback would be greatly appreciated!"}}