From dbf0ed0956485ccd3c0fb3fb12cf12c007d63394 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sun, 31 May 2015 18:16:01 +0100 Subject: Remove code supporting the former settings port from the frontend --- background_scripts/main.coffee | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 99a5672b..e40b03be 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -217,20 +217,6 @@ selectSpecificTab = (request) -> chrome.windows.update(tab.windowId, { focused: true }) chrome.tabs.update(request.id, { selected: true })) -# -# Used by the content scripts to get settings from the local storage. -# -handleSettings = (request, port) -> - switch request.operation - when "get" # Get a single settings value. - port.postMessage key: request.key, value: Settings.get request.key - when "set" # Set a single settings value. - Settings.set request.key, request.value - when "fetch" # Fetch multiple settings values. - values = request.values - values[key] = Settings.get key for own key of values - port.postMessage { values } - chrome.tabs.onSelectionChanged.addListener (tabId, selectionInfo) -> if (selectionChangedHandlers.length > 0) selectionChangedHandlers.pop().call() @@ -650,7 +636,6 @@ bgLog = (request, sender) -> # Port handler mapping portHandlers = keyDown: handleKeyDown, - settings: handleSettings, completions: handleCompletions sendRequestHandlers = -- cgit v1.2.3 From c62ffa33ad5230b89f44cb8f3268e6a4e48afd52 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 1 Jun 2015 07:04:43 +0100 Subject: Re-work unified settings. This is a minor re-working of #1705 from @mrmr1993. The main changes are: - Simplify initialisation logic. - Always initialise Settings immediately and automatically (ie. don't initialise Settings separately and manually in the background, content scripts, options and tests). - Get rid of addEventListener (it's only being used for on "load"). - Add Settings.use() in its place. --- background_scripts/main.coffee | 2 -- 1 file changed, 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index e40b03be..980f8e18 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -728,6 +728,4 @@ chrome.windows.getAll { populate: true }, (windows) -> (response) -> updateScrollPosition(tab, response.scrollX, response.scrollY) if response? chrome.tabs.sendMessage(tab.id, { name: "getScrollPosition" }, createScrollPositionHandler()) -# Start pulling changes from synchronized storage. -Settings.init() showUpgradeMessage() -- cgit v1.2.3