From f6a326577d87c48cea8908e4f14fc18e434c26b4 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 15 May 2015 12:09:50 -0700 Subject: [PATCH] Crash fixes for chromium My current version of chromium inexplicably exposes a crippled version of chrome.browserAction even though we are now a packaged app and should not have that functionality exposed to us anymore. This results in some errors to the tune of "property 'foo' of undefined". It also doesn't support the innerBounds property for window creation, only the older (deprecated) bounds property. --- js/chromium.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/chromium.js b/js/chromium.js index a7885336d..f84e519ec 100644 --- a/js/chromium.js +++ b/js/chromium.js @@ -32,7 +32,7 @@ self.tabs = tabs; self.setBadgeText = function (text) { - if (chrome.browserAction) { + if (chrome.browserAction && chrome.browserAction.setBadgeText) { chrome.browserAction.setBadgeText({text: String(text)}); } }; @@ -146,7 +146,7 @@ }; extension.onLaunched = function(callback) { - if (chrome.browserAction) { + if (chrome.browserAction && chrome.browserAction.onClicked) { chrome.browserAction.onClicked.addListener(callback); } if (chrome.app && chrome.app.runtime) { @@ -176,7 +176,7 @@ extension.windows.open({ id: id, url: url, - innerBounds: { width: 800, height: 666 } + bounds: { width: 800, height: 666 } }); };