Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.34 KB

07-004.md

File metadata and controls

28 lines (17 loc) · 1.34 KB
date
Mon Aug 07 2017 15:38:36 GMT+1000 (AEST)

learning about electron & chrome remote debugger

  • trying to use chrome-remote-interface to dynamically update js source at runtime, following example here: https://github.com/cabul/electron-hot/blob/master/lib/index.js

  • I can see the script ID, it appears to be the same each time I run (although I do expect it will change at some point in future)

  • calling client.Debugger.setScriptSource

    • seems to be firing the error callback with an arg of true
    • ahh ok looks like scriptId needs to be a string, not an int
  • found this example here too: https://gist.github.com/paulirish/920a260cadfe05e8388c

  • getScriptSource is working, not seeing any change after calling setScriptSource though

  • but if I call getScriptSource a second time, I do see the new source. So it was set, it just didn't do anything in the browser window

  • one big roadblock here: as soon as I open the debugger console in the electron BrowserWindow, my remote debugger websocket requests all fail

  • at some point I'll try to make a small demo showing this stuff.

  • there seems to be some aggressive caching of <script> js files when loaded via a local node http server...

    • adding ?v=... busts the cache