Remove doubleclick tracking

Use original links instead of "ad.doubleclick.net" links in the Google Search means a little less tracking!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Remove doubleclick tracking
// @description Use original links instead of "ad.doubleclick.net" links in the Google Search means a little less tracking!
// @namespace Violentmonkey Scripts
// @match https://www.google.com/search
// @grant none
// @version 0.0.1.20190521130657
// ==/UserScript==

  var oldOnload = window.onload;

  window.onload = function () {

      if (typeof oldOnload == 'function') {
        oldOnload();
      }

      var adClickElements = document.getElementsByClassName('pla-unit-container');
      var text = '';
      var i;
    
      text += 'Items to fix: ';
      text += adClickElements.length - 1;
      text += '\n'
    
      for (i = 0; i < adClickElements.length - 1; i++) {
        text += 'URL \'' + adClickElements[i].removeChild(adClickElements[i].childNodes[0]) + '\' removed. \n';
      }
    
      text += 'Done, enjoy Google Search with a little less tracking! :-)';

      console.log(text);
  }