javascript - Chrome debugger doesn't stop -


i have added breakpoint following code in line 44 debugger;. expected chrome stop there every time before console.log("...") executed. surprise stops 1 time.

to test example:

  1. run snippet below in chrome
  2. open chrome dev tools
  3. drag image website in drop area

at point chrome stops @ breakpoint. if in console should see console.log statement executed 2 more times.

i know why happens. (threading issue??)

and how can solve if want debug code @ line.

$(document).ready(function() {      $('#drop-area').on("dragover", function(event) {      event.preventdefault();      event.stoppropagation();      $(this).addclass('dragging');    });      $('#drop-area').on("dragleave", function(event) {      event.preventdefault();      event.stoppropagation();      $(this).removeclass('dragging');    });      $('#drop-area').on("drop", function(event) {      event.preventdefault();      event.stoppropagation();        var count = 1;      var dropobj = event.originalevent.datatransfer;      (var = 0; < dropobj.items.length; i++) {        var adropitm = dropobj.items[i];        if (adropitm.kind == "file") {          //ignore        } else {          adropitm.getasstring(function(_str) {            debugger; //the debugger should stop here every time before string printed console            console.log("this called [" + count++ + "] times");          });        }      }    });    });
#drop-area {    background-color: red;    width: 400px;    height: 400px;  }
<div id="drop-area">drop files here...</div>    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

edit
reported bug here: https://bugs.chromium.org/p/chromium/issues/detail?id=748923


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -