From e1590416005e8f726c1b724b23461f97f10f87ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Thu, 12 Sep 2019 22:17:13 +0200 Subject: [PATCH] Version 1.8.1 !47 #206 --- CHANGELOG.md | 10 + clearurls.js | 987 ++++++++++++++++++++++----------------------- core_js/storage.js | 35 +- manifest.json | 4 +- 4 files changed, 519 insertions(+), 517 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88b8204..5d4765d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.8.1] - 2019-09-12 + +### Compatibility note +- Require Firefox >= 55 +- Require Chrome >= 22 + +### Changed +- Improvements on check for android systems ([#206](https://gitlab.com/KevinRoebert/ClearUrls/issues/206)) +- Improvements on storage. Away with periodic save of in-memory data to storage. Instead save when there are actual changes by [@tartpvule](https://gitlab.com/tartpvule) in ([!47](https://gitlab.com/KevinRoebert/ClearUrls/merge_requests/47)) + ## [1.8.0] - 2019-09-11 ### Compatibility note diff --git a/clearurls.js b/clearurls.js index a9160ed..517bf42 100644 --- a/clearurls.js +++ b/clearurls.js @@ -166,7 +166,7 @@ function removeFieldsFormURL(provider, pureUrl) } } }); - + changes = true; } }); @@ -213,548 +213,539 @@ function removeFieldsFormURL(provider, pureUrl) function start() { /** - * Save OS Version + * Initialize the JSON provider object keys. + * + * @param {JSON Object} obj */ - chrome.runtime.getPlatformInfo(function(info) { - os = info.os; - changeIcon(); + function getKeys(obj){ + for(var key in obj){ + prvKeys.push(key); + } + } + /** + * Initialize the providers form the JSON object. + * + */ + function createProviders() + { + data = storage.ClearURLsData; - /** - * Initialize the JSON provider object keys. - * - * @param {JSON Object} obj - */ - function getKeys(obj){ - for(var key in obj){ - prvKeys.push(key); + for(var p = 0; p < prvKeys.length; p++) + { + //Create new provider + providers.push(new Provider(prvKeys[p], data.providers[prvKeys[p]].completeProvider, + data.providers[prvKeys[p]].forceRedirection)); + + //Add URL Pattern + providers[p].setURLPattern(data.providers[prvKeys[p]].urlPattern); + + //Add rules to provider + for(var r = 0; r < data.providers[prvKeys[p]].rules.length; r++) + { + providers[p].addRule(data.providers[prvKeys[p]].rules[r]); + } + + //Add raw rules to provider + for(var raw = 0; raw < data.providers[prvKeys[p]].rawRules.length; raw++) + { + providers[p].addRawRule(data.providers[prvKeys[p]].rawRules[raw]); + } + + //Add exceptions to provider + for(var e = 0; e < data.providers[prvKeys[p]].exceptions.length; e++) + { + providers[p].addException(data.providers[prvKeys[p]].exceptions[e]); + } + + //Add redirections to provider + for(var re = 0; re < data.providers[prvKeys[p]].redirections.length; re++) + { + providers[p].addRedirection(data.providers[prvKeys[p]].redirections[re]); + } } } /** - * Initialize the providers form the JSON object. + * Convert the external data to Objects and + * call the create provider function. * + * @param {String} retrievedText - pure data form github */ - function createProviders() + function toObject(retrievedText) { + getKeys(storage.ClearURLsData.providers); + createProviders(); + } + + /** + * Get the hash for the rule file on github. + * Check the hash with the hash form the local file. + * If the hash has changed, then download the new rule file. + * Else do nothing. + */ + function getHash() { - data = storage.ClearURLsData; - - for(var p = 0; p < prvKeys.length; p++) - { - //Create new provider - providers.push(new Provider(prvKeys[p], data.providers[prvKeys[p]].completeProvider, - data.providers[prvKeys[p]].forceRedirection)); - - //Add URL Pattern - providers[p].setURLPattern(data.providers[prvKeys[p]].urlPattern); - - //Add rules to provider - for(var r = 0; r < data.providers[prvKeys[p]].rules.length; r++) + //Get the target hash from github + fetch(storage.hashURL) + .then(function(response){ + var responseTextHash = response.clone().text().then(function(responseTextHash){ + if(response.ok && $.trim(responseTextHash)) { - providers[p].addRule(data.providers[prvKeys[p]].rules[r]); - } + dataHash = responseTextHash; - //Add raw rules to provider - for(var raw = 0; raw < data.providers[prvKeys[p]].rawRules.length; raw++) - { - providers[p].addRawRule(data.providers[prvKeys[p]].rawRules[raw]); - } - - //Add exceptions to provider - for(var e = 0; e < data.providers[prvKeys[p]].exceptions.length; e++) - { - providers[p].addException(data.providers[prvKeys[p]].exceptions[e]); - } - - //Add redirections to provider - for(var re = 0; re < data.providers[prvKeys[p]].redirections.length; re++) - { - providers[p].addRedirection(data.providers[prvKeys[p]].redirections[re]); - } - } - } - - /** - * Convert the external data to Objects and - * call the create provider function. - * - * @param {String} retrievedText - pure data form github - */ - function toObject(retrievedText) { - getKeys(storage.ClearURLsData.providers); - createProviders(); - } - - /** - * Get the hash for the rule file on github. - * Check the hash with the hash form the local file. - * If the hash has changed, then download the new rule file. - * Else do nothing. - */ - function getHash() - { - //Get the target hash from github - fetch(storage.hashURL) - .then(function(response){ - var responseTextHash = response.clone().text().then(function(responseTextHash){ - if(response.ok && $.trim(responseTextHash)) + if($.trim(dataHash) !== $.trim(localDataHash)) { - dataHash = responseTextHash; - - if($.trim(dataHash) !== $.trim(localDataHash)) - { - fetchFromURL(); - } - else { - toObject(storage.ClearURLsData); - storeHashStatus(1); - saveOnDisk(['hashStatus']); - } + fetchFromURL(); } else { - dataHash = false; - } - }); - }); - } - - /* - * ################################################################## - * # Fetch Rules & Exception from URL # - * ################################################################## - */ - function fetchFromURL() - { - fetch(storage.ruleURL) - .then(checkResponse); - - function checkResponse(response) - { - var responseText = response.clone().text().then(function(responseText){ - if(response.ok && $.trim(responseText)) - { - var downloadedFileHash = $.sha256(responseText); - - if($.trim(downloadedFileHash) === $.trim(dataHash)) - { - storage.ClearURLsData = responseText; - storage.dataHash = downloadedFileHash; - storeHashStatus(2); - } - else { - storeHashStatus(3); - } - storage.ClearURLsData = JSON.parse(storage.ClearURLsData); toObject(storage.ClearURLsData); - saveOnDisk(['ClearURLsData', 'dataHash', 'hashStatus']); - } - }); - } - } - - // ################################################################## - - /* - * ################################################################## - * # Supertyp Provider # - * ################################################################## - */ - /** - * Declare constructor - * - * @param {String} _name Provider name - * @param {boolean} _completeProvider Set URL Pattern as rule - * @param {boolean} _forceRedirection Whether redirects should be enforced via a "tabs.update" - * @param {boolean} _isActive Is the provider active? - */ - function Provider(_name, _completeProvider = false, _forceRedirection = false, _isActive = true){ - var name = _name; - var urlPattern; - var enabled_rules = {}; - var disabled_rules = {}; - var enabled_exceptions = {}; - var disabled_exceptions = {}; - var canceling = _completeProvider; - var enabled_redirections = {}; - var disabled_redirections = {}; - var active = _isActive; - var enabled_rawRules = {}; - var disabled_rawRules = {}; - - if(_completeProvider){ - enabled_rules[".*"] = true; - } - - /** - * Returns whether redirects should be enforced via a "tabs.update" - * @return {boolean} whether redirects should be enforced - */ - this.shouldForceRedirect = function() { - return _forceRedirection; - }; - - /** - * Returns the provider name. - * @return {String} - */ - this.getName = function() { - return name; - }; - - /** - * Add URL pattern. - * - * @require urlPatterns as RegExp - */ - this.setURLPattern = function(urlPatterns) { - urlPattern = new RegExp(urlPatterns, "i"); - }; - - /** - * Return if the Provider Request is canceled - * @return {Boolean} isCanceled - */ - this.isCaneling = function() { - return canceling; - }; - - /** - * Check the url is matching the ProviderURL. - * - * @return {boolean} ProviderURL as RegExp - */ - this.matchURL = function(url) { - return urlPattern.test(url) && !(this.matchException(url)); - }; - - /** - * Add a rule to the rule array - * and replace old rule with new rule. - * - * @param {String} rule RegExp as string - * @param {boolean} isActive Is this rule active? - */ - this.addRule = function(rule, isActive = true) { - rule = "([\\/|\\?|#]|(&|&))+("+rule+"=[^\\/|\\?|&]*)"; - - if(isActive) - { - enabled_rules[rule] = true; - - if(disabled_rules[rule] !== undefined) - { - delete disabled_rules[rule]; + storeHashStatus(1); + saveOnDisk(['hashStatus']); } } else { - disabled_rules[rule] = true; - - if(enabled_rules[rule] !== undefined) - { - delete enabled_rules[rule]; - } + dataHash = false; } - }; + }); + }); + } - /** - * Return all active rules as an array. - * - * @return Array RegExp strings - */ - this.getRules = function() { - return Object.keys(enabled_rules); - }; + /* + * ################################################################## + * # Fetch Rules & Exception from URL # + * ################################################################## + */ + function fetchFromURL() + { + fetch(storage.ruleURL) + .then(checkResponse); - /** - * Add a raw rule to the raw rule array - * and replace old raw rule with new raw rule. - * - * @param {String} rule RegExp as string - * @param {boolean} isActive Is this rule active? - */ - this.addRawRule = function(rule, isActive = true) { - if(isActive) - { - enabled_rawRules[rule] = true; - - if(disabled_rawRules[rule] !== undefined) - { - delete disabled_rawRules[rule]; - } - } - else { - disabled_rawRules[rule] = true; - - if(enabled_rawRules[rule] !== undefined) - { - delete enabled_rawRules[rule]; - } - } - }; - - /** - * Return all active raw rules as an array. - * - * @return Array RegExp strings - */ - this.getRawRules = function() { - return Object.keys(enabled_rawRules); - }; - - /** - * Add a exception to the exceptions array - * and replace old with new exception. - * - * @param {String} exception RegExp as string - * @param {Boolean} isActive Is this exception acitve? - */ - this.addException = function(exception, isActive = true) { - if(isActive) - { - enabled_exceptions[exception] = true; - - if(disabled_exceptions[exception] !== undefined) - { - delete disabled_exceptions[exception]; - } - } - else { - disabled_exceptions[exception] = true; - - if(enabled_exceptions[exception] !== undefined) - { - delete enabled_exceptions[exception]; - } - } - }; - - /** - * Private helper method to check if the url - * an exception. - * - * @param {String} url RegExp as string - * @return {boolean} if matching? true: false - */ - this.matchException = function(url) { - var result = false; - - //Add the site blocked alert to every exception - if(url == siteBlockedAlert) return true; - - for(var exception in enabled_exceptions) { - if(result) break; - - exception_regex = new RegExp(exception, "i"); - result = exception_regex.test(url); - } - - return result; - }; - - /** - * Add a redirection to the redirections array - * and replace old with new redirection. - * - * @param {String} redirection RegExp as string - * @param {Boolean} isActive Is this redirection active? - */ - this.addRedirection = function(redirection, isActive = true) { - if(isActive) - { - enabled_redirections[redirection] = true; - - if(disabled_redirections[redirection] !== undefined) - { - delete disabled_redirections[redirection]; - } - } - else { - disabled_redirections[redirection] = true; - - if(enabled_redirections[redirection] !== undefined) - { - delete enabled_redirections[redirection]; - } - } - }; - - /** - * Return all redirection. - * - * @return url - */ - this.getRedirection = function(url) { - var re = null; - - for(var redirection in enabled_redirections) { - result = (url.match(new RegExp(redirection, "i"))); - - if (result && result.length > 0 && redirection) - { - re = (new RegExp(redirection, "i")).exec(url)[1]; - - break; - } - } - - return re; - }; - } - // ################################################################## - - /** - * Function which called from the webRequest to - * remove the tracking fields from the url. - * - * @param {webRequest} request webRequest-Object - * @return {Array} redirectUrl or none - */ - function clearUrl(request) + function checkResponse(response) { - var URLbeforeReplaceCount = countFields(request.url); + var responseText = response.clone().text().then(function(responseText){ + if(response.ok && $.trim(responseText)) + { + var downloadedFileHash = $.sha256(responseText); - //Add Fields form Request to global url counter - increaseGlobalURLCounter(URLbeforeReplaceCount); - - if(storage.globalStatus){ - var result = { - "changes": false, - "url": "", - "redirect": false, - "cancel": false - }; - - /* - * Call for every provider the removeFieldsFormURL method. - */ - for (var i = 0; i < providers.length; i++) { - - if(providers[i].matchURL(request.url)) + if($.trim(downloadedFileHash) === $.trim(dataHash)) { - result = removeFieldsFormURL(providers[i], request.url); + storage.ClearURLsData = responseText; + storage.dataHash = downloadedFileHash; + storeHashStatus(2); } - - /* - * Expand urls and bypass tracking. - * Cancel the active request. - */ - if(result.redirect) - { - if(providers[i].shouldForceRedirect()) { - browser.tabs.update(request.tabId, {url: result.url}); - return {cancel: true}; - } - - return { - redirectUrl: result.url - }; - } - - /* - * Cancel the Request and redirect to the site blocked alert page, - * to inform the user about the full url blocking. - */ - if(result.cancel){ - return { - redirectUrl: siteBlockedAlert - }; - } - - /* - * Ensure that the function go not into - * a loop. - */ - if(result.changes){ - return { - redirectUrl: result.url - }; + else { + storeHashStatus(3); } + storage.ClearURLsData = JSON.parse(storage.ClearURLsData); + toObject(storage.ClearURLsData); + saveOnDisk(['ClearURLsData', 'dataHash', 'hashStatus']); } - } - - // Default case - return {}; - } - - /** - * Call loadOldDataFromStore, getHash, counter, status and log functions - */ - - loadOldDataFromStore(); - getHash(); - setBadgedStatus(); - - /** - * Call by each tab is updated. - * And if url has changed. - */ - function handleUpdated(tabId, changeInfo, tabInfo) { - if(changeInfo.url) - { - delete badges[tabId]; - } - currentURL = tabInfo.url; - } - - /** - * Call by each tab is updated. - */ - browser.tabs.onUpdated.addListener(handleUpdated); - - /** - * Call by each tab change to set the actual tab id - */ - function handleActivated(activeInfo) { - tabid = activeInfo.tabId; - browser.tabs.get(tabid).then(function (tab) { - currentURL = tab.url; }); } + } + + // ################################################################## + + /* + * ################################################################## + * # Supertyp Provider # + * ################################################################## + */ + /** + * Declare constructor + * + * @param {String} _name Provider name + * @param {boolean} _completeProvider Set URL Pattern as rule + * @param {boolean} _forceRedirection Whether redirects should be enforced via a "tabs.update" + * @param {boolean} _isActive Is the provider active? + */ + function Provider(_name, _completeProvider = false, _forceRedirection = false, _isActive = true){ + var name = _name; + var urlPattern; + var enabled_rules = {}; + var disabled_rules = {}; + var enabled_exceptions = {}; + var disabled_exceptions = {}; + var canceling = _completeProvider; + var enabled_redirections = {}; + var disabled_redirections = {}; + var active = _isActive; + var enabled_rawRules = {}; + var disabled_rawRules = {}; + + if(_completeProvider){ + enabled_rules[".*"] = true; + } /** - * Call by each tab change. + * Returns whether redirects should be enforced via a "tabs.update" + * @return {boolean} whether redirects should be enforced */ - browser.tabs.onActivated.addListener(handleActivated); + this.shouldForceRedirect = function() { + return _forceRedirection; + }; /** - * Check the request. + * Returns the provider name. + * @return {String} */ - function promise(requestDetails) - { - if(isDataURL(requestDetails)) + this.getName = function() { + return name; + }; + + /** + * Add URL pattern. + * + * @require urlPatterns as RegExp + */ + this.setURLPattern = function(urlPatterns) { + urlPattern = new RegExp(urlPatterns, "i"); + }; + + /** + * Return if the Provider Request is canceled + * @return {Boolean} isCanceled + */ + this.isCaneling = function() { + return canceling; + }; + + /** + * Check the url is matching the ProviderURL. + * + * @return {boolean} ProviderURL as RegExp + */ + this.matchURL = function(url) { + return urlPattern.test(url) && !(this.matchException(url)); + }; + + /** + * Add a rule to the rule array + * and replace old rule with new rule. + * + * @param {String} rule RegExp as string + * @param {boolean} isActive Is this rule active? + */ + this.addRule = function(rule, isActive = true) { + rule = "([\\/|\\?|#]|(&|&))+("+rule+"=[^\\/|\\?|&]*)"; + + if(isActive) { - return {}; + enabled_rules[rule] = true; + + if(disabled_rules[rule] !== undefined) + { + delete disabled_rules[rule]; + } } else { - var ret = clearUrl(requestDetails); - return ret; + disabled_rules[rule] = true; + + if(enabled_rules[rule] !== undefined) + { + delete enabled_rules[rule]; + } + } + }; + + /** + * Return all active rules as an array. + * + * @return Array RegExp strings + */ + this.getRules = function() { + return Object.keys(enabled_rules); + }; + + /** + * Add a raw rule to the raw rule array + * and replace old raw rule with new raw rule. + * + * @param {String} rule RegExp as string + * @param {boolean} isActive Is this rule active? + */ + this.addRawRule = function(rule, isActive = true) { + if(isActive) + { + enabled_rawRules[rule] = true; + + if(disabled_rawRules[rule] !== undefined) + { + delete disabled_rawRules[rule]; + } + } + else { + disabled_rawRules[rule] = true; + + if(enabled_rawRules[rule] !== undefined) + { + delete enabled_rawRules[rule]; + } + } + }; + + /** + * Return all active raw rules as an array. + * + * @return Array RegExp strings + */ + this.getRawRules = function() { + return Object.keys(enabled_rawRules); + }; + + /** + * Add a exception to the exceptions array + * and replace old with new exception. + * + * @param {String} exception RegExp as string + * @param {Boolean} isActive Is this exception acitve? + */ + this.addException = function(exception, isActive = true) { + if(isActive) + { + enabled_exceptions[exception] = true; + + if(disabled_exceptions[exception] !== undefined) + { + delete disabled_exceptions[exception]; + } + } + else { + disabled_exceptions[exception] = true; + + if(enabled_exceptions[exception] !== undefined) + { + delete enabled_exceptions[exception]; + } + } + }; + + /** + * Private helper method to check if the url + * an exception. + * + * @param {String} url RegExp as string + * @return {boolean} if matching? true: false + */ + this.matchException = function(url) { + var result = false; + + //Add the site blocked alert to every exception + if(url == siteBlockedAlert) return true; + + for(var exception in enabled_exceptions) { + if(result) break; + + exception_regex = new RegExp(exception, "i"); + result = exception_regex.test(url); + } + + return result; + }; + + /** + * Add a redirection to the redirections array + * and replace old with new redirection. + * + * @param {String} redirection RegExp as string + * @param {Boolean} isActive Is this redirection active? + */ + this.addRedirection = function(redirection, isActive = true) { + if(isActive) + { + enabled_redirections[redirection] = true; + + if(disabled_redirections[redirection] !== undefined) + { + delete disabled_redirections[redirection]; + } + } + else { + disabled_redirections[redirection] = true; + + if(enabled_redirections[redirection] !== undefined) + { + delete enabled_redirections[redirection]; + } + } + }; + + /** + * Return all redirection. + * + * @return url + */ + this.getRedirection = function(url) { + var re = null; + + for(var redirection in enabled_redirections) { + result = (url.match(new RegExp(redirection, "i"))); + + if (result && result.length > 0 && redirection) + { + re = (new RegExp(redirection, "i")).exec(url)[1]; + + break; + } + } + + return re; + }; + } + // ################################################################## + + /** + * Function which called from the webRequest to + * remove the tracking fields from the url. + * + * @param {webRequest} request webRequest-Object + * @return {Array} redirectUrl or none + */ + function clearUrl(request) + { + var URLbeforeReplaceCount = countFields(request.url); + + //Add Fields form Request to global url counter + increaseGlobalURLCounter(URLbeforeReplaceCount); + + if(storage.globalStatus){ + var result = { + "changes": false, + "url": "", + "redirect": false, + "cancel": false + }; + + /* + * Call for every provider the removeFieldsFormURL method. + */ + for (var i = 0; i < providers.length; i++) { + + if(providers[i].matchURL(request.url)) + { + result = removeFieldsFormURL(providers[i], request.url); + } + + /* + * Expand urls and bypass tracking. + * Cancel the active request. + */ + if(result.redirect) + { + if(providers[i].shouldForceRedirect()) { + browser.tabs.update(request.tabId, {url: result.url}); + return {cancel: true}; + } + + return { + redirectUrl: result.url + }; + } + + /* + * Cancel the Request and redirect to the site blocked alert page, + * to inform the user about the full url blocking. + */ + if(result.cancel){ + return { + redirectUrl: siteBlockedAlert + }; + } + + /* + * Ensure that the function go not into + * a loop. + */ + if(result.changes){ + return { + redirectUrl: result.url + }; + } } } - /** - * To prevent long loading on data urls - * we will check here for data urls. - * - * @type {requestDetails} - * @return {boolean} - */ - function isDataURL(requestDetails) { - var s = requestDetails.url; + // Default case + return {}; + } - return s.substring(0,4) == "data"; + /** + * Call loadOldDataFromStore, getHash, counter, status and log functions + */ + + loadOldDataFromStore(); + getHash(); + setBadgedStatus(); + + /** + * Call by each tab is updated. + * And if url has changed. + */ + function handleUpdated(tabId, changeInfo, tabInfo) { + if(changeInfo.url) + { + delete badges[tabId]; } + currentURL = tabInfo.url; + } - /** - * Call by each Request and checking the url. - * - * @type {Array} - */ - browser.webRequest.onBeforeRequest.addListener( - promise, - {urls: [""], types: getData("types")}, - ["blocking"] - ); - }); + /** + * Call by each tab is updated. + */ + browser.tabs.onUpdated.addListener(handleUpdated); + + /** + * Call by each tab change to set the actual tab id + */ + function handleActivated(activeInfo) { + tabid = activeInfo.tabId; + browser.tabs.get(tabid).then(function (tab) { + currentURL = tab.url; + }); + } + + /** + * Call by each tab change. + */ + browser.tabs.onActivated.addListener(handleActivated); + + /** + * Check the request. + */ + function promise(requestDetails) + { + if(isDataURL(requestDetails)) + { + return {}; + } + else { + var ret = clearUrl(requestDetails); + return ret; + } + } + + /** + * To prevent long loading on data urls + * we will check here for data urls. + * + * @type {requestDetails} + * @return {boolean} + */ + function isDataURL(requestDetails) { + var s = requestDetails.url; + + return s.substring(0,4) == "data"; + } + + /** + * Call by each Request and checking the url. + * + * @type {Array} + */ + browser.webRequest.onBeforeRequest.addListener( + promise, + {urls: [""], types: getData("types")}, + ["blocking"] + ); } /** diff --git a/core_js/storage.js b/core_js/storage.js index 329f046..6ab6b69 100644 --- a/core_js/storage.js +++ b/core_js/storage.js @@ -21,6 +21,8 @@ * This script is responsible for the storage. */ var storage = []; +var hasPendingSaves = false; +var pendingSaves = new Set(); /** * Writes the storage variable to the disk. @@ -72,9 +74,6 @@ function saveOnDisk(keys) browser.storage.local.set(json); } -var hasPendingSaves = false; -var pendingSaves = new Set(); - /** * Schedule to save a key to disk in 30 seconds. * @param {String} key @@ -95,11 +94,22 @@ function deferSaveOnDisk(key) } /** -* Retrieve everything and save on the RAM. +* Start sequence for ClearURLs. */ -function getDataFromDisk() +function genesis() { - browser.storage.local.get(null).then(initStorage, error); + browser.storage.local.get(null).then((items) => { + initStorage(items); + + // Start the clearurls.js + start(); + + // Start the context_menu + contextMenuStart(); + + // Start history listener + historyListenerStart(); + }, error); } /** @@ -171,15 +181,6 @@ function initStorage(items) setData(key, value); }); } - - // Start the clearurls.js - start(); - - // Start the context_menu - contextMenuStart(); - - // Start history listener - historyListenerStart(); } /** @@ -264,5 +265,5 @@ function storeHashStatus(status_code) storage.hashStatus = status_code; } -// Start storage -getDataFromDisk(); +// Start storage and ClearURLs +genesis(); diff --git a/manifest.json b/manifest.json index e28926b..6518272 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, "name": "ClearURLs", - "version": "1.8.0", - "author": "Kevin R.", + "version": "1.8.1", + "author": "Kevin Röbert", "description": "Remove tracking elements from URLs.", "homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls", "default_locale": "en",