Add red border to yd-translate-container

让有道翻译更好看

  1. // ==UserScript==
  2. // @name Add red border to yd-translate-container
  3. // @version 0.1
  4. // @description 让有道翻译更好看
  5. // @author Augury
  6. // @match *://*/*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/944879
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13. var css = ".yd-wrapper-block{border: solid #ffaaaa;background-color:#ffeeee;border-radius: 5px;}";
  14. if (typeof GM_addStyle != "undefined") {
  15. GM_addStyle(css);
  16. } else if (typeof PRO_addStyle != "undefined") {
  17. PRO_addStyle(css);
  18. } else if (typeof addStyle != "undefined") {
  19. addStyle(css);
  20. } else {
  21. var node = document.createElement("style");
  22. node.type = "text/css";
  23. node.appendChild(document.createTextNode(css));
  24. var heads = document.getElementsByTagName("head");
  25. if (heads.length > 0) {
  26. heads[0].appendChild(node);
  27. } else {
  28. // no head yet, stick it whereever
  29. document.documentElement.appendChild(node);
  30. }
  31. }
  32. })();