Bug 9895 - Unloaded files still show in Drosera's file dropdown
Summary: Unloaded files still show in Drosera's file dropdown
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 05:21 PDT by Jonathan Hurshman
Modified: 2010-07-26 03:16 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Hurshman 2006-07-13 05:21:20 PDT
Drosera's dropdown lists all the scripts the browser has seen since it was attached. Unloaded files are (as far as I can tell) never removed. This rapidly gets confusing.

The dropdown should show only files/scripts which are presently loaded and available.
Comment 1 Vladimir Olexa (vladinecko) 2007-02-28 09:56:37 PST
This bug is related to Bug 12887.
Comment 2 Timothy Hatcher 2008-05-17 09:02:30 PDT
This is less of an issue with the Web Inspector debugger because we only show scripts since the last load. But the list will still fill up with scripts that aren't used anymore.
Comment 3 Joseph Pecoraro 2009-09-30 23:13:24 PDT
I don't know about "unloaded files" anymore but certainly every single time you execute a command in the Console a new "(program)" shows up in the Script's drop down list.  For example:
http://grab.by/6X3

Note that you also see the Injected command line API:
http://grab.by/6X4

Are these changes related to how InjectedScript works (pfeldman)?
Comment 4 Pavel Feldman 2009-09-30 23:32:06 PDT
(In reply to comment #3)
> I don't know about "unloaded files" anymore but certainly every single time you
> execute a command in the Console a new "(program)" shows up in the Script's
> drop down list.  For example:
> http://grab.by/6X3
> 
> Note that you also see the Injected command line API:
> http://grab.by/6X4
> 
> Are these changes related to how InjectedScript works (pfeldman)?

Every time something is evaluated using console / watch expressions / any eval in the inspected page, compile -> run takes place under the hood. It reports compiled scripts to the inspector and hence they appear in the UI. Due to the original bug described here, collected scripts are not removed from the frontend.

We could wrap service evals and filter them from the UI, but that might lead to the following problem. Imagine you override some function definition using console (functionFoo = function() { do-something-new }). Then you debug the control flow that is getting into this function. You'd like to have a snippet available in the scripts list in order to step through it. So real solution to this problem is to report collected scripts into the framework.

As a short term fix we could try marking these scripts as 'hidden', not adding them into the scripts list, but displaying the snippet content when it is present in a backtrace while debugging. Timothy, what do you think?
Comment 5 Timothy Hatcher 2009-10-01 06:12:14 PDT
(In reply to comment #4)
> (In reply to comment #3)
> As a short term fix we could try marking these scripts as 'hidden', not adding
> them into the scripts list, but displaying the snippet content when it is
> present in a backtrace while debugging. Timothy, what do you think?

I like that idea, it might be better than just short term.
Comment 6 Joseph Pecoraro 2009-10-01 07:48:15 PDT
> As a short term fix we could try marking these scripts as 'hidden', not adding
> them into the scripts list, but displaying the snippet content when it is
> present in a backtrace while debugging.

If I remember correctly, the Console's typeahead is using evals.  So whenever you see a type ahead pop up in the Console, you get something ugly in the scripts list:
http://grab.by/6YB

If anything I think those typeahead helpers should be hidden, or even eliminated because they will never be needed again.

But I see your point with overriding functions and wanting to step through them, or even set breakpoints.
Comment 7 Alexander Pavlov (apavlov) 2010-07-26 03:16:59 PDT
I'm no longer seeing odd scripts, and apparently the typeahead scripts are no more added to the script list, too.