aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2014-10-26 06:39:47 +0000
committerStephen Blott2014-10-26 06:39:47 +0000
commit046650ba22ac12ebb18d1eb109fe694016eb77c0 (patch)
treea97c9ef0c895426e2f8daa836a59c308aeee2f62 /background_scripts
parent04c71a08cac514e371be215a22855e2ac6f87839 (diff)
downloadvimium-046650ba22ac12ebb18d1eb109fe694016eb77c0.tar.bz2
Refactor CSS injection.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee9
1 files changed, 5 insertions, 4 deletions
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.