andrew
andrew

Reputation: 2879

Chrome DOM breakpoint keeps enabling itself

Yes, in the console, I made the horrible mistake of setting a DOM breakpoint on an element that wasn't getting the content injected into it that I expected it to.

Well, now whenever I load that page, the breakpoint triggers. I uncheck the box next to it. It comes back. I right click on it and click "Remove Breakpoint." It disappears from the list, and seems to work fine until the next hard refresh, then BAM breakpoint.

I click the disable all breakpoints button. It once again works until the next refresh, then BAM breakpoint. Closed Chrome, reopened. Same. Closed all tabs individually and closed Chrome through the menu, wiping out all tab memory. Same.

I put on a loincloth and did an intricate dance,
I knew it was a stretch, but I gave it a chance.
I found an exorcist to help with my plight,
but he ran off promptly, screaming in fright.
With the light of Eärendil, my machine I did annoint,
hoping to rid it of this [expletive deleted] breakpoint.
But nothing has worked, no matter how hard I fought,
so now I humbly ask assistance of you lot.

Has anyone run into this issue?

I'm on Windows 7, Chrome 14.0.835.202 m.

Upvotes: 49

Views: 9861

Answers (7)

Frazer Kirkman
Frazer Kirkman

Reputation: 1154

You can clear all your break points by opening the inspector inspector and typing localStorage.breakpoints = ''

Or if you'd like to manually decide which to keep you can use

InspectorFrontendHost.getPreferences(_ => window.mysnips = JSON.parse(_.scriptSnippets))
setTimeout(()=>{
    let snippetName = window.prompt("snippets name")||"BPs"+Math.random();

    let bps = JSON.parse(localStorage.breakpoints);
    let urls = [];
    let bpsToKeep = [];
    let bpsToSave = [];


    bps.forEach(bp=>{
        let alreadyProcessed = urls.filter(url=>url.url==bp.url)[0]
        if(!alreadyProcessed){
            alreadyProcessed = {url:bp.url};
            alreadyProcessed.save = confirm("save? : "+bp.url);

            urls.push(alreadyProcessed);
        }
        if(alreadyProcessed.save && !bp.enabled){
            bpsToSave.push(bp);
        }else{
            bpsToKeep.push(bp);
        }
    })

    window.mysnips.push({name:snippetName,content:""+JSON.stringify(bpsToSave)})
    InspectorFrontendHost.setPreference("scriptSnippets", JSON.stringify(window.mysnips))
    localStorage.breakpoints = JSON.stringify(bpsToKeep);
},300)

You can modify the script if you don't want to keep thos breakpoints as snippets.

Upvotes: 0

Dan
Dan

Reputation: 21

I confirm that problem still exists in 2021. Deleting of Chrome user and adding it again helped me.

Upvotes: 2

fmsf
fmsf

Reputation: 37137

solution here: http://code.google.com/p/chromium/issues/detail?id=91666

To purge all breakpoints open inspector on inspector (undock first inspector and hit ctrl-shift-I to open the second) and run "WebInspector.settings.domBreakpoints.set([])" in second inspector's console.

2021 Edit: This answer is now a decade old, there are multiple alternatives in the comments to this answer. I haven't tested them, the most up to date is from @reuben-thompson: window.localStorage.clear()

Upvotes: 28

Dennis Booth
Dennis Booth

Reputation: 21

The problem still exists today and the accepted answer is from 7 years ago and no longer works.

Uninstalling and Reinstalling Chrome is the only way I could fix it. See Can't remove DOM breakpoint "subtree modification" in chrome 69.0.3497.100

It would be nice if Google would re-open the bug report mentioned above but they've permanently closed it even though it's not fixed.

Upvotes: 1

steel
steel

Reputation: 12520

I have this problem in Chrome 33. In the little inspector, in the section that window that has sub-windows for 'Breakpoints' & 'Call Stack', etc, at the top of the window is a little book-mark icon that allows you to disable breakpoints. New windows require you re-disable.

Not the best solution, but it has allowed me to keep working in Chrome for now.

Upvotes: 1

Fergie
Fergie

Reputation: 6235

Sometimes when you set breakpoints you also autoenable "pause on exceptions". This will give unwanted persistant breakpointy behaviour. Cycle through the "pause on exceptions" button (bottom left) in order to switch it off (note- it is not on/off but three possible states)

Upvotes: 7

andrew
andrew

Reputation: 2879

Fixed it, had to upgrade Chrome to 15.0.874.106.

Settings > About Google Chrome > Relaunch

My breakpoint is no longer triggering, but I am weary of testing whether the actual bug is fixed or not. No more DOM breakpoints in Chrome for me.

Upvotes: 3

Related Questions