diff options
| author | Stephen Blott | 2016-04-18 11:50:39 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-18 11:50:39 +0100 |
| commit | dd07ffaa15efc6dff138cdaf89a146f229cc5b9d (patch) | |
| tree | 753151d0df34baab5849cea5c3472aba0eaf2754 /background_scripts | |
| parent | 0a49cc45732175c65651b5f054c677d6c42a28c0 (diff) | |
| download | vimium-dd07ffaa15efc6dff138cdaf89a146f229cc5b9d.tar.bz2 | |
Revert "Cache content_scripts/vimium.css in chrome.storage.local."
This reverts commit 0a49cc45732175c65651b5f054c677d6c42a28c0.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index ab1c8610..4aa2fc41 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -129,15 +129,14 @@ helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommand html.push "<td class='vimiumReset' colspan='3' style='text-align: left;'>", Utils.escapeHtml(bindings) html.push("</td></tr>") -# Cache "content_scripts/vimium.css" in chrome.storage.local for UI components. -do -> - # Bail if we don't have these (specifically, we don't have them in the tests). - return unless XMLHttpRequest? and chrome.runtime.getURL? and chrome.storage.local.set? +# +# Fetches the contents of a file bundled with this extension. +# +fetchFileContents = (extensionFileName) -> req = new XMLHttpRequest() - req.open "GET", chrome.runtime.getURL("content_scripts/vimium.css"), true # true -> asynchronous. - req.onload = ({status, responseText}) -> - chrome.storage.local.set vimiumCSSInChromeStorage: responseText if status == 200 + req.open("GET", chrome.runtime.getURL(extensionFileName), false) # false => synchronous req.send() + req.responseText TabOperations = # Opens the url in the current tab. @@ -418,6 +417,7 @@ sendRequestHandlers = gotoMark: Marks.goto.bind(Marks) # Send a message to all frames in the current tab. sendMessageToFrames: (request, sender) -> chrome.tabs.sendMessage sender.tab.id, request.message + fetchFileContents: (request, sender) -> fetchFileContents request.fileName # For debugging only. This allows content scripts to log messages to the extension's logging page. log: ({frameId, message}, sender) -> BgUtils.log "#{frameId} #{message}", sender |
