diff --git a/src/popup.js b/src/popup.js index fbbcd1b..f7864a7 100644 --- a/src/popup.js +++ b/src/popup.js @@ -179,7 +179,7 @@ function bgPageReady() { * */ -function pickButton(enabled, message = '') { +function pickButton(tab, enabled, message = '') { let pick_el = document.getElementById('pick') if (enabled) { pick_el.onclick = () => { @@ -211,21 +211,23 @@ function initPickButton(tab) { // special chrome pages if (tab.url === undefined || tab.url.indexOf('chrome') == 0) { pickButton( + tab, false, "Chrome doesn't allow extensions to play with special Chrome pages like this one.
chrome://...
", ) } // chrome gallery else if (tab.url.indexOf('https://chrome.google.com/webstore') == 0) { - pickButton(false, "Chrome doesn't allow its extensions to play on Web Store.") + pickButton(tab, false, "Chrome doesn't allow its extensions to play on Web Store.") } // local pages else if (tab.url.indexOf('file') === 0) { chrome.extension.isAllowedFileSchemeAccess((isAllowedAccess) => { if (isAllowedAccess) { - pickButton(true) + pickButton(tab, true) } else { pickButton( + tab, false, 'Eye Dropper can\'t access local pages unless you grant it the permission. Check the instructions how to allow it.', ) @@ -233,7 +235,7 @@ function initPickButton(tab) { } }) } else { - pickButton(true) + pickButton(tab, true) } }