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