导航栏: 首页 评论列表

Chrome User JavaScript and CSS

默认分类 2021/01/10 02:40

User JavaScript and CSS: https://chrome.google.com/webstore/detail/nbhcbdghjpllgmfilhnhkllmkecfmpld

示例如下:

var cssText = [
  '#con-ar{display:none!important}'
].join('')

function doInject () {
  var id = 'custom-inject-style'
  if (document.getElementById(id)) return ''
  var style = document.createElement('style')
  style.id = id
  style.setAttribute('type', 'text/css')

  var head = document.head || document.body || document.documentElement;
  if (head.lastChild) head.insertBefore(style, head.lastChild)
  else head.appendChild(style)

  if (style.styleSheet) style.styleSheet.cssText = cssText
  else style.appendChild(document.createTextNode(cssText))
}
function handleInject () {
  window.requestAnimationFrame(handleInject)
  doInject()
}
handleInject()


>> 留言评论