Ticket #11484 (assigned feature)
SourceURL support for scripts loaded by domManip using XHRs.
| Reported by: | vsevik@… | Owned by: | jaubourg |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | ajax | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This ticket is inspired by discussion in Chrome Developer Tools mailing group: https://groups.google.com/group/google-chrome-developer-tools/browse_thread/thread/e22f4cb5b0685dbd
SourceURL is a way to give a name to the script executed by eval() for debugging purposes. See http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
Adding sourceURL to scripts loaded by domManip would make debugging easier. example: $('head').append('<script src="test.js'></script>');
Similar (but different) request http://bugs.jquery.com/ticket/8292 was closed as wontfix earlier, so some comments on the reasons mentioned there:
This is a functionality that:
- only developers will need while debugging
Yes, but is very valuable for developers and it comes with virtually zero cost for users.
- is only useful for Chrome users
sourceURL is supported by Firefox and WebKit (Chrome, Safari) which makes together more than 60% of browser market share.
- is of limited use as the names would need to be randomly generated
In the example mentioned above the url could and should be taken from the src attribute of the script tag. This is the same url the script was loaded from.
Vsevolod Vlasov, webkit reviewer
Change History
comment:1 Changed 14 months ago by rwaldron
- Priority changed from undecided to low
- Component changed from unfiled to ajax
comment:2 Changed 14 months ago by dmethvin
- Status changed from new to open
- Milestone changed from None to 1.next
Worth investigating.
comment:3 Changed 14 months ago by jaubourg
- Owner set to jaubourg
- Status changed from open to assigned
I'll look into it
comment:4 Changed 9 months ago by dmethvin
- Type changed from enhancement to feature
Bulk change from enhancement to feature.
comment:6 Changed 3 months ago by dmethvin
Just a note after a quick look at that pull request. It's possible we might open up security holes by adding this if we're not careful with the sourceURL string and it has a newline. We also need to be alert for the IE conditional javascript bug, see #13274.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
