diff options
| -rw-r--r-- | background_scripts/main.coffee | 4 | ||||
| -rw-r--r-- | content_scripts/link_hints.coffee | 1 | ||||
| -rw-r--r-- | lib/dom_utils.coffee | 15 |
3 files changed, 4 insertions, 16 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index a3857d61..b56d391c 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -318,6 +318,10 @@ 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, + allFrames: true + code: Settings.get("userDefinedLinkHintCss") + runAt: "document_start" updateOpenTabs(tab) updateActiveState(tabId)) diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 55a78036..5c7f6510 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -60,7 +60,6 @@ LinkHints = @setOpenLinkMode(mode) hintMarkers = @markerMatcher.fillInMarkers(@createMarkerFor(el) for el in @getVisibleClickableElements()) - DomUtils.addCssToPage(settings.get("userDefinedLinkHintCss"), "vimiumLinkHintCss") # Note(philc): Append these markers as top level children instead of as child nodes to the link itself, # because some clickable elements cannot contain children, e.g. submit buttons. This has the caveat # that if you scroll the page and the link has position=fixed, the marker will not stay fixed. diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index 501e43a5..a99cb5a6 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -1,20 +1,5 @@ DomUtils = # - # Adds the given CSS to the page. - # - addCssToPage: (css, id) -> - return if document.getElementById(id) - head = document.getElementsByTagName("head")[0] - if (!head) - head = document.createElement("head") - document.documentElement.appendChild(head) - style = document.createElement("style") - style.id = id - style.type = "text/css" - style.appendChild(document.createTextNode(css)) - head.appendChild(style) - - # # Runs :callback if the DOM has loaded, otherwise runs it on load # documentReady: do -> |
