• Latest:
    1. Authorize REST call in Jscript
    2. Approval Process for external users – Power Automate
    3. Power Automate – Tips and Tricks
  • +45 26 246 341 +91 22 4129 6111
  • engage@kalpavruksh.com
  • Home
  • Services
    • Product Development
    • Technology Consulting
    • Agentic AI & AI/ML Automation
  • Dynamics 365 CoE
  • Blog
  • Careers
  • Company
    • About Us
    • Contact Us
10th August, 2019
  • Category: Others
  • Comments: 0

Devtools Code Snippets and its benefit

  1. Snippet:

    • Snippets are small scripting feature that allows you to execute within the sources panel of Chrome Developer tools.
    • It executes from the context of the currently opened page.
    • Can access and run them from any page.
    • Firefox has scratchpad editor and Chrome has snippets feature for this.
  2. How to run snippet: (There are three ways to run your snippet)
    • Right-click on the snippet filename from the left side snippet list and select Run.
    • Click the Run button. 
    • Press Command + Enter (For Mac) or Ctrl + Enter (For Windows, Linux).
  3. Why use snippets:
    • If you find yourself using some codes repeatedly on multiple pages then consider saving those scripts as snippets.
    • An alternative to bookmarklet:
      Problem with bookmarklets is that you need to use a generator to convert a js file into a bookmarklet, pain to make changes to a long single line of JavaScript inside of your bookmark manager, create and share those, show it on bookmarks bar on UI, run it and sometimes even open the dev tools to see if it really worked.But Snippets, on the other hand, are a much better way to handle this problem.
    • An alternative to console command:
      When using console command, sometimes we loose our unexecuted codes while using arrow up/down key for code correction because if the arrow is on the top of the code then pressing it again mistakenly displays the previously executed code and we end up losing our current unexecuted long multiline codes.But with Snippets, we can avoid above issue and also save the code as a file inside dev tool which we can use later when required. We can also save it externally to a known place on the disk as a backup to use it later.
    • Run part of the code:
      You can select portion of your code inside Snippets and run that particular portion of the code instead of executing all codes written in there.
    •  Breakpoint for debugging:
      It allows setting breakpoints in the codes for debugging on execution similarly the way you debug all other loaded js codes in your project.

So this is some basic cum advance detail about Snippet feature of developer toolbar and its benefit. I hope after reading this, it will help you write better and faster code during development.

Happy coding!!!

< Back to previous page

Leave a comment

Cancel reply

Your email address will not be published. Required fields are marked *

Recent posts

Authorize REST call in Jscript
18th December, 2023
Approval Process for external users – Power Automate
21st September, 2023
Power Automate – Tips and Tricks
27th June, 2023
Modern Commands and Power Fx
30th March, 2023
Plugin development – Tricks to avoid infinite loops
20th December, 2022

Contact us





    Contact Us

    Kalpavruksh Technologies Denmark A/S
    Store Kongensgade 68,
    1264 København
    +45 26 24 63 41

    Kalpavruksh Technologies USA
    29 Walter Hammond Pl,
    Waldwick NJ 07463

     

    Kalpavruksh Systems Pvt. Ltd.
    8th Floor, Technocity,
    Mahape, Navi Mumbai 400 710
    +91 22 4129 6111

    Kalpavruksh Technologies Deutschland GmbH
    Gosheimer Straße 26,
    78564 Wehingen

    Company

    • About Us
    • Blog
    • Careers
    • GDPR Compliance
    • Privacy Policy
    • Partners Privacy Policy
    • Contact us

    Microsoft Gold Partner



    Follow us

    © Copyright Kalpavruksh Technologies. 2025. All right reserved.
    Have any questions about our services, or just want to find out more about how we can help you reach your goals? Engage with us!