Index: options.js |
diff --git a/options.js b/options.js |
index d102d14bb83889fbe61a52dde8d621db0f6653ca..955ba7356a2744c9ceabf88aed6deb77f2fadd36 100644 |
--- a/options.js |
+++ b/options.js |
@@ -56,7 +56,12 @@ function wrapper(baseMessage /* , [paramKeys] */) |
message[paramKeys[i]] = arguments[i]; |
} |
- ext.backgroundPage.sendMessage(message, callback); |
+ // Chrome 30 throws an exception when sendMessage is called with a callback |
+ // parameter of undefined, so we work around that here. (See issue 4052) |
+ if (callback) |
+ ext.backgroundPage.sendMessage(message, callback); |
+ else |
+ ext.backgroundPage.sendMessage(message); |
}; |
} |