Preparations for costume rules

+ Preparations for costume rules
- Feature "Report URLs"
+ Auto hash rules
+ Minimize rules length
+ Add start and end delimiters to rules
This commit is contained in:
Kevin Röbert
2019-03-12 18:13:23 +01:00
parent 81bc71de5e
commit 9c638c52f9
10 changed files with 541 additions and 140 deletions

View File

@@ -13,7 +13,6 @@ var hashStatus;
var loggingStatus;
var statisticsStatus;
var currentURL;
var reportServer;
async function getData()
{
@@ -29,7 +28,6 @@ async function getData()
hashStatus = data.hashStatus;
loggingStatus = data.loggingStatus;
statisticsStatus = data.statisticsStatus;
reportServer = data.reportServer;
browser.runtime.sendMessage({
function: "getCurrentURL",
@@ -201,7 +199,6 @@ $(document).ready(function(){
changeSwitchButton("statistics", "statisticsStatus");
$('#loggingPage').attr('href', browser.extension.getURL('./html/log.html'));
$('#settings').attr('href', browser.extension.getURL('./html/settings.html'));
$('#reportButton').on("click", reportURL);
setText();
});
@@ -262,26 +259,6 @@ function translate(string)
return browser.i18n.getMessage(string);
}
/**
* Send the url to the DB on clearurls.röb.it to checked for tracking fields.
*/
function reportURL()
{
$.ajax({
url: reportServer+'/report_url.php?url='+encodeURI(currentURL),
success: function(result) {
BootstrapDialog.show({
message: translate('success_report_url')
});
},
error: function(result) {
BootstrapDialog.show({
message: translate('error_report_url')
});
}
});
}
function handleError(error) {
console.log(`Error: ${error}`);
}