+ Bugfix for Android devices
This commit is contained in:
Kevin Röbert 2019-03-18 17:39:47 +01:00
parent 1175d0ff9d
commit d87d88250d
3 changed files with 33 additions and 29 deletions

View File

@ -33,14 +33,12 @@ var lastVisited = "";
function start() function start()
{ {
changeIcon();
/** /**
* Save OS Version * Save OS Version
*/ */
browser.runtime.getPlatformInfo(function(info) { browser.runtime.getPlatformInfo(function(info) {
os = info.os; os = info.os;
changeIcon();
/** /**

View File

@ -1,24 +1,24 @@
/* /*
* ClearURLs * ClearURLs
* Copyright (c) 2017-2019 Kevin Röbert * Copyright (c) 2017-2019 Kevin Röbert
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*jshint esversion: 6 */ /*jshint esversion: 6 */
/* /*
* This script is responsible for some tools. * This script is responsible for some tools.
*/ */
/** /**
@ -55,6 +55,10 @@ function reload()
*/ */
function checkOSAndroid() function checkOSAndroid()
{ {
browser.runtime.getPlatformInfo().then(function(info) {
os = info.os;
});
if(os == "android") if(os == "android")
{ {
return true; return true;
@ -75,10 +79,10 @@ function countFields(url)
} }
/** /**
* Extract the fields from an url. * Extract the fields from an url.
* @param {String} url URL as String * @param {String} url URL as String
* @return {Array} Fields as array * @return {Array} Fields as array
*/ */
function extractFileds(url) function extractFileds(url)
{ {
return (url.match(/[^\/|\?|&]+=[^\/|\?|&]+/gi) || []); return (url.match(/[^\/|\?|&]+=[^\/|\?|&]+/gi) || []);
@ -158,10 +162,12 @@ function increaseURLCounter()
*/ */
function changeIcon() function changeIcon()
{ {
if(storage.globalStatus){ if(!checkOSAndroid()) {
browser.browserAction.setIcon({path: "img/clearurls.svg"}); if(storage.globalStatus){
} else{ browser.browserAction.setIcon({path: "img/clearurls.svg"});
browser.browserAction.setIcon({path: "img/clearurls_gray.svg"}); } else{
browser.browserAction.setIcon({path: "img/clearurls_gray.svg"});
}
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "ClearURLs", "name": "ClearURLs",
"version": "1.5.1a", "version": "1.5.1.5a",
"author": "Kevin R.", "author": "Kevin R.",
"description": "Remove tracking elements form URLs.", "description": "Remove tracking elements form URLs.",
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls", "homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",