Greasy Fork镜像 还支持 简体中文。

Create Hyperlinks

Wraps text links with <a> tags when not recognized by Chrome.

  1. // ==UserScript==
  2. // @name Create Hyperlinks
  3. // @namespace http://haiku-systems.com/
  4. // @version 0.1
  5. // @description Wraps text links with <a> tags when not recognized by Chrome.
  6. // @author Haiku Systems LLC
  7. // @match *
  8. // @grant none
  9. // @require http://code.jquery.com/jquery-3.3.1.min.js
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. $(document).on('DOMSubtreeModified', function () {
  16. // Are we already doing this?
  17. if ($(this).data('hsLock')) return;
  18.  
  19. // Lock the process.
  20. $(this).data('hsLock', true);
  21.  
  22. // Do a global search/replace in <body>.
  23. $("body").html($("body").html().replace(/\b\w+:\/\/\/\S+(?!["'])/ig, '<a href="$&">$&</a>'));
  24.  
  25. // Unlock the process.
  26. $(this).data('hsLock', false);
  27. });
  28. })();

QingJ © 2025

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