Closed Bug 1353006 Opened 7 years ago Closed 7 years ago

Stop using Add-on SDK modules in JSONViewer

Categories

(DevTools :: JSON Viewer, enhancement, P1)

enhancement

Tracking

(Performance Impact:?)

RESOLVED FIXED
Firefox 55
Performance Impact ?

People

(Reporter: pbro, Assigned: Honza)

References

Details

(Whiteboard: [nosdk])

Attachments

(3 files)

In bug 1350645 we're trying to stop using certain SDK APIs, including sdk/dom/events, which is being used in JSONView:

http://searchfox.org/mozilla-central/rev/990055a4902952e038cc350c9ffe1ac426d1c943/devtools/client/jsonview/converter-child.js#15-16

In this bug, we should find an alternative to this API.
Honza: is this something you could find a solution for? Is there another way we could deal with these events that did not have to rely on this SDK API, nor any of the other SDK APIs we want to remove in bug 1350645 comment 2?
Flags: needinfo?(odvarko)
(In reply to Patrick Brosset <:pbro> from comment #1)
> Honza: is this something you could find a solution for? Is there another way
> we could deal with these events that did not have to rely on this SDK API,
> nor any of the other SDK APIs we want to remove in bug 1350645 comment 2?
Patch removing sdk/events attached.

Not sure about "sdk/clipboard", I'll look into it yet.

Honza
Flags: needinfo?(odvarko)
Comment on attachment 8854812 [details]
Bug 1353006 - Stop using sdk/dom/events in JSONViewer;

https://reviewboard.mozilla.org/r/126778/#review129400

Thank you Honza!
Attachment #8854812 - Flags: review?(pbrosset) → review+
Comment on attachment 8854840 [details]
Bug 1353006 - Stop using sdk/clipboard in JSONViewer;

https://reviewboard.mozilla.org/r/126794/#review129406

::: devtools/client/jsonview/converter-child.js:321
(Diff revision 1)
> +  let doCopy = function (e) {
> +    e.clipboardData.setData("text/plain", string);
> +    e.preventDefault();
> +  };
> +
> +  win.document.addEventListener("copy", doCopy);

What about using a `once: true` listener here?  (I know you just copied this, but still...) :)
Attachment #8854840 - Flags: review?(jryans) → review+
Comment on attachment 8854841 [details]
Bug 1353006 - Stop using sdk/window/utils in JSONViewer;

https://reviewboard.mozilla.org/r/126796/#review129408

::: devtools/client/jsonview/utils.js:40
(Diff revision 1)
>  
>      filePickerShown = true;
>  
>      let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
>  
> -    let win = getMostRecentBrowserWindow();
> +    let win = WM.getMostRecentWindow("navigator:browser");

`Services.wm.<...>`, no need for `getService`.
Attachment #8854841 - Flags: review?(jryans) → review-
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Summary: Stop using sdk/dom/events in JSONViewer → Stop using Add-on SDK modules in JSONViewer
Comment on attachment 8854841 [details]
Bug 1353006 - Stop using sdk/window/utils in JSONViewer;

https://reviewboard.mozilla.org/r/126796/#review129446
Attachment #8854841 - Flags: review?(jryans) → review+
Whiteboard: [qf]
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/62f1e7e410ce
Stop using sdk/dom/events in JSONViewer; r=pbro
https://hg.mozilla.org/integration/autoland/rev/38cfa259d025
Stop using sdk/clipboard in JSONViewer; r=jryans
https://hg.mozilla.org/integration/autoland/rev/2385f24df5c6
Stop using sdk/window/utils in JSONViewer; r=jryans
https://hg.mozilla.org/mozilla-central/rev/62f1e7e410ce
https://hg.mozilla.org/mozilla-central/rev/38cfa259d025
https://hg.mozilla.org/mozilla-central/rev/2385f24df5c6
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Flags: qe-verify-
Priority: -- → P1
Whiteboard: [qf] → [nosdk] [qf]
Product: Firefox → DevTools
Performance Impact: --- → ?
Whiteboard: [nosdk] [qf] → [nosdk]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: