diff options
| author | Stephen Blott | 2017-12-02 13:49:58 +0000 |
|---|---|---|
| committer | Stephen Blott | 2017-12-02 14:15:30 +0000 |
| commit | e9fba3a6c1aa2979a4045f61c3d03ad9cefd9a4b (patch) | |
| tree | ce8b209adaf925095faa9bd9ae442ad8289da3fa /pages | |
| parent | 23f66cd05183942dace41e0af61ca2908600f1d0 (diff) | |
| download | vimium-e9fba3a6c1aa2979a4045f61c3d03ad9cefd9a4b.tar.bz2 | |
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).
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/options.coffee | 24 |
1 files 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 = """ + <div style="width: 400px; margin: 5px;"> + <p style="margin-bottom: 5px;"> + Vimium is not running on this page. + </p> + <p style="margin-bottom: 5px;"> + Your browser does not run web extensions like Vimium on certain pages, + usually for security reasons. + </p> + <p> + 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. + </p> + </div> + """ + return updateState = -> rule = bgExclusions.getRule url, exclusions.readValueFromElement() |
