Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chromeデベロッパーツールを自分色に染める

 Chromeデベロッパーツールを自分色に染める

[links]
We Are JavaScripters!@10th
https://wajs.connpass.com/event/63502/

Vue.js devtools
https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=ja

Chrome DevTools概念図
https://developer.chrome.com/extensions/devtools

jumtech/web_tool_detector | GitHub
https://github.com/jumtech/web_tool_detector

Chromeデベロッパーツールに独自機能を追加する6つのステップ | PLAID engineer blog
http://tech.plaid.co.jp/extending_chrome_devtools/

ep.22 楽しいChromeHack | しがないラジオ
https://shiganai.org/ep/ep22-chromehack

sp.4a 【ゲスト: ta__miyan】楽しいセブ島エンジニア留学 | しがないラジオ
https://shiganai.org/ep/sp4a-tami

jumpei_ikegami

August 25, 2017
Tweet

More Decks by jumpei_ikegami

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w !KVNQFJ@JLFHBNJ w ݩ$0#0-FS!෋࢜௨ w גࣜձࣾϓϨΠυ$9&OHJOFFS w /PEFKT 7VFKT

    w ϙουΩϟελʔʢʮ͕͠ͳ͍ϥδΦʯύʔιφϦςΟʣ w ޷͖ͳϒΩ͸ɺʮϓϩϞσϥʔ.(ʯ
  2. ࣗݾ঺հ w !KVNQFJ@JLFHBNJ w ݩ$0#0-FS!෋࢜௨ w גࣜձࣾϓϨΠυ$9&OHJOFFS w /PEFKT 7VFKT

    w ϙουΩϟελʔʢʮ͕͠ͳ͍ϥδΦʯύʔιφϦςΟʣ w ޷͖ͳϒΩ͸ɺʮϓϩϞσϥʔ.(ʯ
  3. #BDLHSPVOEQBHF $POUFOUTDSJQUT %FWUPPMTQBHF 1BOFM 1BOFM ɾɾɾ w%FW5PPMT"1*ʹΞΫηεͰ͖Δ ʢ/FUXPSLΛ؂ࢹͨ͠Γʣ w1BOFM λϒ

    Λෳ਺΋ͭ ࢀߟIUUQTEFWFMPQFSDISPNFDPNFYUFOTJPOTEFWUPPMT $ISPNF֦ுͷ֓೦ਤ
  4. ࠷খϑΝΠϧߏ੒  NBOJGFTUKTPO  EFWUPPMTIUNM  EFWUPPMTKT  QBOFMIUNM 

    QBOFMKT  QBOFMDTT { "name": "Web Tools Detector", "manifest_version": 2, "version": "1", “devtools_page": "devtools.html" } w $ISPNF֦ுͱͯ͠ͷઃఆΛهड़ w EFWUPPMTIUNMΛΤϯτϦʔϙΠϯτʹࢦఆ
  5. ࠷খϑΝΠϧߏ੒  NBOJGFTUKTPO  EFWUPPMTIUNM  EFWUPPMTKT  QBOFMIUNM 

    QBOFMKT  QBOFMDTT <!DOCTYPE html> <html> <head> <script src="./devtools.js"></script> </head> <body> </body> </html> w EFWUPPMTKTΛಡΈࠐΉ chrome.devtools.panels.create( “WebTools", // Tab Title "", "./panel.html", (panel) => {} ); w QBOFMIUNMΛ౉ͯ͠ɺ1BOFMΛੜ੒
  6. ࠷খϑΝΠϧߏ੒  NBOJGFTUKTPO  EFWUPPMTIUNM  EFWUPPMTKT  QBOFMIUNM 

    QBOFMKT  QBOFMDTT <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link rel=“stylesheet" href=“./panel.css“> </head> <body> <h1>Web Tools Detactor</h1> <script src="./panel.js"></script> </body> </html> w 1BOFM಺ͷදࣔΛ)5.-Ͱهड़ w QBOFMKTΛಡΈࠐΉ w QBOFMDTTΛಡΈࠐΉ
  7. ͓΋ΉΖʹ7VFKTΛಋೖ  7VFͷ$41ରԠ൛Λ%- ͠ɺσΟϨΫτϦ಺ʹ഑ ஔ  QBOFMIUNM಺ͰTDSJQUλ άΛ͔ͭͬͯಡΈࠐΉ  QBOFMKT಺Ͱ7VFΠϯε

    λϯεΛੜ੒ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src=“./vendor/vue.js"></script> </head> <body> <div id="container"> <h1>{{msg}}</h1> </div> <script src=“./panel.js"></script> </body> </html> new Vue({ el: "#container", data: { msg: “hoge” }, created: function() { /* ॳظॲཧ */ }, methods: { /* ϝιου */ } });
  8. ϦΫΤετΛ؂ࢹ  7VFͷDSFBUFEͷதͰɺ$ISPNF͕ఏڙ͢Δ PO3FRVFTU'JOJTIFEΠϕϯτʹΠϕϯτϦεφΛొ࿥  ಛఆͷ৚݅ʹ߹க͢ΔϦΫΤετ͕͋ͬͨΒԿ͔͢Δ … created: function() {

    chrome.devtools.network.onRequestFinished.addListener((req) => { const url = req.request.url; if (url.indexOf("google-analytics.com") !== -1) { this.msg = "͜ͷαΠτ͔ΒɺGoogleAnalyticsͷ߳Γ͕͢ΔͰήι"; } }); }, …
  9. એ఻ w ຊ೔ͷιʔείʔυ͸ͪ͜Β w KVNUFDIXFC@UPPM@EFUFDUPSc(JU)VC w ձࣾͷΤϯδχΞϒϩάͰಉ͡ωλΛॻ͍ͯ·͢ w $ISPNFσϕϩούʔπʔϧʹಠࣗػೳΛ௥Ճ͢Δͭͷεςο ϓc1-"*%FOHJOFFSCMPH

    w ϙουΩϟετͰ΋࿩ͯ͠·͢ w FQָ͍͠$ISPNF)BDLc͕͠ͳ͍ϥδΦ w 8F+4ओ࠵ͷUBNJ͞ΜήετճϙουΩϟετ΋͋Γ·͢ w TQBʲήετUB@@NJZBOʳָ͍͠ηϒౡΤϯδχΞཹֶc ͕͠ͳ͍ϥδΦ