From d64a340d2e2e1ba80f57c2ab944fb153c80e6f64 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 25 Feb 2015 11:37:33 -0700 Subject: [PATCH] Safari: fix main_frame handling --- platform/safari/vapi-background.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/safari/vapi-background.js b/platform/safari/vapi-background.js index b63cfeca1..d93646ac3 100644 --- a/platform/safari/vapi-background.js +++ b/platform/safari/vapi-background.js @@ -624,14 +624,14 @@ return; } e.stopPropagation && e.stopPropagation(); + if(e.message.type === "main_frame") { + vAPI.tabs.onNavigation({ + url: e.message.url, + frameId: 0, + tabId: vAPI.tabs.getTabId(e.target) + }); + } switch(e.message.type) { - case "main_frame": - vAPI.tabs.onNavigation({ - url: e.message.url, - frameId: 0, - tabId: vAPI.tabs.getTabId(e.target) - }); - // Don't break here; let main_frame go through case "popup": if(e.message.url === 'about:blank') { vAPI.tabs.popupCandidate = vAPI.tabs.getTabId(e.target); @@ -660,7 +660,8 @@ if(blockVerdict && blockVerdict.cancel) { e.message = false; return; - } else { + } + else { e.message = true; return; }