Instructables AllSteps Single Page View

Automatically redirect to the ALL Steps page on Instructables, if not already there.

目前为 2014-05-30 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Instructables AllSteps Single Page View
  3. // @namespace https://greasyfork.org/users/2329-killerbadger
  4. // @version 0.1
  5. // @description Automatically redirect to the ALL Steps page on Instructables, if not already there.
  6. // @match http*://*instructables.com/id/*
  7. // ==/UserScript==
  8. //Based upon New York Times Single Page View by Fat Knowledge - http://userscripts.org/scripts/show/15601
  9.  
  10. // Get the current window location
  11. var curLoc = window.location.href;
  12. // Get the html text
  13. //var bodyText = document.body.textContent;
  14. //Not needed for this application
  15.  
  16. // ------------------------------------------------------------------------
  17. // Redirect to single page view if option inot already selected
  18. // ------------------------------------------------------------------------
  19. if (curLoc.indexOf("id") != -1 && curLoc.indexOf("ALLSTEPS") == -1) {
  20. if (curLoc.indexOf("?")!=-1){
  21. var newLoc = curLoc+'&ALLSTEPS';
  22. } else {
  23. var newLoc = curLoc+'?ALLSTEPS';
  24. }
  25. window.location.replace(newLoc);
  26. } else {
  27. /* Do Nothing */
  28. }