Closed
Bug 709223
Opened 14 years ago
Closed 14 years ago
GCLI needs a 'resource' type
Categories
(DevTools :: General, defect, P2)
DevTools
General
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 13
People
(Reporter: jwalker, Assigned: jwalker)
References
Details
Attachments
(1 file, 2 obsolete files)
|
30.08 KB,
patch
|
dcamp
:
feedback+
|
Details | Diff | Splinter Review |
I hacked up a type for the CSS editor which was the loaded CSS sheets. The debugger has an inline type for scripts. What we need is the ability to do:
type: {
name: 'resource',
filter: 'script'
}
Or similar.
I'm sure this type of thing is going to pop up in many places.
| Assignee | ||
Comment 1•14 years ago
|
||
While we are at it, perhaps we should have a command to remove new / inject existing resources from / into a page.
| Assignee | ||
Updated•14 years ago
|
| Assignee | ||
Comment 4•14 years ago
|
||
| Assignee | ||
Comment 5•14 years ago
|
||
| Assignee | ||
Comment 6•14 years ago
|
||
Note - the syntax is:
type: { name: 'resource', include: 'text/css' },
i.e. s/filter/include/
Attachment #591752 -
Attachment is obsolete: true
Attachment #591752 -
Flags: review?(dcamp)
| Assignee | ||
Updated•14 years ago
|
Attachment #592106 -
Flags: review?(dcamp)
| Assignee | ||
Updated•14 years ago
|
Target Milestone: Firefox 12 → Firefox 13
Comment 7•14 years ago
|
||
Joe has mentioned that we should return the stylesheet, script etc. as arg.resource.element ... not sure if he wants us to do this as part of this bug.
| Assignee | ||
Comment 8•14 years ago
|
||
| Assignee | ||
Comment 9•14 years ago
|
||
Change the name of the element to 'element'
Attachment #592106 -
Attachment is obsolete: true
Attachment #592106 -
Flags: review?(dcamp)
Attachment #593117 -
Flags: review?(dcamp)
Comment 10•14 years ago
|
||
Comment on attachment 593117 [details] [diff] [review]
upload 3
Review of attachment 593117 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, r+ waiting on a response to the xhr-vs-necko comment.
::: browser/devtools/webconsole/gcli.jsm
@@ +764,5 @@
> cli.unsetEvalFunction();
> nodetype.unsetDocument();
> jstype.unsetGlobalObject();
> + resource.unsetDocument();
> + resource.clearResourceCache();
Is there ever a time you'd want to unsetDocument() without clearResourceCache()? Maybe unsetDocument() should clear the resource cache itself?
@@ +3876,5 @@
> + callback(xhr.responseText);
> + };
> + xhr.open('GET', this.element.src, true);
> + xhr.send();
> + }
The style editor has code that uses necko directly, and prefers the cache:
http://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleeditor/StyleEditor.jsm#813
Won't be prettier, but has a better chance of matching the script that's actually loaded in the page.
@@ +3924,5 @@
> +
> +/**
> + * A CSS expression that refers to a single node
> + */
> +function ResourceType(typeSpec) {
This comment doesn't seem to match?
Attachment #593117 -
Flags: review?(dcamp) → feedback+
| Assignee | ||
Comment 11•14 years ago
|
||
(In reply to Dave Camp (:dcamp) from comment #10)
> Comment on attachment 593117 [details] [diff] [review]
> upload 3
>
> Review of attachment 593117 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Looks good to me, r+ waiting on a response to the xhr-vs-necko comment.
>
> ::: browser/devtools/webconsole/gcli.jsm
> @@ +764,5 @@
> > cli.unsetEvalFunction();
> > nodetype.unsetDocument();
> > jstype.unsetGlobalObject();
> > + resource.unsetDocument();
> > + resource.clearResourceCache();
>
> Is there ever a time you'd want to unsetDocument() without
> clearResourceCache()? Maybe unsetDocument() should clear the resource cache
> itself?
Makes sense. Good spot.
> @@ +3876,5 @@
> > + callback(xhr.responseText);
> > + };
> > + xhr.open('GET', this.element.src, true);
> > + xhr.send();
> > + }
>
> The style editor has code that uses necko directly, and prefers the cache:
>
> http://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleeditor/
> StyleEditor.jsm#813
>
> Won't be prettier, but has a better chance of matching the script that's
> actually loaded in the page.
Agreed, and the same goes for scripts too.
I created bug 723889 so we can fix them both together.
> @@ +3924,5 @@
> > +
> > +/**
> > + * A CSS expression that refers to a single node
> > + */
> > +function ResourceType(typeSpec) {
>
> This comment doesn't seem to match?
Ug. no.
I propose I fix all of these in bug 723889.
Follow along here: https://github.com/joewalker/gcli/commits/resource2-723889
| Assignee | ||
Comment 12•14 years ago
|
||
| Assignee | ||
Comment 13•14 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Comment 14•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Updated•8 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•