KrustyHack jQuery Hightlight Nofollow

simply highlight nofollow links on a page with jQuery

  1. // ==UserScript==
  2. // @name KrustyHack jQuery Hightlight Nofollow
  3. // @namespace http://www.nicolashug.com
  4. // @version 0.1
  5. // @description simply highlight nofollow links on a page with jQuery
  6. // @match *://*/*
  7. // @copyright 2014+, KrustyHack
  8. // ==/UserScript==
  9.  
  10. function getScript(url, success) {
  11. var script = document.createElement('script');
  12. script.src = url;
  13. var head = document.getElementsByTagName('head')[0],
  14. done = false;
  15. // Attach handlers for all browsers
  16. script.onload = script.onreadystatechange = function() {
  17. if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
  18. done = true;
  19. // callback function provided as param
  20. success();
  21. script.onload = script.onreadystatechange = null;
  22. head.removeChild(script);
  23. };
  24. };
  25. head.appendChild(script);
  26. };
  27. getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', function() {
  28. if (typeof jQuery == 'undefined') {
  29. console.log("NojQuery at all... :(");
  30. } else {
  31. // jQuery loaded! Make sure to use .noConflict just in case
  32. console.log("jQuery loaded");
  33. jQuery.noConflict();
  34. jQuery(document).ready(function($) {
  35. $("a[rel='nofollow']").css({
  36. "background-color": "red",
  37. "color": "white"
  38. });
  39. });
  40. }
  41. });

QingJ © 2025

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