Closed
Bug 703342
Opened 13 years ago
Closed 7 years ago
Make $0 available to Scratchpad
Categories
(DevTools Graveyard :: Scratchpad, defect, P3)
DevTools Graveyard
Scratchpad
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: dangoor, Assigned: cedricv)
Details
If you're trying out some DOM manipulation code in Scratchpad, it would be handy to have $0 available as you do in the console for accessing the currently selected element in the highlighter.
Comment 1•13 years ago
|
||
I have a hack for this.
In a Browser scratchpad, run:
this.__defineGetter__("$0", function() { return InspectorUI.selection; });
now $0 behaves as a getter. You can save this file and re-open and re-run it to achieve this.
I've resisted adding shortcuts to the scratchpad itself because code written there should be copyable to your script files to run. $0 is a potential exception though so I won't close this, but I do think providing clues for people to implement what they need for their own workflows.
Comment 2•13 years ago
|
||
Perhaps a new option in the Environment menu that added the web console helpers (and more?) would make sense?
Assignee | ||
Comment 3•13 years ago
|
||
I think importing $0 by default in a content Scratchpad makes sense. Principle of least surprise applies (most if not all code snippets working in the web console should work in a scratchpad imho)
Does Sandbox.importFunction works with getters?
And the getter should also check that the InspectorUI.selection is from the current tab - since a content scratchpad runs on that tab.
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → cedricv
Assignee | ||
Updated•13 years ago
|
Component: Developer Tools → Developer Tools: Scratchpad
QA Contact: developer.tools → developer.tools.scratchpad
Comment 4•13 years ago
|
||
Mihai suggests implementing a separate environment.
Filter on BLACKEAGLE!
Priority: -- → P3
Comment 5•7 years ago
|
||
Not touched in the past 5 years. No user complaints. Closing.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•5 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•