From 07410e18a0881b896d695b0291204797aea3dfa0 Mon Sep 17 00:00:00 2001 From: Eric Martindale Date: Wed, 20 Nov 2013 01:08:42 +0000 Subject: [PATCH 1/3] Switch to Grove.io on notification click. Fixes #1. --- chrome-extension/background.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/chrome-extension/background.js b/chrome-extension/background.js index 644eeae..1f96a0c 100644 --- a/chrome-extension/background.js +++ b/chrome-extension/background.js @@ -8,10 +8,17 @@ window.onload = function() { msg.title, msg.body ); - notification.show(); notification.ondisplay = function() { setTimeout(function(){notification.cancel()}, 4000); - } + }; + notification.onclick = function() { + chrome.tabs.query({ url: '*://grove.io/*' }, function(tabs) { + chrome.tabs.update(tabs[0].id, { highlighted: true }, function() { + // tab updated. :) + }); + }); + }; + notification.show(); }); }); }; From 440dace9211d9c80488b84218a48fa364a23b8c2 Mon Sep 17 00:00:00 2001 From: Eric Martindale Date: Wed, 20 Nov 2013 01:18:29 +0000 Subject: [PATCH 2/3] Increment version number. --- chrome-extension/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome-extension/manifest.json b/chrome-extension/manifest.json index e796fbc..5869c92 100755 --- a/chrome-extension/manifest.json +++ b/chrome-extension/manifest.json @@ -1,6 +1,6 @@ { "name": "Grove.io", - "version": "1.1.0", + "version": "1.1.1", "manifest_version": 2, "description": "Add desktop notifications to Grove.io's web client", "homepage_url": "https://grove.io", From 077227d8d8c1c2258bf436948e2bb092038c74b3 Mon Sep 17 00:00:00 2001 From: Eric Martindale Date: Wed, 20 Nov 2013 03:30:16 +0000 Subject: [PATCH 3/3] Be more careful about tab highlight selection. --- chrome-extension/background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome-extension/background.js b/chrome-extension/background.js index 1f96a0c..5d4eee6 100644 --- a/chrome-extension/background.js +++ b/chrome-extension/background.js @@ -12,7 +12,7 @@ window.onload = function() { setTimeout(function(){notification.cancel()}, 4000); }; notification.onclick = function() { - chrome.tabs.query({ url: '*://grove.io/*' }, function(tabs) { + chrome.tabs.query({ url: '*://grove.io/app/*' }, function(tabs) { chrome.tabs.update(tabs[0].id, { highlighted: true }, function() { // tab updated. :) });