Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2024
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Allegro - wyłączenie grupowania ofert
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @author ChatGPT
  6. // @description Dodaje ?description=1 lub &description=1 do URL
  7. // @match https://allegro.pl/kategoria/*
  8. // @match https://allegro.pl/listing?string=*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Get the current URL
  16. const currentUrl = window.location.href;
  17.  
  18. // Check if the URL already has the parameter
  19. const hasDescription = currentUrl.includes('description=1');
  20.  
  21. if (!hasDescription) {
  22. let newUrl;
  23.  
  24. if (currentUrl.includes('?')) {
  25. // If the URL already has query parameters, append &description=1
  26. newUrl = `${currentUrl}&description=1`;
  27. } else {
  28. // Otherwise, add ?description=1
  29. newUrl = `${currentUrl}?description=1`;
  30. }
  31.  
  32. // Redirect to the new URL
  33. window.location.href = newUrl;
  34. }
  35. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement