Polymer and Disqus on Firefox: Argument 1 of Window.getComputedStyle does not implement interface Element

Yuriy Yunikov

I'm currently building a website using Polymer framework and Jekyll. I've added the Disqus block in the bottom of the page and it works perfectly in Chrome browser.

{% if site.disqus %}
<div class="comments">
    <div id="disqus_thread"></div>
    <script type="text/javascript">

        var disqus_shortname = '{{ site.disqus }}';
        var disqus_identifier = "{{ page.url }}";

        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
{% endif %}

But when I open it on Firefox 35.0.1 I receive the following message in console:

TypeError: Argument 1 of Window.getComputedStyle does not implement interface Element.

and Disqus comments don't load. I've found the same behavior for Disqus comments on Polymer docs website, so you can check it out. Any ideas how it can be fixed? Or this is a bug?

Fravic

I was running into this exact issue, and came across this thread:

https://github.com/webcomponents/webcomponentsjs/issues/89

Mikanoshi provides a helpful gist at the end of the thread that illustrates a fix:

var disqus_shortname = ''; /* Your shortname */
var DISQUS = ...           /* From the start of DISQUS' embed.js */

(function(document) {
    DISQUS.define(...      /* The rest of DISQUS' embed.js */
})(wrap(document));

Unfortunate that we have to modify DISQUS' embed.js, but it seems to work!

An explanation of why this is necessary is here: http://webcomponents.org/polyfills/shadow-dom/ (under wrap and unwrap).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Window.getComputedStyle does not implement interface Element error in Firefox

From Dev

TypeError: Argument 1 of Window.getDefaultComputedStyle does not implement interface Element

From Dev

TypeError: Argument 1 of Window.getDefaultComputedStyle does not implement interface Element

From Dev

TypeError: Argument 1 of Node.appendChild does not implement interface Node

From Dev

Argument 1 of Node.appendChild does not implement interface Node

From Dev

Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'

From Dev

Argument 1 of CanvasRenderingContext2D.putImageData does not implement interface ImageData

From Dev

MutationObserver - getting "TypeError: MutationObserver.observe: Argument 1 does not implement interface Node."

From Dev

Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' - Angular / Ionic kendo-chart

From Dev

Polymer element not showing in firefox

From Dev

How to make a disqus comments javascript code to work in a polymer custom element

From Dev

Error 1: does not implement interface member

From Dev

Polymer - fail in implement a simple element

From Dev

Polymer implement native select element

From Dev

Javascript - window.getComputedStyle returns "auto" as element top and left properties

From Dev

getComputedStyle() and cssText in IE and Firefox

From Dev

Firefox getComputedStyle returns "auto"

From Dev

Catchable Fatal Error: Argument 1 passed to "...\FormType::__construct() must implement interface

From Dev

Symfony2: ContextErrorException: Catchable Fatal Error: Argument 1 passed to [...]::__construct() must implement interface [...] none given

From Java

Dropbox Upload Javascript : TypeError: "'fetch' called on an object that does not implement interface Window."

From Dev

my Polymer website does not work on firefox

From Dev

Polymer core-icons does not render in FireFox

From Dev

Specify that a Class argument must implement a particular interface

From Dev

Does not implement interface member issues

From Dev

Error: Does not implement interface member

From Dev

Error: Does not implement interface member

From Dev

Class does not implement interface member

From Dev

IEnumerator does not implement interface IEnumerable

From Dev

Does not implement interface member MVC

Related Related

  1. 1

    Window.getComputedStyle does not implement interface Element error in Firefox

  2. 2

    TypeError: Argument 1 of Window.getDefaultComputedStyle does not implement interface Element

  3. 3

    TypeError: Argument 1 of Window.getDefaultComputedStyle does not implement interface Element

  4. 4

    TypeError: Argument 1 of Node.appendChild does not implement interface Node

  5. 5

    Argument 1 of Node.appendChild does not implement interface Node

  6. 6

    Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'

  7. 7

    Argument 1 of CanvasRenderingContext2D.putImageData does not implement interface ImageData

  8. 8

    MutationObserver - getting "TypeError: MutationObserver.observe: Argument 1 does not implement interface Node."

  9. 9

    Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' - Angular / Ionic kendo-chart

  10. 10

    Polymer element not showing in firefox

  11. 11

    How to make a disqus comments javascript code to work in a polymer custom element

  12. 12

    Error 1: does not implement interface member

  13. 13

    Polymer - fail in implement a simple element

  14. 14

    Polymer implement native select element

  15. 15

    Javascript - window.getComputedStyle returns "auto" as element top and left properties

  16. 16

    getComputedStyle() and cssText in IE and Firefox

  17. 17

    Firefox getComputedStyle returns "auto"

  18. 18

    Catchable Fatal Error: Argument 1 passed to "...\FormType::__construct() must implement interface

  19. 19

    Symfony2: ContextErrorException: Catchable Fatal Error: Argument 1 passed to [...]::__construct() must implement interface [...] none given

  20. 20

    Dropbox Upload Javascript : TypeError: "'fetch' called on an object that does not implement interface Window."

  21. 21

    my Polymer website does not work on firefox

  22. 22

    Polymer core-icons does not render in FireFox

  23. 23

    Specify that a Class argument must implement a particular interface

  24. 24

    Does not implement interface member issues

  25. 25

    Error: Does not implement interface member

  26. 26

    Error: Does not implement interface member

  27. 27

    Class does not implement interface member

  28. 28

    IEnumerator does not implement interface IEnumerable

  29. 29

    Does not implement interface member MVC

HotTag

Archive