diff options
| author | Stephen Blott | 2016-03-06 07:28:41 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2016-03-17 14:26:43 +0000 | 
| commit | e507eb8e3fc1b7f6a9ff7fb0c46760161997912a (patch) | |
| tree | b3a93da13a6c640748247814b979f4ed5b9dedab /background_scripts/main.coffee | |
| parent | f7ac5152ff79d62d923a9830db990d2b4ad0d592 (diff) | |
| download | vimium-e507eb8e3fc1b7f6a9ff7fb0c46760161997912a.tar.bz2 | |
Logging; move logMessage to BgUtils."
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 15 | 
1 files changed, 1 insertions, 14 deletions
| diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 0d82e61c..4c5b0a76 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -72,18 +72,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) ->    # Ensure the sendResponse callback is freed.    return false) -# Log messages to the extension's logging page, but only if that page is open. -logMessage = do -> -  loggingPageUrl = chrome.runtime.getURL "pages/logging.html" -  console.log "Vimium logging URL:\n  #{loggingPageUrl}" if loggingPageUrl? # Do not output URL for tests. -  (message, sender = null) -> -    for viewWindow in chrome.extension.getViews {type: "tab"} -      if viewWindow.location.pathname == "/pages/logging.html" -        # Don't log messages from the logging page itself.  We do this check late because most of the time -        # it's not needed. -        if sender?.url != loggingPageUrl -          viewWindow.document.getElementById("log-text").value += "#{(new Date()).toISOString()}: #{message}\n" -  #  # Used by the content scripts to get their full URL. This is needed for URLs like "view-source:http:# .."  # because window.location doesn't know anything about the Chrome-specific "view-source:". @@ -396,7 +384,7 @@ sendMessageToFrames = (request, sender) ->  # For debugging only. This allows content scripts to log messages to the extension's logging page.  bgLog = (request, sender) -> -  logMessage "#{sender.tab.id}/#{request.frameId} #{request.message}", sender +  BgUtils.log "#{sender.tab.id}/#{request.frameId} #{request.message}", sender  # Port handler mapping  portHandlers = @@ -476,5 +464,4 @@ chrome.runtime.onInstalled.addListener ({reason}) ->      chrome.storage.local.set installDate: new Date().toString()  root.TabOperations = TabOperations -root.logMessage = logMessage  root.Frames = Frames | 
