Allegro Alert

Wyświetla alert/powiadomienie przed dokonaniem zakupu w serwisie Allegro.pl

  1. // ==UserScript==
  2. // @name Allegro Alert
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-10-24
  5. // @description Wyświetla alert/powiadomienie przed dokonaniem zakupu w serwisie Allegro.pl
  6. // @author JustGreg
  7. // @match https://allegro.pl/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=allegro.pl
  9. // @grant none
  10. // @license GNU GPLv3
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var alertText = "Tekst powiadomienia"
  17.  
  18. function sendAlert () {
  19. alert(alertText);
  20. }
  21.  
  22. (new MutationObserver(check)).observe(document, {childList: true, subtree: true});
  23.  
  24. function check(changes, observer) {
  25. if(document.querySelector('[id^=buy-and-pay-form]')) {
  26. //observer.disconnect();
  27. sendAlert();
  28. }
  29. }
  30.  
  31. if(document.URL.includes("https://allegro.pl/transakcja")) {
  32. sendAlert();
  33. }
  34. })();