-1

Adding an onMessage-listener prevents my onInstalled-listener from triggering. Why?

This is my code:


manifest.json

{
  "name": "BUGTESTER",
  "description": "Hmmmmm...",
  "version": "0.1",

  "background": {
    "persistent": false,
    "scripts": ["background.js"]
  },

  "manifest_version": 2
}

background.js

chrome.runtime.onInstalled.addListener(function() {
  alert("onInstalled");
});

//Adding this line breaks the onInstalled-thingy
chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {});
Moberg
  • 5,253
  • 4
  • 38
  • 54
  • It that a typo, or did you just not close the `addListener`? And for your information, it is [`chrome.runtime.onMessage`](http://developer.chrome.com/extensions/runtime.html#event-onMessage) now. – BeardFist May 10 '13 at 22:38

1 Answers1

0

No problem, just a typo, was missing a ) and a ;. Isn't there any kind of syntax checking when loading extensions? =S

Moberg
  • 5,253
  • 4
  • 38
  • 54