Git Product home page Git Product logo

Comments (8)

bgrins avatar bgrins commented on August 20, 2024

Thanks! I will add screenshots for the snippets. I had a few ideas for other bookmarklet type of features off the top of my head (just putting here for reference, may add others later too):

  • Allow drawing of simple shapes (like arrows or circles using SVG) on top of current page. Could be handy for taking screenshots and trying to draw attention to a particular element or for pointing to an element in a presentation.
  • Click on any element to log out the closest URL + anchor. Sometimes you want to share a link to a particular element on the page, but don't know what the most relevant one would be. By clicking on an element you might get a URL like: #3 (comment).
  • Lint / validate HTML, CSS, or JS.

from devtools-snippets.

bgrins avatar bgrins commented on August 20, 2024

Went ahead and added some screenshots for setting up / using snippets in Chrome and Firefox Scratchpad in the README: https://github.com/bgrins/devtools-snippets.

@addyosmani do you have any idea on the timeline for enabling snippets as a non-experimental feature? It is awesome! I do wish there was an easy way to import / export snippets to share across different computers or developers.

from devtools-snippets.

addyosmani avatar addyosmani commented on August 20, 2024

Snippets came out of experiments in Canary a while ago so its just a matter of time before it's available in stable. We don't currently have a way to export snippets that easily but you can Save them to disk and share that way. I personally use GistBox to manage the snippets I use across systems. Makes it easy to label and keep track of them.

from devtools-snippets.

jcumminsr1 avatar jcumminsr1 commented on August 20, 2024

Perhaps this is tangential to the original issue, but since @addyosmani is here and you're talking snippets, I'll throw this out there. I would absolutely love to see snippets rolled into Chrome sync and/or to have a way to quick upload them to a gist for sharing with coworkers for one off updates. The more I use snippets, the more I am paranoid about loosing them in the event of problem with my system.

from devtools-snippets.

bgrins avatar bgrins commented on August 20, 2024

@jcumminsr1 I agree completely! I think snippets will become pretty widely used as developers start to see them, and it should be easy to import/export/sync changes. I just wrote a post about snippets, and under the heading "More Functionality" I talk about some options for import/export: http://www.briangrinstead.com/blog/devtools-snippets.

I'd like to see an import from URL feature, because those could be shared even across browsers (if FF and Chrome both implemented it). Then you could paste in a list of links like:

https://raw.github.com/bgrins/devtools-snippets/master/snippets/performance.js
https://raw.github.com/bgrins/devtools-snippets/master/snippets/log.js
https://raw.github.com/bgrins/devtools-snippets/master/snippets/base64.js

and it would create new snippets called performance.js, log.js, base64.js. That doesn't really handle the syncing of changes, but it would be pretty easy for sharing snippets across systems.

from devtools-snippets.

jcumminsr1 avatar jcumminsr1 commented on August 20, 2024

@bgrins Great post. I like the idea of being able to capture the client side JS in order to make large scale persistent changes that could be used across pages / domains. When I get some time I'd love to dig into exactly how the snippets are stored in Chrome (plaintext / compressed / in a db). Do you know off the top of your head?

from devtools-snippets.

bgrins avatar bgrins commented on August 20, 2024

@jcumminsr1 the best I can tell, it is inside of SnippetStorage.js, which seems to store them using a WebInspector.Settings.createSetting. I'm really not sure how those are being persisted, but it seems like it may be the same way that it stores your selections from the settings page in devtools (like Disable Cache and whatnot) - so definitely local to the browser instance. I'm not sure if these are persisted to a file somewhere or not though, but it certainly won't be stored as individual js files.

from devtools-snippets.

bgrins avatar bgrins commented on August 20, 2024

Thanks for all the pointers. I have expanded the snippets collection, taken a bunch of screenshots, and updated the documentation site. I recently updated the project site here: http://bgrins.github.io/devtools-snippets/ with some styling, and so that it doesn't use http://gist-it.appspot.com (document.writes to embed) anymore and instead directly embeds the highlighted code snippets using the pygments command on build.

from devtools-snippets.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.