From 22ed091bc680e0b358f64d303913a93120f699c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Thu, 25 Jan 2018 22:37:02 +0100 Subject: [PATCH] Maybe it already works under android. :P --- clearurls.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/clearurls.js b/clearurls.js index 8e2eb7e..2471cfd 100644 --- a/clearurls.js +++ b/clearurls.js @@ -17,7 +17,14 @@ var globalurlcounter; var siteBlockedAlert = 'javascript:void(0)'; var dataHash; var localDataHash; +var os; +/** + * Save OS Version + */ +browser.runtime.getPlatformInfo(function(info) { + os = info.os; +}); /** * Initialize the JSON provider object keys. @@ -632,7 +639,11 @@ function getLoggingStatus() /** * Call by each windows is closed or created. */ -browser.windows.onRemoved.addListener(saveLog); +if(!checkOSAndroid()) +{ + console.log("ClearURLs: Log listener is added.") + browser.windows.onRemoved.addListener(saveLog); +} browser.tabs.onCreated.addListener(saveLog); /** @@ -666,6 +677,21 @@ function setBadgedStatus() { }); } +/** + * Check if it is an android device. + * @return bool + */ + function checkOSAndroid() + { + if(os == "android") + { + return true; + } + else{ + return false; + } + } + /** * Call loadOldDataFromStore, getHash, counter, status and log functions */