{"action":"created","issue":{"url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/89","labels_url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/89/comments","events_url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/89/events","html_url":"https://github.com/webcomponents/webcomponentsjs/issues/89","id":51161296,"number":89,"title":"webcomponentsjs is not compatible with third-party scripts that use window.getComputedStyle","user":{"login":"robdodson","id":1066253,"avatar_url":"https://avatars.githubusercontent.com/u/1066253?v=3","gravatar_id":"","url":"https://api.github.com/users/robdodson","html_url":"https://github.com/robdodson","followers_url":"https://api.github.com/users/robdodson/followers","following_url":"https://api.github.com/users/robdodson/following{/other_user}","gists_url":"https://api.github.com/users/robdodson/gists{/gist_id}","starred_url":"https://api.github.com/users/robdodson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robdodson/subscriptions","organizations_url":"https://api.github.com/users/robdodson/orgs","repos_url":"https://api.github.com/users/robdodson/repos","events_url":"https://api.github.com/users/robdodson/events{/privacy}","received_events_url":"https://api.github.com/users/robdodson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-12-06T00:06:19Z","updated_at":"2015-02-20T20:30:04Z","closed_at":"2014-12-08T17:57:30Z","body":"*Migrating @keanulee's original ticket from platform-dev repo:*\r\n\r\nI was trying to include Disqus on my blog that uses platform.js (https://blog.keanulee.com/2014/10/11/setting-up-ssl-on-github-pages.html), but the Disqus script would not work when platform.js was imported. On Chrome it works, but on browsers where window.getComputedStyle is shimmed (Safari, Firefox), the Disqus script would throw an error.\r\n\r\nSafari: TypeError: null is not an object (evaluating 't.defaultView.getComputedStyle(b,null).getPropertyValue') (getComputedStyle returns null when arg is not an element)\r\nFirefox: TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element.\r\n\r\nI confirmed that removing platform.js fixes the Disqus script.\r\n\r\n---\r\n\r\nThis error was caused by something in the Disqus code, but platform.js might be partly responsible. Below is a summarized version of the offending code:\r\n\r\n```\r\ngetScrollContainer: function() {\r\n  var elem = document.querySelector('#disqus_thread'); // some <div>\r\n  do {\r\n  var overflowY = getComputedStyle(div).getPropertyValue('overflow-y');\r\n  if (\"scroll\" === overflowY || \"auto\" === overflowY) break;\r\n  elem = elem.parentNode;\r\n} while (elem && elem !== document.documentElement);\r\n```\r\n\r\nRecall that elem is a wrapped element, so when elem is the wrapped element (as it moves up the tree), it will not pass the elem !== document.documentElement"},"comment":{"url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/comments/75313738","html_url":"https://github.com/webcomponents/webcomponentsjs/issues/89#issuecomment-75313738","issue_url":"https://api.github.com/repos/webcomponents/webcomponentsjs/issues/89","id":75313738,"user":{"login":"Mikanoshi","id":5113439,"avatar_url":"https://avatars.githubusercontent.com/u/5113439?v=3","gravatar_id":"","url":"https://api.github.com/users/Mikanoshi","html_url":"https://github.com/Mikanoshi","followers_url":"https://api.github.com/users/Mikanoshi/followers","following_url":"https://api.github.com/users/Mikanoshi/following{/other_user}","gists_url":"https://api.github.com/users/Mikanoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/Mikanoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mikanoshi/subscriptions","organizations_url":"https://api.github.com/users/Mikanoshi/orgs","repos_url":"https://api.github.com/users/Mikanoshi/repos","events_url":"https://api.github.com/users/Mikanoshi/events{/privacy}","received_events_url":"https://api.github.com/users/Mikanoshi/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T20:30:04Z","updated_at":"2015-02-20T20:30:04Z","body":"Download the code and wrap it :)\r\nhttps://www.gstatic.com/recaptcha/api2/r20150202092117/recaptcha__en.js\r\nBut for me it's working in FF without errors..."}}