mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 06:05:37 +07:00
New Feature - Report URLs
Lately, I have received relatively few requests with potentially bad URLs. On the one hand, that could be because ClearURLs are working very well by now. But I also think that not everyone wants to sign up to GitLab to report a URL. That's why I've added a new button that reports the current URL in the active tab to me, so I can take a closer look at the URL. So that you can see exactly what data will be sent to me, I have uploaded the source code for the PHP script, of course, without a password etc. Please be careful not to send URLs with personal information or tokens.
This commit is contained in:
15
clearurls.js
15
clearurls.js
@@ -11,6 +11,7 @@ var siteBlockedAlert = 'javascript:void(0)';
|
||||
var dataHash;
|
||||
var localDataHash;
|
||||
var os;
|
||||
var currentURL;
|
||||
|
||||
var storage = [];
|
||||
|
||||
@@ -580,6 +581,7 @@ function start(items)
|
||||
{
|
||||
delete badges[tabId];
|
||||
}
|
||||
currentURL = tabInfo.url;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -592,6 +594,9 @@ function start(items)
|
||||
*/
|
||||
function handleActivated(activeInfo) {
|
||||
tabid = activeInfo.tabId;
|
||||
browser.tabs.get(tabid).then(function (tab) {
|
||||
currentURL = tab.url;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -840,6 +845,7 @@ function initSettings()
|
||||
storage.hashURL = "https://gitlab.com/KevinRoebert/ClearUrls/raw/master/data/rules.hash";
|
||||
storage.ruleURL = "https://gitlab.com/KevinRoebert/ClearUrls/raw/master/data/data.json";
|
||||
storage.types = ["main_frame", "sub_frame", "xmlhttprequest"];
|
||||
storage.reportServer = "https://clearurls.xn--rb-fka.it";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -875,3 +881,12 @@ function isEmpty(obj)
|
||||
{
|
||||
return (Object.getOwnPropertyNames(obj).length === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current URL.
|
||||
* @return {String} [description]
|
||||
*/
|
||||
function getCurrentURL()
|
||||
{
|
||||
return currentURL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user