Prevent Wikia Ads

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

当前为 2016-12-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Prevent Wikia Ads
  3. // @namespace https://greasyfork.org/users/649
  4. // @version 1.0.1
  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 none
  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 === 0) {
  20. location.href = link.href;
  21. }
  22. return false;
  23. };
  24. });
  25. })();