Prevent Wikia Ads

Prevent the ads that pop up when clicking a link to an external page on Wikias

当前为 2016-08-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Prevent Wikia Ads
  3. // @namespace https://greasyfork.org/users/649
  4. // @version 1.0
  5. // @description Prevent the ads that pop up when clicking a link to an external page on Wikias
  6. // @author Adrien Pyke
  7. // @match *://*.wikia.com/*
  8. // @require https://greasyfork.org/scripts/5679-wait-for-elements/code/Wait%20For%20Elements.js?version=122976
  9. // @grant GM_openInTab
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. waitForElems('a.exitstitial', function(link) {
  16. link.onclick = function(e) {
  17. e.preventDefault();
  18. e.stopImmediatePropagation();
  19. if (e.button === 1) {
  20. GM_openInTab(link.href, true);
  21. } else {
  22. location.href = link.href;
  23. }
  24. return false;
  25. };
  26. });
  27. })();