From fb00eaa6bd4ee8889d10a9ef9d976fefd3be7879 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sat, 2 Dec 2017 15:02:43 +0000 Subject: Use portsForTab to decide whether Vimium can access a tab or not --- pages/options.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pages/options.coffee') diff --git a/pages/options.coffee b/pages/options.coffee index 5e0b6016..529743f4 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -277,10 +277,11 @@ initPopupPage = -> exclusions = null document.getElementById("optionsLink").setAttribute "href", chrome.runtime.getURL("pages/options.html") - # As the active URL, we choose the most recently registered URL from a frame in the tab. - url = chrome.extension.getBackgroundPage().urlForTab[tab.id] + # As the active URL, we choose the most recently registered URL from a frame in the tab, or the tab's own + # URL. + url = chrome.extension.getBackgroundPage().urlForTab[tab.id] || tab.url - unless url + unless chrome.extension.getBackgroundPage().portsForTab[tab.id] # The browser has disabled Vimium on this page. Place a message explaining this into the popup. document.body.innerHTML = """