Emulate Google Analytics on gitignore.io

Fix gitignore.io not working with ADBlock enabled

  1. // ==UserScript==
  2. // @name Emulate Google Analytics on gitignore.io
  3. // @namespace https://rabit.pw/
  4. // @version 0.1
  5. // @description Fix gitignore.io not working with ADBlock enabled
  6. // @author ttimasdf
  7. // @license GPLv3
  8. // @match https://www.toptal.com/*
  9. // @match https://gitignore.io/*
  10. // @icon https://icons.duckduckgo.com/ip2/toptal.com.ico
  11. // @grant unsafeWindow
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. unsafeWindow.gtag = (event, ...args) => {
  18. var cb = args[1].event_callback;
  19. if (typeof cb === "function") {
  20. cb();
  21. }
  22. console.log(event, ...args);
  23. };
  24. })();