From f438b3528f0b0718f4122fe5bf0ef50e0e405bae Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sat, 25 Oct 2014 22:04:32 +0100 Subject: Check chrome.runtime.lastError to fix error in chrome.runtime.lastError --- background_scripts/main.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 352cfa48..16d7bc19 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -391,6 +391,7 @@ chrome.tabs.onUpdated.addListener (tabId, changeInfo, tab) -> allFrames: true code: Settings.get("userDefinedLinkHintCss") runAt: "document_start" + , -> undefined if chrome.runtime.lastError updateOpenTabs(tab) updateActiveState(tabId) -- cgit v1.2.3 From 046650ba22ac12ebb18d1eb109fe694016eb77c0 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 26 Oct 2014 06:39:47 +0000 Subject: Refactor CSS injection. --- background_scripts/main.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 43052247..e611bf75 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -387,13 +387,14 @@ updateScrollPosition = (tab, scrollX, scrollY) -> chrome.tabs.onUpdated.addListener (tabId, changeInfo, tab) -> return unless changeInfo.status == "loading" # only do this once per URL change - chrome.tabs.insertCSS tabId, + cssConf = allFrames: true code: Settings.get("userDefinedLinkHintCss") runAt: "document_start" - , -> undefined if chrome.runtime.lastError - updateOpenTabs(tab) - updateActiveState(tabId) + chrome.tabs.insertCSS tabId, cssConf, -> + if not chrome.runtime.lastError + updateOpenTabs(tab) + updateActiveState(tabId) chrome.tabs.onAttached.addListener (tabId, attachedInfo) -> # We should update all the tabs in the old window and the new window. -- cgit v1.2.3