Bing Image Direct Link Patch

Make search result entries' image dimension information as link which points to the direct image resource.

  1. // ==UserScript==
  2. // @name Bing Image Direct Link Patch
  3. // @namespace BingImageDirectLinkPatch
  4. // @version 1.2.4
  5. // @license AGPLv3
  6. // @author jcunews
  7. // @description Make search result entries' image dimension information as link which points to the direct image resource.
  8. // @website https://gf.qytechs.cn/en/users/85671-jcunews
  9. // @include https://www.bing.com/images/search*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (() => {
  14. addEventListener("mouseenter", (ev, a, b, c, z) => {
  15. if (ev.target.matches(".imgpt:not(.linked_bidlp)") && (a = ev.target.querySelector(".img_info>span")) && (b = ev.target.querySelector(".iusc"))) {
  16. ev.target.classList.add("linked_bidlp");
  17. (c = document.createElement("A")).textContent = a.textContent;
  18. c.className = a.className;
  19. c.style.cssText = a.style.cssText;
  20. c.rel = "nofollow noopener noreferrer";
  21. try {
  22. if (!(c.href = JSON.parse(b.getAttribute("m")).murl)) throw 0;
  23. } catch(z) {
  24. c.href = 'javascript.void("Error getting image URL")';
  25. }
  26. a.parentNode.replaceChild(c, a);
  27. }
  28. }, true);
  29. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址