From 8c437b7cdc898db0f3c1c7c397205b724af59acf Mon Sep 17 00:00:00 2001 From: Will Bamberg Date: Thu, 17 Dec 2015 23:36:36 -0800 Subject: [PATCH] renamed a function --- chill-out/background.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/chill-out/background.js b/chill-out/background.js index 4920409..1cc8614 100644 --- a/chill-out/background.js +++ b/chill-out/background.js @@ -2,14 +2,14 @@ var DELAY = 0.1; var CATGIFS = "http://chilloutandwatchsomecatgifs.com/"; /* -Start-stop for the currently active tab, whenever this script is run. +Restart alarm for the currently active tab, whenever this script is run. */ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { - startStopAlarm(tabs[0].id); + restartAlarm(tabs[0].id); }); /* -Start-stop for the currently active tab, whenever the user navigates. +Restart alarm for the currently active tab, whenever the user navigates. */ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) { if (!changeInfo.url) { @@ -17,23 +17,23 @@ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) { } chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { if (tabId == tabs[0].id) { - startStopAlarm(tabId); + restartAlarm(tabId); } }); }); /* -Start-stop for the currently active tab, whenever a new tab becomes active. +Restart alarm for the currently active tab, whenever a new tab becomes active. */ chrome.tabs.onActivated.addListener(function (activeInfo) { - startStopAlarm(activeInfo.tabId); + restartAlarm(activeInfo.tabId); }); /* -Start-stop: clear all alarms, +restartAlarm: clear all alarms, then set a new alarm for the given tab. */ -function startStopAlarm(tabId) { +function restartAlarm(tabId) { chrome.pageAction.hide(tabId); chrome.alarms.clearAll(); chrome.tabs.get(tabId, function(tab) {