From e9fba3a6c1aa2979a4045f61c3d03ad9cefd9a4b Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 2 Dec 2017 13:49:58 +0000 Subject: Note disabled in page popup. On pages where the browser does not run extensions like vimium, replace the popup with a note explaining what and why. Fixes #2850. Currently, this is unsatisfactory because, on the Chrome new tab page, Vimium does not become active until the user tabs or clicks into the page (which is weird). --- pages/options.coffee | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pages/options.coffee b/pages/options.coffee index 0d4f5999..5e0b6016 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -277,9 +277,27 @@ 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, or the tab's own - # URL. - url = chrome.extension.getBackgroundPage().urlForTab[tab.id] || tab.url + # As the active URL, we choose the most recently registered URL from a frame in the tab. + url = chrome.extension.getBackgroundPage().urlForTab[tab.id] + + unless url + # The browser has disabled Vimium on this page. Place a message explaining this into the popup. + document.body.innerHTML = """ +
+ Vimium is not running on this page. +
++ Your browser does not run web extensions like Vimium on certain pages, + usually for security reasons. +
++ Unless your browser's developers change their policy, then unfortunately it is not possible to make Vimium (or any other + web extension, for that matter) work on this page. +
+