Improve Image Rendering

""

目前為 2018-11-07 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Improve Image Rendering
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description ""
  6. // @author Eva1ent
  7. // @match *
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. ;(function() {
  12. 'use strict'
  13. function addCssByStyle(cssString) {
  14. var doc = document
  15. var style = doc.createElement('style')
  16. style.setAttribute('type', 'text/css')
  17.  
  18. if (style.styleSheet) {
  19. // IE
  20. style.styleSheet.cssText = cssString
  21. } else {
  22. // w3c
  23. var cssText = doc.createTextNode(cssString)
  24. style.appendChild(cssText)
  25. }
  26.  
  27. var heads = doc.getElementsByTagName('head')
  28. if (heads.length) heads[0].appendChild(style)
  29. else doc.documentElement.appendChild(style)
  30. }
  31. addCssByStyle('html {image-rendering: crisp-edges;image-rendering: -webkit-optimize-contrast;}')
  32. })()