aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee39
1 files changed, 23 insertions, 16 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index dda1beae..49417d7a 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -119,7 +119,7 @@ root.addExcludedUrl = (url) ->
continue
# And just keep everything else.
newExcludedUrls.push(spec)
-
+
Settings.set("excludedUrls", newExcludedUrls.join("\n"))
chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT, active: true },
@@ -635,6 +635,12 @@ getCurrFrameIndex = (frames) ->
return i if frames[i].id == focusedFrame
frames.length + 1
+# Send message back to the tab unchanged.
+# Frames in the same tab can use this to communicate securely.
+echo = (request, sender) ->
+ delete request.handler # No need to send this information
+ chrome.tabs.sendMessage(sender.tab.id, request)
+
# Port handler mapping
portHandlers =
keyDown: handleKeyDown,
@@ -642,23 +648,24 @@ portHandlers =
filterCompleter: filterCompleter
sendRequestHandlers =
- getCompletionKeys: getCompletionKeysRequest,
- getCurrentTabUrl: getCurrentTabUrl,
- openUrlInNewTab: openUrlInNewTab,
- openUrlInIncognito: openUrlInIncognito,
- openUrlInCurrentTab: openUrlInCurrentTab,
- openOptionsPageInNewTab: openOptionsPageInNewTab,
- registerFrame: registerFrame,
- frameFocused: handleFrameFocused,
- upgradeNotificationClosed: upgradeNotificationClosed,
- updateScrollPosition: handleUpdateScrollPosition,
- copyToClipboard: copyToClipboard,
- isEnabledForUrl: isEnabledForUrl,
- saveHelpDialogSettings: saveHelpDialogSettings,
- selectSpecificTab: selectSpecificTab,
+ getCompletionKeys: getCompletionKeysRequest
+ getCurrentTabUrl: getCurrentTabUrl
+ openUrlInNewTab: openUrlInNewTab
+ openUrlInIncognito: openUrlInIncognito
+ openUrlInCurrentTab: openUrlInCurrentTab
+ openOptionsPageInNewTab: openOptionsPageInNewTab
+ registerFrame: registerFrame
+ frameFocused: handleFrameFocused
+ upgradeNotificationClosed: upgradeNotificationClosed
+ updateScrollPosition: handleUpdateScrollPosition
+ copyToClipboard: copyToClipboard
+ isEnabledForUrl: isEnabledForUrl
+ saveHelpDialogSettings: saveHelpDialogSettings
+ selectSpecificTab: selectSpecificTab
refreshCompleter: refreshCompleter
- createMark: Marks.create.bind(Marks),
+ createMark: Marks.create.bind(Marks)
gotoMark: Marks.goto.bind(Marks)
+ echo: echo
# Convenience function for development use.
window.runTests = -> open(chrome.runtime.getURL('tests/dom_tests/dom_tests.html'))