From 191fcfce2392ef2bf7dc1e39d00a83bbd3523507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20R=C3=B6bert?= Date: Sun, 29 Sep 2019 17:10:26 +0200 Subject: [PATCH] Version 1.8.5 #264 #262 #267 --- CHANGELOG.md | 11 +++++++++++ core_js/google_link_fix.js | 35 +++++++++++++---------------------- data/data.min.json | 3 ++- manifest.json | 2 +- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c490b2..84ac2f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ 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.5] - 2019-09-29 + +### Compatibility note +- Require Firefox >= 55 +- Require Chrome >= 22 + +### Fixed +- Fixed [#264](https://gitlab.com/KevinRoebert/ClearUrls/issues/264) +- Fixed [#262](https://gitlab.com/KevinRoebert/ClearUrls/issues/262) +- Fixed [#267](https://gitlab.com/KevinRoebert/ClearUrls/issues/267) + ## [1.8.4] - 2019-09-26 ### Compatibility note diff --git a/core_js/google_link_fix.js b/core_js/google_link_fix.js index 823943c..0b73dbf 100644 --- a/core_js/google_link_fix.js +++ b/core_js/google_link_fix.js @@ -24,38 +24,26 @@ (function (window) { "use strict"; - function injectFunction(func) { + function injectFunction() { var ele = document.createElement('script'); var s = document.getElementsByTagName('script')[0]; ele.type = 'text/javascript'; - ele.textContent = '(' + func + ')();'; + ele.textContent = "Object.defineProperty(window, 'rwt', {" + + " value: function() { return false; }," + + " writable: false," + + " configurable: false" + + "});"; s.parentNode.insertBefore(ele, s); } - /* - * Disable the url rewrite function - */ - function disableURLRewrite() { - function inject_init() { - /* Define the url rewrite function */ - Object.defineProperty(window, 'rwt', { - value: function() { return true; }, - writable: false, // set the property to read-only - configurable: false - }); - } - - injectFunction(inject_init); - } - /* * The main entry */ function main() { - disableURLRewrite(); + injectFunction(); document.addEventListener('mouseover', function (event) { var a = event.target, depth = 1; @@ -65,9 +53,12 @@ } if (a && a.tagName == 'A') { - a.removeAttribute('onmousedown'); - var clone = a.cloneNode(true); - a.parentNode.replaceChild(clone, a); + try { + a.removeAttribute('data-cthref'); + delete a.dataset.cthref; + } catch(e) { + console.log(e); + } } }, true); } diff --git a/data/data.min.json b/data/data.min.json index 3d8bafb..be00f8e 100644 --- a/data/data.min.json +++ b/data/data.min.json @@ -186,7 +186,8 @@ ".*(clastarti\\.cc).*", ".*(kreditkarten-banking\\.lbb\\.de).*", ".*(facebook\\.)\\w{2,}.*(\\/groups\\/member_bio\\/bio_dialog\\/).*", - ".*([\\.]?tinkoff\\.ru).*" + ".*([\\.]?tinkoff\\.ru).*", + ".*(cyberport\\.de).*(\\/adscript\\.php).*" ], "redirections": [], "forceRedirection": false diff --git a/manifest.json b/manifest.json index ab7a4d6..4e1b492 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "ClearURLs", - "version": "1.8.4", + "version": "1.8.5", "author": "Kevin Röbert", "description": "Remove tracking elements from URLs.", "homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",