From 74aeb1feec9ee978542888ba7728412b5be887e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Wed, 31 Jan 2018 20:34:14 +0100 Subject: [PATCH] Fix #31 --- clearurls.js | 56 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/clearurls.js b/clearurls.js index 6a5f141..bb59d23 100644 --- a/clearurls.js +++ b/clearurls.js @@ -380,12 +380,15 @@ browser.runtime.getPlatformInfo(function(info) { } browser.storage.local.set({"globalCounter": ++globalCounter}); - if(badgedStatus) { - browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid}); - } - else + if(!checkOSAndroid()) { - browser.browserAction.setBadgeText({text: "", tabId: tabid}); + if(badgedStatus) { + browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid}); + } + else + { + browser.browserAction.setBadgeText({text: "", tabId: tabid}); + } } changes = true; @@ -400,12 +403,15 @@ browser.runtime.getPlatformInfo(function(info) { } browser.storage.local.set({"globalCounter": ++globalCounter}); - if(badgedStatus) { - browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid}); - } - else + if(!checkOSAndroid()) { - browser.browserAction.setBadgeText({text: "", tabId: tabid}); + if(badgedStatus) { + browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid}); + } + else + { + browser.browserAction.setBadgeText({text: "", tabId: tabid}); + } } cancel = true; @@ -661,20 +667,22 @@ browser.runtime.getPlatformInfo(function(info) { * */ function setBadgedStatus() { - browser.storage.local.get('badgedStatus', function(data) { - if(data.badgedStatus) { - badgedStatus = data.badgedStatus; - browser.browserAction.setBadgeBackgroundColor({ - 'color': 'orange' - }); - } - else if(data.badgedStatus === null || typeof(data.badgedStatus) == "undefined"){ - badgedStatus = false; - } - else { - badgedStatus = false; - } - }); + if(!checkOSAndroid()){ + browser.storage.local.get('badgedStatus', function(data) { + if(data.badgedStatus) { + badgedStatus = data.badgedStatus; + browser.browserAction.setBadgeBackgroundColor({ + 'color': 'orange' + }); + } + else if(data.badgedStatus === null || typeof(data.badgedStatus) == "undefined"){ + badgedStatus = false; + } + else { + badgedStatus = false; + } + }); + } } /**