diff options
| author | mrmr1993 | 2017-12-02 15:02:43 +0000 |
|---|---|---|
| committer | mrmr1993 | 2017-12-02 15:02:43 +0000 |
| commit | fb00eaa6bd4ee8889d10a9ef9d976fefd3be7879 (patch) | |
| tree | daf9451c8352898f9a960eb8e4ef04ace89fe216 | |
| parent | 43c7390f987fea063e7a97cd8b37c7b61d45f615 (diff) | |
| download | vimium-fb00eaa6bd4ee8889d10a9ef9d976fefd3be7879.tar.bz2 | |
Use portsForTab to decide whether Vimium can access a tab or not
| -rw-r--r-- | background_scripts/main.coffee | 2 | ||||
| -rw-r--r-- | pages/options.coffee | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 53f13b60..e21c1a25 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -20,7 +20,7 @@ chrome.runtime.onInstalled.addListener ({ reason }) -> func tab.id, { file: file, allFrames: contentScripts.all_frames }, checkLastRuntimeError frameIdsForTab = {} -portsForTab = {} +root.portsForTab = {} root.urlForTab = {} # This is exported for use by "marks.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 = """ <div style="width: 400px; margin: 5px;"> |
