aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-04-05 15:00:12 +0100
committerStephen Blott2016-04-05 15:00:12 +0100
commit00446479a02bacebec7c63ae2dd7b551e8b0130e (patch)
tree81428895bfb01bab57a6aa94ddc0a058d08d5454 /background_scripts
parentadce73cb68f7ca3e3e01ca6fbb08a1008c9c8b90 (diff)
downloadvimium-00446479a02bacebec7c63ae2dd7b551e8b0130e.tar.bz2
Unregister frame when postMessage fails.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index addbf514..62e32539 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -357,7 +357,11 @@ HintCoordinator =
sendMessage: (messageType, tabId, request = {}) ->
extend request, {handler: "linkHintsMessage", messageType}
- port.postMessage request for own _, port of @tabState[tabId].ports
+ for own frameId, port of @tabState[tabId].ports
+ try
+ port.postMessage request
+ catch
+ @unregisterFrame tabId, frameId
prepareToActivateMode: (tabId, originatingFrameId, {modeIndex}) ->
@tabState[tabId] = {frameIds: frameIdsForTab[tabId][..], hintDescriptors: [], originatingFrameId, modeIndex}