Auto Redirect MSDN

Auto redirects Windows Desktop MSDN articles to the proper MSDN article, since they have links to related functions and the default page doesn't have them

  1. // ==UserScript==
  2. // @name Auto Redirect MSDN
  3. // @namespace http://www.dwedit.org/
  4. // @description Auto redirects Windows Desktop MSDN articles to the proper MSDN article, since they have links to related functions and the default page doesn't have them
  5. // @include https://msdn.microsoft.com/en-us/library/windows/desktop/*.aspx
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. var element = document.getElementById("topicNotInScopeCollectionPicker");
  11. if (element !== undefined)
  12. {
  13. var links = element.getElementsByTagName("a");
  14. if (links !== undefined)
  15. {
  16. var lastIndex = links.length - 1;
  17. var lastLink = links[lastIndex];
  18. if (lastLink !== undefined)
  19. {
  20. var url = lastLink.href;
  21. document.location.replace(url);
  22. }
  23. }
  24. }