Originally reported on Google Code with ID 2432
1. Load a JS file via document.write, but add a query string with a random
number (e.g. ?12345)
2. After the page has loaded, set a breakpoint inside the JS file.
3. Reload Firefox and see that either the breakpoint disappears, or it is
ignored. I've seen both behaviors. Sometimes the breakpoint remains but
isn't triggered, sometimes it's gone completely.
I created a test case for this. In order to verify that the code in the JS
file is running (which is the first thing people usually assume is wrong
when a breakpoint isn't triggering) I made the code in the JS file
document.write "Hello World". If you're seeing hello world, then you know
the code is running. Any of the lines of code in the external js file can
be used for this test.
Here is the body of the HTML test (attached also):
<script>
var rand=Math.random();
document.write("<script src='ext.js?" + rand + "'><\/script>");
</script>
and here are the contents of the ext.js file:
var a=1;
var b=2;
var c=a+b;
var d=3;
document.write("Hello World from ext.js");
var e=4;
var f=5;
Here's a discussion thread on it:
http://groups.google.com/group/firebug/browse_thread/thread/11cf6eb26cfef920/988698f413965de4#988698f413965de4
What I would expect (or hope) would happen, is that Firebug would ignore
the query string when it comes to setting breakpoints in files. If I'm
requesting that file from a simple fileserver, it will never change, so the
breakpoint will always be valid if the file hasn't changed. I understand
that I could be making the request to a dynamic server that may be using
that query string as a command to determine what it should write into a
dynamically created JS file. Both are valid cases. It would be nice to be
able to specify somehow which we prefer. Those of us who never make
requests to dynamic servers can set it to "always ignore query strings".
Those that use them can set it to the opposite (like it is now).
Firebug Ver = 1.43, Firefox Ver = 3.5.3, OS = XP Home SP3
Reported by dd4005 on 2009-10-27 09:54:32
- Attachment: simple.html
- Attachment: ext.js
该提问来源于开源项目:firebug/firebug