Change Aliexpres Favicon to the old one

Changes the favicon of Aliexpress to a custom image

  1. // ==UserScript==
  2. // @name Change Aliexpres Favicon to the old one
  3. // @description Changes the favicon of Aliexpress to a custom image
  4. // @match https://www.aliexpress.us/*
  5. // @grant none
  6. // @license MIT
  7. // @namespace eihfdiskfh
  8. // @version 0.0.1.20230702201941
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // URL of the new favicon image
  15. var newFaviconUrl = 'https://www.aliexpress.com/favicon.ico';
  16.  
  17. // Create a new favicon element
  18. var newFavicon = document.createElement('link');
  19. newFavicon.rel = 'icon';
  20. newFavicon.type = 'image/png';
  21. newFavicon.href = newFaviconUrl;
  22.  
  23. // Remove the existing favicon element
  24. var existingFavicon = document.querySelector('link[rel="icon"]');
  25. if (existingFavicon) {
  26. existingFavicon.parentNode.removeChild(existingFavicon);
  27. }
  28.  
  29. // Append the new favicon element to the document head
  30. document.head.appendChild(newFavicon);
  31. })();