From 0417469a26ea0730cfb5e70141d19fa675f26f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Mon, 6 Jan 2020 17:14:34 +0100 Subject: [PATCH] Added yandex link fixer + renewed copyright notice #305 --- CHANGELOG.md | 1 + GitLabPages/js/scripts.js | 2 +- build_tools/minifyDataJSON.js | 2 +- clearurls.js | 2 +- core_js/cleaning_tool.js | 2 +- core_js/context_menu.js | 2 +- core_js/google_link_fix.js | 2 +- core_js/historyListener.js | 2 +- core_js/log.js | 2 +- core_js/message_handler.js | 2 +- core_js/popup.js | 2 +- core_js/pureCleaning.js | 2 +- core_js/settings.js | 2 +- core_js/siteBlockedAlert.js | 2 +- core_js/storage.js | 2 +- core_js/tools.js | 2 +- core_js/watchdog.js | 2 +- core_js/write_version.js | 2 +- core_js/yandex_link_fix.js | 61 +++++++ css/core.css | 2 +- css/switchButtons.css | 2 +- html/cleaningTool.html | 2 +- html/log.html | 2 +- html/popup.html | 2 +- html/settings.html | 2 +- html/siteBlockedAlert.html | 2 +- manifest.json | 323 +++++++++++++++++++++++----------- server/report_url.php | 2 +- 28 files changed, 305 insertions(+), 130 deletions(-) create mode 100644 core_js/yandex_link_fix.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b914de..8e1813c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added hyperlink auditing blocking [#184](https://gitlab.com/KevinRoebert/ClearUrls/issues/184) +- Added yandex link fix script, to avoid URL tracking [#305](https://gitlab.com/KevinRoebert/ClearUrls/issues/305) ### Compatibility note - Require Firefox >= 55 diff --git a/GitLabPages/js/scripts.js b/GitLabPages/js/scripts.js index b15e359..cd21a05 100644 --- a/GitLabPages/js/scripts.js +++ b/GitLabPages/js/scripts.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/build_tools/minifyDataJSON.js b/build_tools/minifyDataJSON.js index fd30972..d94df13 100644 --- a/build_tools/minifyDataJSON.js +++ b/build_tools/minifyDataJSON.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/clearurls.js b/clearurls.js index e398f1c..10d5a7e 100644 --- a/clearurls.js +++ b/clearurls.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/cleaning_tool.js b/core_js/cleaning_tool.js index b4a7f37..ae157d9 100644 --- a/core_js/cleaning_tool.js +++ b/core_js/cleaning_tool.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/context_menu.js b/core_js/context_menu.js index 97c8c24..2e53796 100644 --- a/core_js/context_menu.js +++ b/core_js/context_menu.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/google_link_fix.js b/core_js/google_link_fix.js index 095436c..63c5550 100644 --- a/core_js/google_link_fix.js +++ b/core_js/google_link_fix.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/historyListener.js b/core_js/historyListener.js index 8ea5783..762b758 100644 --- a/core_js/historyListener.js +++ b/core_js/historyListener.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/log.js b/core_js/log.js index 4ebbc12..10aca43 100644 --- a/core_js/log.js +++ b/core_js/log.js @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/message_handler.js b/core_js/message_handler.js index 8010201..6080210 100644 --- a/core_js/message_handler.js +++ b/core_js/message_handler.js @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/popup.js b/core_js/popup.js index 7d111a2..e616275 100644 --- a/core_js/popup.js +++ b/core_js/popup.js @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/pureCleaning.js b/core_js/pureCleaning.js index 2345bbc..801910d 100644 --- a/core_js/pureCleaning.js +++ b/core_js/pureCleaning.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/settings.js b/core_js/settings.js index 3189883..46fee23 100644 --- a/core_js/settings.js +++ b/core_js/settings.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/siteBlockedAlert.js b/core_js/siteBlockedAlert.js index 3f2a6d0..bc70254 100644 --- a/core_js/siteBlockedAlert.js +++ b/core_js/siteBlockedAlert.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/storage.js b/core_js/storage.js index 21bcd1b..ed0d0d2 100644 --- a/core_js/storage.js +++ b/core_js/storage.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/tools.js b/core_js/tools.js index 6e53e92..227859e 100644 --- a/core_js/tools.js +++ b/core_js/tools.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/watchdog.js b/core_js/watchdog.js index b551ed2..f3105fa 100644 --- a/core_js/watchdog.js +++ b/core_js/watchdog.js @@ -1,6 +1,6 @@ /* * ClearURLs -* Copyright (c) 2017-2019 Kevin Röbert +* Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/write_version.js b/core_js/write_version.js index 23f5370..4bbd5c2 100644 --- a/core_js/write_version.js +++ b/core_js/write_version.js @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/core_js/yandex_link_fix.js b/core_js/yandex_link_fix.js new file mode 100644 index 0000000..1054758 --- /dev/null +++ b/core_js/yandex_link_fix.js @@ -0,0 +1,61 @@ +/* +* ClearURLs +* Copyright (c) 2017-2020 Kevin Röbert +* +* 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 +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, see . +*/ +(function (window) { + "use strict"; + + function injectFunction() { + let ele = document.createElement('script'); + let s = document.getElementsByTagName('script')[0]; + + ele.type = 'text/javascript'; + ele.textContent = "Object.defineProperty(window, '_borschik', {" + + " value: function() { return false; }," + + " writable: false," + + " configurable: false" + + "});"; + + s.parentNode.insertBefore(ele, s); + } + + /* + * The main entry + */ + function main() + { + injectFunction(); + + document.addEventListener('mouseover', function (event) { + let a = event.target, depth = 1; + + while (a && a.tagName !== 'A' && depth-- > 0) { + a = a.parentNode; + } + + if (a && a.tagName === 'A') { + try { + a.removeAttribute('data-counter'); + delete a.dataset.cthref; + } catch(e) { + console.log(e); + } + } + }, true); + } + + main(); +})(window); \ No newline at end of file diff --git a/css/core.css b/css/core.css index 0b41fe3..030e1d9 100644 --- a/css/core.css +++ b/css/core.css @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/css/switchButtons.css b/css/switchButtons.css index 42b6863..84e0a38 100644 --- a/css/switchButtons.css +++ b/css/switchButtons.css @@ -1,6 +1,6 @@ /* * ClearURLs - * Copyright (c) 2017-2019 Kevin Röbert + * Copyright (c) 2017-2020 Kevin Röbert * * 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 diff --git a/html/cleaningTool.html b/html/cleaningTool.html index a543e3e..2e0dc09 100644 --- a/html/cleaningTool.html +++ b/html/cleaningTool.html @@ -1,6 +1,6 @@