How can I debug a bookmarklet in Chrome?

Posted on 2012-08-10
Last Modified: 2012-08-11
Since the bookmarklet is not part of the document, I don't know how to use Chrome dev tools to debug the bookmarklet's javascript code.

How can I debug a bookmarklet in Chrome?
Question by:SAbboushi
    LVL 75

    Accepted Solution

    Just put it in the head of a page and give it a button
    If it is your search BM then it will behave the same in a demo page as if it was a bookmarklet

    Author Comment

    Thanks - that helps!

    I am wondering if there is a way to debug the actual bookmarklet (maybe using remote debug which I haven't looked into yet: I believe remote debug allows us to debug chrome, so I would think that the bookmarklets would be accessible to a remote debug session?)
    LVL 75

    Expert Comment

    by:Michel Plungjan
    I doubt it except the bookmarklet runs in the scope of the page it had been executed in so debug that page

    Author Comment

    k thanks

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now