Last active
October 2, 2018 11:05
-
-
Save 3rdp/54e7778bac615bee15a6edf4e6cccdf5 to your computer and use it in GitHub Desktop.
Embed: Error in console from 'embed.js' file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I work on a project for a blog web-site and I'm trying to resolve the issue I constantly get on an article page. | |
On an article page, we have a subscribe form. When user posts a request to subscribe to our blog, the error from Disqus embed file pops up in user's browser console: "TypeError: c is null" in Firefox, or "TypeError: Cannot read property 'sender' of null" in Chrome. | |
I tried to debug the issue and I stumbled upon a global (window.addEv...) 'message' event handler which parses 'data' property of its first parameter as JSON. But! This 'data' parsing is via JSON.parse and JSON.parse(null) throws no error and just returns null, meaning that though Disqus developers embedded the parsing procedure in try-catch statement, the code execution continues until on the next line you try to access property 'sender' of a null. | |
Can you please resolve the issue? | |
EDIT: | |
Another way to reproduce this error is to open the page where the Disqus comments are on, in my case it is the article page, and paste this code into browser console "window.postMessage(null, '*')" and then Press Enter to execute. You'll see that the browser returns an error. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment