Forbes - Skip Welcome Screen

Skips the welcome screen; The one with the "Thought of the Day" and the full page ad. Pretty much simulates clicking the link, "Skip this welcome screen", as soon as the welcome screen loads.

  1. // ==UserScript==
  2. // @name Forbes - Skip Welcome Screen
  3. // @namespace https://greasyfork.org/en/users/136288-benjamin-landry
  4. // @description Skips the welcome screen; The one with the "Thought of the Day" and the full page ad. Pretty much simulates clicking the link, "Skip this welcome screen", as soon as the welcome screen loads.
  5. // @author KillerBadger, updated by benjamin238
  6. // @version 1.0 : 27-Jun-2017
  7. // @include https://www.forbes.com/forbes/welcome/*
  8. // ==/UserScript==
  9. /*
  10.  
  11. History
  12. -------------
  13. 1.0 : 27-Jun-2017 Changed http:// to https:// for new forbes welcome page.
  14. 0.05 : 15-Sep-2016 Updated to new redirect page.
  15. 0.04 : 05-Oct-2015 Added setTimeout to click, in case the script runs too early.
  16. 0.03 : 12-Oct-2014 Changed script to work
  17. 0.02 : 24-Sep-2008 Added @namespace
  18. 0.01 : 03-Jul-2008 Initial release
  19. ============
  20.  
  21. Known Issues
  22. -------------
  23. Fanboy's Enhanced Tracking List breaks the Forbes welcome page.
  24. Users of that list should add the following exceptionrule (ABP Options > Add your own filters):
  25. @@||images.forbes.com/scripts/omniture/*
  26. ============
  27. */
  28. url = document.URL;
  29. newURL = extractURL(url,"toURL=","&refURL");
  30. redirect(newURL);
  31.  
  32. function redirect(nLoc) {
  33. document.title = 'Redirecting...';
  34. window.location.replace(nLoc);
  35. }
  36. function extractURL(rawElement, startString, endString) {
  37. b = String(rawElement);
  38. newLoc = b.substring(b.indexOf(startString)+startString.length,b.indexOf(endString));
  39. return newLoc;
  40. }