Dropbox convert to direct link

Removes www and change https to http and dl=0 to dl=1

  1. // ==UserScript==
  2. // @name Dropbox convert to direct link
  3. // @namespace http://greasyfork.org/de/users/7597
  4. // @version 0.1
  5. // @description Removes www and change https to http and dl=0 to dl=1
  6. // @author Djamana
  7. // @match *://*.dropbox.com/*
  8. // @-match *://*.dropbox.com/sm/share_link/*
  9. // @grant none
  10. // @icon https://cf.dropboxstatic.com/static/images/icons/blue_dropbox_glyph-vflJ8-C5d.png
  11. // ==/UserScript==
  12.  
  13.  
  14. function applyBeautifyDirectlink () {
  15. // Get
  16. var El = document.querySelector('.text-input-input[value]')
  17. if (El) {
  18.  
  19.  
  20. // Transform
  21. var ElVal = El.value
  22. var NewVal = ElVal.replace(/(http)s?(:\/\/)www\.(.*dl=)0/, "$1$2$31")
  23. if (ElVal != NewVal) {
  24. // Set
  25. El.value = NewVal
  26. }
  27. }
  28.  
  29. //var El = document.querySelector('.text-input-input[value]');El.value = El.value.replace(/(http)s?(:\/\/)www\.(.*dl=)0/, "$1$2$31")
  30. }
  31. setInterval (applyBeautifyDirectlink, 1000)