From cf1667a1f4d81f68f34a8cc4e8a6c7916a38a961 Mon Sep 17 00:00:00 2001 From: Chan Chak Shing Date: Sun, 30 Dec 2018 11:39:39 +0800 Subject: [PATCH] Reload current tab when enabling EASE mode, fix #16870 --- chromium/pages/popup/ux.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/chromium/pages/popup/ux.js b/chromium/pages/popup/ux.js index 041fbb051a76..71d6f01e0cb7 100644 --- a/chromium/pages/popup/ux.js +++ b/chromium/pages/popup/ux.js @@ -312,8 +312,15 @@ function enableOnSite() { } function toggleHttpNowhere() { - getOption_('httpNowhere', false, function(item) { - setOption_('httpNowhere', !item.httpNowhere); + getTab(tab => { + getOption_('httpNowhere', false, item => { + const enabled = !item.httpNowhere; + setOption_('httpNowhere', enabled, () => { + if (enabled) { + chrome.tabs.reload(tab.id); + } + }); + }); }); }