爱意满满的作品展示区。
unizheng

「Keylines」一个 Chrome 插件,辅助前端页面开发,随机颜色显示 DOM 边界。

  •  
  •   unizheng · Mar 6, 2019 · 4543 views
    This topic created in 2831 days ago, the information mentioned may be changed or developed.
    Supplement 1  ·  Mar 7, 2019
    其实就是某楼层回复的那段代码的封装,当然 还包括 监听 dom 增减而自动刷新的功能,否则页面交互时新增加的 dom 是不会自动添加颜色边界的。
    12 replies  •  2019-03-07 09:35:52 +08:00
    quietjosen
    quietjosen
    Mar 6, 2019 via iPhone
    1
    截图展示啥的,还是要的。
    MyFaith
    MyFaith
    Mar 6, 2019
    2
    iframe 内无效
    solobat
    solobat
    Mar 6, 2019
    3
    如果只是这个功能的话,用油猴脚本就行了
    HFX3389
    HFX3389
    Mar 6, 2019
    4
    @solobat #3 哪个脚本,大佬给个地址
    journey0ad
    journey0ad
    Mar 6, 2019
    5
    javascript:!document.querySelector('style#ghost')&&(document.body.innerHTML+='<style id="ghost">html.ghost *{background:#000 !important;color:#0f0 !important;outline:solid #f00 1px !important;}</style>');document.documentElement.classList.toggle('ghost');

    加为书签
    rabbbit
    rabbbit
    Mar 6, 2019
    6
    javascript:const getRandomColor =() => { let letters = '0123456789ABCDEF';let color = '#';for (let i = 0; i < 6; i++) {color += letters[Math.floor(Math.random() * 16)];}return color;};Array.from(document.all).forEach(el => el.style.outline = `1px solid ${getRandomColor()}`)
    mengkun
    mengkun
    Mar 7, 2019
    7
    javascript: [].forEach.call($("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
    unizheng
    unizheng
    OP
    Mar 7, 2019
    8
    @mengkun 就是这段脚本的封装 :)
    unizheng
    unizheng
    OP
    Mar 7, 2019
    9
    @MyFaith 妈蛋 没想到
    Yishanshan
    Yishanshan
    Mar 7, 2019 via Android
    10
    控制台会报错
    unizheng
    unizheng
    OP
    Mar 7, 2019
    11
    @MyFaith 修复掉了 请等 0.0.3 版本。Chrome 商店正在审核。
    unizheng
    unizheng
    OP
    Mar 7, 2019
    12
    @Baymaxbowen 请问报什么错呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   905 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 21:06 · PVG 05:06 · LAX 13:06 · JFK 16:06
    ♥ Do have faith in what you're doing.