Mobile Result Page Cleanup

This script filters highlighted (advertised) offers in mobile.de result pages and sorts them ascending by price.

目前为 2018-03-05 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Mobile Result Page Cleanup
  3. // @namespace s
  4. // @include https://suchen.mobile.de/fahrzeuge/search.html*
  5. // @version 1.1
  6. // @grant none
  7. // @description This script filters highlighted (advertised) offers in mobile.de result pages and sorts them ascending by price.
  8. // ==/UserScript==
  9.  
  10. window.onload = function () {
  11. var divs = document.querySelectorAll('div.cBox-body--similarSellerAds, div.cBox-body--topInCategory, div.cBox-body--topResultitem, div.cBox-body--eyeCatcher');
  12. for(var i=0; i<divs.length; i++) {
  13. divs[i].style.display = "none";
  14. //divs[i].style.opacity = "0.1";
  15. }
  16. var sel = document.getElementById('so-sb');
  17.  
  18. var needs_reload = sel.options[sel.selectedIndex].text != 'Preis aufsteigend';
  19. // fire form
  20. if(needs_reload){
  21. var l = sel.options.length;
  22. for (var i = 0; i < l; i++) {
  23. if (sel.options[i].text == 'Preis aufsteigend') {
  24. sel.options[i].selected = true;
  25. sel.onChange();
  26. }
  27. }
  28. }
  29. }