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

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

  •  
  •   unizheng · Mar 6, 2019 · 4143 views
    This topic created in 2625 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
        1
    quietjosen  
       Mar 6, 2019 via iPhone
    截图展示啥的,还是要的。
    MyFaith
        2
    MyFaith  
       Mar 6, 2019
    iframe 内无效
    solobat
        3
    solobat  
       Mar 6, 2019
    如果只是这个功能的话,用油猴脚本就行了
    HFX3389
        4
    HFX3389  
       Mar 6, 2019
    @solobat #3 哪个脚本,大佬给个地址
    journey0ad
        5
    journey0ad  
       Mar 6, 2019
    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
        6
    rabbbit  
       Mar 6, 2019
    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
        7
    mengkun  
       Mar 7, 2019
    javascript: [].forEach.call($("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
    unizheng
        8
    unizheng  
    OP
       Mar 7, 2019
    @mengkun 就是这段脚本的封装 :)
    unizheng
        9
    unizheng  
    OP
       Mar 7, 2019
    @MyFaith 妈蛋 没想到
    Baymaxbowen
        10
    Baymaxbowen  
       Mar 7, 2019 via Android
    控制台会报错
    unizheng
        11
    unizheng  
    OP
       Mar 7, 2019
    @MyFaith 修复掉了 请等 0.0.3 版本。Chrome 商店正在审核。
    unizheng
        12
    unizheng  
    OP
       Mar 7, 2019
    @Baymaxbowen 请问报什么错呢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1200 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 23:35 · PVG 07:35 · LAX 16:35 · JFK 19:35
    ♥ Do have faith in what you're doing.