Closed Bug 1427231 Opened 6 years ago Closed 4 years ago

Cannot set breakpoint in Web tools debugger with multiple script tags

Categories

(DevTools :: Debugger, defect, P3)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lemurs71465, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [specification][type:bug])

Attachments

(1 file)

1018 bytes, application/octet-stream
Details
What did you do?
================
1. Open Debugger
2. Scroll down to the JS code
3. 

What happened?
==============
The first script tag allows me to set breakpoints. But after that tag is closed, the next script tag cannot have breakpoints set.  This was not the case for many years and one of the recent versions caused this.

What should have happened?
==========================
I should be able to set breakpoints on any JS code.

Is there anything else we should know?
======================================
It worked a month or two ago.  This major change caused it.  I also hate not having the HTML preview on the XHR under Networking. but that is another ticket.
Component: General → Developer Tools: Debugger
Product: Mozilla Developer Network → Firefox
I have version 56 installed now and i can set a breakpoint in the second set of script tags.  It is possible it happened in version 57.  I have to work so for now I will use version 56.  If this cannot be confirmed I will try 57 again later.
I ran into this behavior myself with Firefox 57 on my 64-bit Arch Linux desktop.

I created an SSCCE [1] in the hopes of providing a reproducable example that would expedite a fix.  However, what I found is setting breakpoints does work in Firefox 57 (for me) with multiple script tags.  Settings breakpoints does not work when the script tags embed HTML comments for antiquated user agents that don't support script tags.

I'll attach my SSCCE (a zip file containing one simple html page and one-line javascript file).  Just download, unzip, and open "breakpoints.html" in Firefox, then follow the directions on the page.

@lemurs771465, can you test the SSCCE and confirm whether you can reproduce the same results I observed?

[1]: (http://sscce.org)
Attached file breakpoint-example.zip
Product: Firefox → DevTools

I believe this was fixed. I'd love some confirmation.
CC honza

Flags: needinfo?(odvarko)
Flags: needinfo?(lemurs71465)
Flags: needinfo?(charetjc)

I can reproduce the problem:

  1. Load the attached zip through localhost
  2. Follow instructions on the page
  3. I can't set BP on lines: 20, 28, 35

It works when loading from public URL: http://janodvarko.cz/tests/bugzilla/1427231/breakpoints.html

Honza

Flags: needinfo?(odvarko)
Type: enhancement → defect
Priority: -- → P3
Summary: Cannot set breakpoint in Web tools debugger with multiple script tags → Can't set breakpoints in inline scripts from localhost
Type: defect → enhancement
Priority: P3 → --
Summary: Can't set breakpoints in inline scripts from localhost → Cannot set breakpoint in Web tools debugger with multiple script tags

The error still occurs for the public url provided by Honza in my v67.0.1. BPs available for lines 8 & 9, but none otherwise in the html file.

Same happens for localhost setup.

I have experienced this a number of times in the wild too.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Jason, could you clarify why this is an enhancement and not a defect?

Flags: needinfo?(lemurs71465)
Flags: needinfo?(jlaster)
Flags: needinfo?(charetjc)

oops

Type: enhancement → defect
Flags: needinfo?(jlaster)

Just tested it the public version and it worked for me. Is there a difference with the zip?

Flags: needinfo?(odvarko)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Flags: needinfo?(odvarko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: