{"action":"created","issue":{"url":"https://api.github.com/repos/svgdotjs/svg.js/issues/852","repository_url":"https://api.github.com/repos/svgdotjs/svg.js","labels_url":"https://api.github.com/repos/svgdotjs/svg.js/issues/852/labels{/name}","comments_url":"https://api.github.com/repos/svgdotjs/svg.js/issues/852/comments","events_url":"https://api.github.com/repos/svgdotjs/svg.js/issues/852/events","html_url":"https://github.com/svgdotjs/svg.js/issues/852","id":320255838,"number":852,"title":"CustomEvent has incorrect type in IE11","user":{"login":"clusterberries","id":9727404,"avatar_url":"https://avatars3.githubusercontent.com/u/9727404?v=4","gravatar_id":"","url":"https://api.github.com/users/clusterberries","html_url":"https://github.com/clusterberries","followers_url":"https://api.github.com/users/clusterberries/followers","following_url":"https://api.github.com/users/clusterberries/following{/other_user}","gists_url":"https://api.github.com/users/clusterberries/gists{/gist_id}","starred_url":"https://api.github.com/users/clusterberries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusterberries/subscriptions","organizations_url":"https://api.github.com/users/clusterberries/orgs","repos_url":"https://api.github.com/users/clusterberries/repos","events_url":"https://api.github.com/users/clusterberries/events{/privacy}","received_events_url":"https://api.github.com/users/clusterberries/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-04T12:25:59Z","updated_at":"2018-05-07T12:33:12Z","closed_at":null,"author_association":"NONE","body":"Hi guys!\r\nWhen I added svg.js library to my project, I found some issues with CustomEvent in IE11.\r\nThe root of this problem is in this code\r\n\r\n```\r\n// Add CustomEvent to IE9 and IE10\r\n    if (typeof window.CustomEvent !== 'function') {\r\n        // Code from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent\r\n        var CustomEvent = function(event, options) {\r\n            options = options || { bubbles: false, cancelable: false, detail: undefined }\r\n            var e = document.createEvent('CustomEvent')\r\n            e.initCustomEvent(event, options.bubbles, options.cancelable, options.detail)\r\n            return e\r\n        }\r\n\r\n        CustomEvent.prototype = window.Event.prototype\r\n\r\n        window.CustomEvent = CustomEvent\r\n    }\r\n```\r\n\r\nIE11 supports CustomEvent, but it has type 'object', not 'function'. That's why CustomEvent is rewritten by this code. My problem is the following: code `event instanceof window.CustomEvent` returns true even if `event` is not a CustomEvent.\r\n\r\nPlease change this approach, because it breaks some functionality related to custom events.\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/svgdotjs/svg.js/issues/comments/387050174","html_url":"https://github.com/svgdotjs/svg.js/issues/852#issuecomment-387050174","issue_url":"https://api.github.com/repos/svgdotjs/svg.js/issues/852","id":387050174,"user":{"login":"clusterberries","id":9727404,"avatar_url":"https://avatars3.githubusercontent.com/u/9727404?v=4","gravatar_id":"","url":"https://api.github.com/users/clusterberries","html_url":"https://github.com/clusterberries","followers_url":"https://api.github.com/users/clusterberries/followers","following_url":"https://api.github.com/users/clusterberries/following{/other_user}","gists_url":"https://api.github.com/users/clusterberries/gists{/gist_id}","starred_url":"https://api.github.com/users/clusterberries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusterberries/subscriptions","organizations_url":"https://api.github.com/users/clusterberries/orgs","repos_url":"https://api.github.com/users/clusterberries/repos","events_url":"https://api.github.com/users/clusterberries/events{/privacy}","received_events_url":"https://api.github.com/users/clusterberries/received_events","type":"User","site_admin":false},"created_at":"2018-05-07T12:33:11Z","updated_at":"2018-05-07T12:33:11Z","author_association":"NONE","body":"@saivan I have found a temporary workaround, so it is not critical. Thank you!"}}
{"actor":{"display_login":"clusterberries"}}