Google Chrome crashes in event handler of 'undefined'

847 views
Skip to first unread message

Angelica Perduta

unread,
Jul 20, 2013, 9:46:25 PM7/20/13
to chromium-...@chromium.org
Error in event handler for 'undefined': Cannot call method 'disconnect' of null TypeError: Cannot call method 'disconnect' of null at <error: illegal access> at Event.dispatchToListener (event_bindings:356:21) at Event.dispatch_ (event_bindings:342:27) at Event.dispatch (event_bindings:362:17) at Object.chromeHidden.Port.dispatchOnMessage (miscellaneous_bindings:273:22)

It's when I right click my page_action icon and try to inspect it
I don't know where to look ... any suggestions please?

Quintillus Apollon

unread,
Jul 21, 2013, 6:30:10 PM7/21/13
to chromium-...@chromium.org
It means you are trying to add an event listener to a non-existent object in your code. If you are willing to share your code someone can point out the offending line(s). A common mistake (in my experience) is to accidentally type something like "chrome.tab.onCreated.addListener" rather than "chrome.tabs.onCreated.addListener"

Angelica Perduta

unread,
Jul 21, 2013, 9:00:18 PM7/21/13
to chromium-...@chromium.org
On Monday, 22 July 2013 10:30:10 UTC+12, Quintillus Apollon wrote:
> It means you are trying to add an event listener to a non-existent object in your code.


There are only two places where I do that:

- One is in the injected content java script, so that my extension can ask it to do stuff.
chrome.runtime.onMessage.addListener(
  function(Msg, Sender, sendResponse) {
    ....
  });

- The other is in the background of my extension where all I want to do is

chrome.pageAction.show(Sender.tab.id);

the moment my injected script loads. I would much prefer to get the injected script to show the pageAction directly, but that doesn't seem to work.


On Monday, 22 July 2013 10:30:10 UTC+12, Quintillus Apollon wrote:
>    If you are willing to share your code someone can point out the offending line(s). A common mistake (in my experience) is to accidentally type something like "chrome.tab.onCreated.addListener" rather than "chrome.tabs.onCreated.addListener"

I am happy to share my code.
It is an extension to deal with malevolent "flag for spam" on youtube comments.
Embarrassingly messy still, because this is my first ever browser extension (and I'm  learning javascript as I go). However most of it works so if anyone does want to have a look I put in a .zip file here:
http://piedpiper.site40.net/MyImages.php/ChromeForum/YtFlagChrome.zip

Quintillus Apollon

unread,
Jul 22, 2013, 11:40:18 AM7/22/13
to chromium-...@chromium.org
Your code seems to be working. I could not reproduce the issue you had in your first post. You seem to be adding listeners to valid objects too. What exactly did you do to get the error above?

Angelica Perduta

unread,
Jul 27, 2013, 6:02:28 PM7/27/13
to chromium-...@chromium.org


On Tuesday, 23 July 2013 03:40:18 UTC+12, Quintillus Apollon wrote:
Your code seems to be working. I could not reproduce the issue you had in your first post. You seem to be adding listeners to valid objects too. What exactly did you do to get the error above?

It was whenever I right clicked om the page action icon... but you are right. It is not happening anymore and I have no idea why.

Jonathan Dumaine

unread,
Jan 6, 2014, 10:47:46 PM1/6/14
to chromium-...@chromium.org
I get this error as well. What's annoying is that it is infrequent and inside internal chrome extension code.

My extension is complicated with lots of messaging between pages and all the iframes in the page, but it does not throw errors itself and I'm completely positive it follow's the extension documentation to a tee.

Been getting this error on and off since around Chrome 24 on OS X (don't use windows for development so not sure if that's a factor).
Reply all
Reply to author
Forward
0 new messages