andrewdavey / immutable-devtools

Chrome Dev Tools custom formatter for Immutable-js values
BSD 3-Clause "New" or "Revised" License
661 stars 29 forks source link

Idea: Add a bookmarklet? #4

Closed Daniel15 closed 8 years ago

Daniel15 commented 8 years ago

It would be handy to have this as a bookmarklet, so I could instantly inject it into a page that uses immutable-js without having to edit the site's code to pull this library in. Would that be possible? It looks like the formatter just needs to be added to the window.devtoolsFormatters array in the page's context. I guess the hard bit would be actually getting the reference to Immutable-js - It could probably assume there's either an Immutable global (eg. using immutable-js from CDN), or require('immutable') pulls it in (on some sites with CommonJS requires, eg. on Facebook).

andrewdavey commented 8 years ago

Yes it's possible. But as you said though, reliably getting a reference to Immutable is tricky.

langpavel commented 8 years ago

blocked by #20

Daniel15 commented 8 years ago

@mattzeunert's extension (https://chrome.google.com/webstore/detail/immutablejs-object-format/hgldghadipiblonfkkicmgcbbijnpeog) works pretty well, closing this out.