Closed
Bug 1290230
Opened 9 years ago
Closed 9 years ago
replace uses of nsIClipboardHelper
Categories
(DevTools :: Framework, enhancement, P1)
DevTools
Framework
Tracking
(firefox51 fixed)
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: tromey, Assigned: tromey)
References
Details
(Whiteboard: [reserve-html])
Attachments
(1 file, 1 obsolete file)
Various spots in the inspector use nsIClipboardHelper.
These uses must be replaced for de-chrome-ification.
Assignee | ||
Comment 1•9 years ago
|
||
The web way to do this seems to be document.execCommand("copy"),
coupled with a "copy" event listener that modifies the event
to set the desired text.
See https://w3c.github.io/clipboard-apis/
Assignee | ||
Comment 2•9 years ago
|
||
There's also uses of sdk/clipboard
Updated•9 years ago
|
Whiteboard: [devtools-html] → [devtools-html] [triage]
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Updated•9 years ago
|
Iteration: --- → 50.4 - Aug 1
Flags: qe-verify-
Priority: -- → P1
Whiteboard: [devtools-html] [triage] → [reserve-html]
Assignee | ||
Comment 3•9 years ago
|
||
Dropping this for the time being in favor of a more important task.
Assignee: ttromey → nobody
Status: ASSIGNED → NEW
Updated•9 years ago
|
Iteration: 50.4 - Aug 1 → ---
Priority: P1 → P3
Updated•9 years ago
|
Priority: P3 → P2
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Updated•9 years ago
|
Iteration: --- → 51.1 - Aug 15
Priority: P2 → P1
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•9 years ago
|
Iteration: 51.1 - Aug 15 → 51.2 - Aug 29
Comment 6•9 years ago
|
||
mozreview-review |
Comment on attachment 8781702 [details]
Bug 1290230 - remove unneeded uses of nsIClipboardHelper from devtools;
https://reviewboard.mozilla.org/r/72052/#review69966
::: devtools/client/debugger/debugger-controller.js
(Diff revision 1)
> "resource://devtools/shared/Parser.jsm");
>
> XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
> "resource://gre/modules/ShortcutUtils.jsm");
>
> -XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
It looks like the clipboardHelper is used as a global, and is being used in
devtools/client/netmonitor/netmonitor-view.js
https://dxr.mozilla.org/mozilla-central/search?q=clipboardHelper+path%3Aclient%2Fdebugger&redirect=false
I think this change will break things.
::: devtools/client/netmonitor/netmonitor-controller.js
(Diff revision 1)
> "resource://devtools/client/shared/Curl.jsm");
>
> XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
> "resource://gre/modules/PluralForm.jsm");
>
> -XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
Same here:
https://dxr.mozilla.org/mozilla-central/search?q=path%3Adevtools%2Fclient%2Fnetmonitor+clipboardHelper&redirect=false
Comment 7•9 years ago
|
||
mozreview-review |
Comment on attachment 8781703 [details]
Bug 1290230 - move clipboard helper to new devtools platform module;
https://reviewboard.mozilla.org/r/72054/#review69964
See my comment on the test, but everything else looks great.
::: devtools/shared/platform/content/test/test_clipboard.html:16
(Diff revision 1)
> + href="chrome://mochikit/content/tests/SimpleTest/test.css">
> + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
> +
> +<script type="application/javascript;version=1.8">
> +"use strict";
> +var exports = {}
This structure feels weird to me and hard to understand. Would it be possible to load in the clipboard interface through a loader using require? It seems like it would be good to test the clipboard in the same way you would use it in an actual tool.
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Greg Tatum [:gregtatum] [@gregtatum] from comment #6)
> It looks like the clipboardHelper is used as a global, and is being used in
> devtools/client/netmonitor/netmonitor-view.js
Ugh, I hadn't considered that possibility.
If this breaks the tests I will just drop this patch.
> This structure feels weird to me and hard to understand. Would it be
> possible to load in the clipboard interface through a loader using require?
> It seems like it would be good to test the clipboard in the same way you
> would use it in an actual tool.
I don't think we have a version of require() that works in content.
I wrote the test as a plain mochitest to ensure that the environment
would be most content-like. And, when we are running this in the real
content environment, require() will be some special webpack thing anyway,
so I think testing it via our loaders won't help that eventual goal.
Instead when it all works we'll need an integration test that is exercising
the true code paths.
I hope this makes sense!
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Tom Tromey :tromey from comment #8)
> If this breaks the tests I will just drop this patch.
Definitely dropping that one.
It isn't really needed for our project anyway, and it did cause failures.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•9 years ago
|
Attachment #8781702 -
Attachment is obsolete: true
Attachment #8781702 -
Flags: review?(gtatum)
Comment 11•9 years ago
|
||
mozreview-review |
Comment on attachment 8781703 [details]
Bug 1290230 - move clipboard helper to new devtools platform module;
https://reviewboard.mozilla.org/r/72054/#review70390
Okie doke, that sounds good to me.
Attachment #8781703 -
Flags: review?(gtatum) → review+
Assignee | ||
Comment 12•9 years ago
|
||
I'm going to push this one after I can rebase it on top of bug 1290233,
so I can remove that last require("chrome") and avoid breaking eslint as well.
Depends on: 1290233
Comment hidden (mozreview-request) |
Comment 14•9 years ago
|
||
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/58af0782df06
move clipboard helper to new devtools platform module; r=gregtatum
Comment 15•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•