Closed Bug 1089001 Opened 10 years ago Closed 8 years ago

Make sourceeditor/editor.js unprivileged

Categories

(DevTools :: Source Editor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1292592

People

(Reporter: ntim, Unassigned)

Details

I was surprised that the add-on sdk didn't have access to this component. The editor component has a clear advantage over *just* CodeMirror.

So here's my proposal :

const {Editor} = require("sdk/devtools/editor");

let myEditor = new Editor(config);

// For manipulation, the methods are the same as the "internal" api
Blocks: devtools-sdk
(In reply to Tim Nguyen [:ntim] from comment #0)
> I was surprised that the add-on sdk didn't have access to this component.
> The editor component has a clear advantage over *just* CodeMirror.
> 
> So here's my proposal :
> 
> const {Editor} = require("sdk/devtools/editor");
> 
> let myEditor = new Editor(config);
> 
> // For manipulation, the methods are the same as the "internal" api

This is a really good point, and I can see from your extensions that it would be really nice to be able to use a full-featured editor easily. 

+1!
Priority: -- → P1
Are you referring to some code that is already shipped with devtools?
Flags: needinfo?(ntim.bugs)
(In reply to Erik Vold [:erikvold] (please needinfo? me) from comment #2)
> Are you referring to some code that is already shipped with devtools?

Yep, it's the code editor used in Firefox DevTools.

Code : http://mxr.mozilla.org/mozilla-central/source/browser/devtools/sourceeditor/editor.js
Flags: needinfo?(ntim.bugs)
Priority: P1 → --
Component: General → Developer Tools: Source Editor
Product: Add-on SDK → Firefox
Doesn't seem relevant with WebExt, so changing this bug's purpose.
Summary: Expose the Editor() component to the addon sdk → Make sourceeditor/editor.js unprivileged
Assignee: nobody → ntim.bugs
No longer blocks: devtools-sdk
There may be another bug about at least part of this, but I can't find it now.  Tom, do you know of anything?
Flags: needinfo?(ttromey)
(In reply to Brian Grinstead [:bgrins] from comment #5)
> There may be another bug about at least part of this, but I can't find it
> now.  Tom, do you know of anything?

Does "unprivileged" here means something other than the meaning used by devtools.html?
If it means "can run in content", then there are a few remaining chrome uses in sourceeditor.
One is being handled in bug 1289425.
I don't think we have a bug yet for the chrome:// uses in sourceditor, e.g.:
https://dxr.mozilla.org/mozilla-central/source/devtools/client/sourceeditor/autocomplete.js#12

If "unprivileged" here just means something about exposing this module to add-ons, then I don't
know of anything.
Flags: needinfo?(ttromey)
Assignee: ntim.bugs → nobody
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.