This will be a great feature for the Developer Tools ( console.snippets.name.function(); )

34 views
Skip to first unread message

barak.m...@gmail.com

unread,
Oct 28, 2012, 8:24:52 PM10/28/12
to google-chrome-...@googlegroups.com
Hi wouldn't it be fun/(killer feature) to be able to easily execute snippets form the Developer Tools console

Each snippet "file" will export his functions and you will gain access to them form the console.

Example:

inside the coolSnippets file

    function findAllLinks(){
       console.log(document.querySelector('a'));
    }

    function getBlankPage(){
         document.body.innerHTML = '';
         return 'this is cool';
    }

later inside the console

    console.snippets.get('coolSnippets').findAllLinks();
[<a>click here</a>]
    console.snippets.get('coolSnippets').getBlankPage();
 'this is cool'

    copy(console.snippets.get('coolSnippets'));


paste in my project.






Reply all
Reply to author
Forward
0 new messages