Remove redirection tracking from Qwant Lite

A script that removes redirection tracking from Qwant Lite.

  1. // ==UserScript==
  2. // @name Remove redirection tracking from Qwant Lite
  3. // @namespace StephenP
  4. // @version 1.1
  5. // @description A script that removes redirection tracking from Qwant Lite.
  6. // @author StephenP
  7. // @grant none
  8. // @include https://lite.qwant.com/?q=*
  9. // @include https://lite.qwant.com/?*&q=*
  10. // ==/UserScript==
  11. var results=document.body.getElementsByClassName("title");
  12. if(results.length==0){
  13. results=document.body.getElementsByClassName("result-image");
  14. }
  15. if(results.length==0){
  16. results=document.body.getElementsByClassName("result-video");
  17. }
  18. if(results.length==0){
  19. results=document.body.getElementsByClassName("result--with-image");
  20. }
  21. var link;
  22. for(var i=0;i<results.length;i++){
  23. link=decodeURIComponent(results[i].children[0].href);
  24. if(link.includes("lite.qwant.com/")){
  25. results[i].children[0].href=decodeURIComponent(results[i].children[0].href).slice(link.lastIndexOf("=/")+2);
  26. }
  27. }