_Mediapart, ensure that full page reading is enabled

a script to force mediapart articles to be displayed in full page instead of having pagination

  1. // ==UserScript==
  2. // @name _Mediapart, ensure that full page reading is enabled
  3. // @match *://*.mediapart.fr/*
  4. // @run-at document-start
  5. // @grant none
  6. // @description a script to force mediapart articles to be displayed in full page instead of having pagination
  7. // @version 0.0.1.20171110122150
  8. // @namespace https://greasyfork.org/users/158718
  9. // ==/UserScript==
  10.  
  11. var UrlPathToUse = window.location.pathname;
  12. var oldUrlPath = window.location.href;
  13.  
  14. /*--- Test that "onglet=full" is at end of URL*/
  15.  
  16. if ( ! /onglet=full$/.test(oldUrlPath) ) {
  17.  
  18.  
  19. var newURL = window.location.protocol + "//"
  20. + window.location.host
  21. + UrlPathToUse + "?onglet=full"
  22. + window.location.hash
  23. ;
  24. /*-- replace() puts the good page in the history instead of the
  25. bad page.
  26. */
  27. window.location.replace (newURL);
  28. }