Commit Graph
213 Commits
Author SHA1 Message Date
Julian Descottes 834b25fba4 Bug 1568823 - Move Parser.jsm to a regular module in devtools/shared/webconsole r=nchevobbe
Depends on D39333

Differential Revision: https://phabricator.services.mozilla.com/D39335
2019-07-25 13:17:11 +00:00
Brendan Dahl 135bc8a754 Bug 1550801 - Replace expected XULDocument with HTMLDocument in devtools tests. r=nchevobbe
test_bug819670_getter_throws.html:
Previously, the document context inspected in the console was the test
harness XULDocument, but now it will be an HTMLDocument. Update the
checks to make sure the inspected object has the same own properties as
the test documents own properties.

other tests:
Simply replace the expected document type.

Differential Revision: https://phabricator.services.mozilla.com/D38695
2019-07-22 06:34:05 +00:00
Alexandre Poirot 633271ffe8 Bug 1568185 - Remove unused bindObjectActor argument from console actor. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39051
2019-07-24 08:35:41 +00:00
Bogdan Tara 3423c8474d Backed out 2 changesets (bug 1568203, bug 1568185) for ES lint failure on eval-with-debugger.js CLOSED TREE
Backed out changeset adc394f833f9 (bug 1568203)
Backed out changeset 46c3a1fdc706 (bug 1568185)
2019-07-24 11:24:51 +03:00
Alexandre Poirot b46a73620c Bug 1568185 - Remove unused bindObjectActor argument from console actor. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39051
2019-07-24 07:47:55 +00:00
Dana Keeler 46dcbaab8b bug 1564481 - reset HSTS/HPKP state to factory settings rather than storing knockout entries for preloaded sites r=jcj r=KevinJacobs
As originally implemented, nsISiteSecurityService.removeState allowed direct
access to remove HSTS state. It also provided the implementation for when the
browser encountered an HSTS header with "max-age=0". In bug 775370, it was
updated to store an entry that would override preloaded information when
processing such headers. However, this meant that the semantics of the direct
access API had changed. Preloaded information could be overridden if a user
invoked the "forget about this site" feature. This change fixes the public API
(and renames it to "resetState") so it actually behaves as its consumers expect.

Reviewers: jcj!, KevinJacobs!

Tags: #secure-revision

Bug #: 1564481

Differential Revision: https://phabricator.services.mozilla.com/D38108
2019-07-11 13:48:28 -07:00
Nicolas Chevobbe fcaf6fefa1 Bug 1563761 - Handle comments in analyzeInput. r=ochameau.
We weren't handling comments at all, which means that having
any in the console would probably make the autocomplete not
working.
This patch handles both inline and multiline javascript comments,
and adds test cases to ensure we don't regress.

Depends on D36573

Differential Revision: https://phabricator.services.mozilla.com/D37196
2019-07-10 08:00:32 +00:00
Victor Porof 435f7b056d Bug 1561435 - Format remaining devtools/, a=automatic-formatting, CLOSED TREE
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35894
2019-07-05 11:29:32 +02:00
Kris Maglione 4ff9c2bb2c Bug 1541557: Part 7 - Convert SpecialPowers to use JSWindowActors rather than framescripts. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D35057
2019-06-12 10:48:29 -07:00
yulia d6c65c3294 Bug 1042642 - use EventEmitter instead of eventSource on the DebuggerClient; r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D29371
2019-05-29 15:51:28 +00:00
Art-Vanderlay c41ada66ed Bug 1514766 - Change the order of the autocomplete popup to display lowercase items and perfect matches first. r=nchevobbe.
The autocomplete popup in the web console now favours matches
with the user input in alphabetical order with lowercase letters and
perfect matches brought to the top of the list.
e.g.

Typing 'document.styleSheets' brings up the result:

-styleSheets
-styleSheetSets

Differential Revision: https://phabricator.services.mozilla.com/D19330
2019-04-16 12:31:51 +00:00
Brian Grinstead 36c26fa2b9 Bug 1544322 - Part 1 - Remove the [type] attribute for one-liner <script> tags loading files in chrome://mochikit/content/ r=bzbarsky
This is an autogenerated commit to handle scripts loading mochitest harness files, in
the simple case where the script src is on the same line as the tag.

This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170
using the `--part 1` argument.

Differential Revision: https://phabricator.services.mozilla.com/D26812
2019-04-15 20:56:58 +00:00
Jonathan Kingston 8397774fdf Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881
2019-02-27 23:42:27 +00:00
Jonathan Kingston 1d7c7a19d3 Bug 1525319 - Changing js to remove context from onStartRequest and onStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20771
2019-02-27 23:41:54 +00:00
Dorel Luca 2dfae9a24a Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
2019-02-25 04:06:11 +02:00
Jonathan Kingston b6e28d0b8e Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881
2019-02-24 20:27:55 +00:00
Jonathan Kingston ba03516b3f Bug 1525319 - Changing js to remove context from onStartRequest and onStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20771
2019-02-25 00:07:42 +00:00
yulia 063debd11b Bug 1485664 - remove from field from jsterm tests; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D18836
2019-02-19 15:59:41 +00:00
yulia 8a3d8fec1f Bug 1485664 - adjust webconsole-connection-proxy to listen to webconsole front events, and fix r=ochameau
tests; r=ochameau

this migrates the proxy to the new webconsole front events. This resulted in a number of
test failures once the migration was finished, and those were fixed

Differential Revision: https://phabricator.services.mozilla.com/D18834
2019-02-19 15:57:52 +00:00
yulia 53d216ad5e Bug 1485664 - adjust events to front events; r=ochameau
this patch introduces events for the webconsoleFront -- not all of them are being listened
to by their subscribers yet, but this is the bulk of the effort to move events to Protocol.js

Differential Revision: https://phabricator.services.mozilla.com/D18832
2019-02-20 10:49:09 +00:00
yulia dd386ca059 Bug 1485664 - remove echoed events and unused events; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D18830
2019-02-20 10:49:03 +00:00
Alexandre Poirot 698742a690 Bug 1520774 - Remove TargetFactory.forRemoteTab. r=yulia
Differential Revision: https://phabricator.services.mozilla.com/D18539
2019-02-06 16:17:15 +00:00
Alexandre Poirot e9c0994e1c Bug 1465635 - Remove Target.activeTab property. r=yulia
Depends on D15831

Differential Revision: https://phabricator.services.mozilla.com/D16874
2019-02-02 11:24:24 +00:00
Bogdan Tara c0cfac2f78 Backed out 8 changesets (bug 1465635) for failures on browser_canvas-actor-test-10.js, browser_target_server_compartment.js CLOSED TREE
Backed out changeset e8e363f98525 (bug 1465635)
Backed out changeset 9ec017a91e78 (bug 1465635)
Backed out changeset 11413ebfbcaf (bug 1465635)
Backed out changeset 52728b761d5d (bug 1465635)
Backed out changeset 734646bf9829 (bug 1465635)
Backed out changeset d9ae7cd34c1a (bug 1465635)
Backed out changeset 00d325ab677a (bug 1465635)
Backed out changeset a9b181f32189 (bug 1465635)
2019-01-30 18:54:05 +02:00
Alexandre Poirot 47a8a0d0bd Bug 1465635 - Remove Target.activeTab property. r=yulia
Depends on D15831

Differential Revision: https://phabricator.services.mozilla.com/D16874
2019-01-30 13:28:25 +00:00
Kris Maglione 856fa07b17 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750
2019-01-17 10:18:31 -08:00
yulia a0f0807dec Bug 1518777 - make stoplisteners use promise style callbacks; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D16680
2019-01-24 11:50:34 +00:00
Alexandre Poirot 7b12165a46 Bug 1520782 - Convert console tests using chrome documents and using server references directly to browser mochitests. r=nchevobbe
These two tests were using chrome mochitest which forces the test page to be running in chrome and in parent process.
This doesn't reflect typical setup where the page runs unprivileged in content process.
Also, with the current bug, the pages running in system principal will be debugged with a special setup.
Actors will be run with modules loaded in a distinct loader in order to be executed
in a distinct compartment, distinct from the shared system principal compartment.
That a prerequisite for the Debugger API. It has to run in a distinct compartment than its debuggee.

Depends on D16826

Differential Revision: https://phabricator.services.mozilla.com/D16827
2019-01-23 08:53:06 +00:00
yulia 4ae4aff294 Bug 1519107 - use promise pattern for getCachedMessage rather than callbacks; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D16195
2019-01-21 13:47:03 +00:00
yulia efdd4b6d57 Bug 1519107 - make evaluateJS calls use promise pattern rather than callbacks; r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D16194
2019-01-21 13:45:03 +00:00
Nicolas Chevobbe 80f6a5467b Bug 1499289 - Change how we deal with getter evaluation in JsPropertyProvider; r=bgrins.
While trying to implement the invoke getter from
autocomplete popup, it became clear to me that the
initial implementation in js-property-provider wasn't
good enough, as we need to keep track of all the
authorizations the user gave when working on a given
expression.

In order to handle this, JsPropertyProvider now
returns an array of strings representing the path
to the unsafe getter when no matching authorizations
are provided.

If authorizations are provided, we can check for each
properties that the user authorized the execution.
This way, we can handle deep object access after a getter
(e.g. `x.myGetter.foo.bar.baz.entries`) without asking
the user if they want to invoke `myGetter` on each
step of the completion.

This makes handling intermediary getters (e.g.
`x.myGetter.foo.myOtherGetter.bar`) way easier as well.
In the UI, the user will be prompted to invoke the getter one
after the other (if for example they try to complete a pasted
expression which contains multiple getters, they will have
prompts for `myGetter`, and then for `myOtherGetter`).

We wire-up the webconsole client and the webconsole actor for
the autocomplete function, to make them ready for frontend
use.

The existing JsPropertyProvider getters test are updated to
match the change of parameter (invokeGetter -> authorizedEvaluations),
and some tests are added to make sure everything work as intended.

Differential Revision: https://phabricator.services.mozilla.com/D12940
2019-01-07 09:49:10 +00:00
Nicolas Chevobbe 99a316cbad Bug 1231489 - Use content prototype for autocompletion of String, Number and Array literals; r=bgrins.
When provided a string, number or array literals, we use to
simply return the properties from String.prototype, Number.prototype
and Array.prototype.
This is working fine unless the content prototypes are modified.
In order to make it work properly, we retrieve the actual content
prototype.
The js-property-provider unit test is modified to ensure this is
working as expected.

Differential Revision: https://phabricator.services.mozilla.com/D15843
2019-01-08 07:59:24 +00:00
Jan de Mooij 3a7941e4c9 Bug 1515590 part 7 - Null out proxy1 and proxy2 in test_jsterm_autocomplete.html to fix a shutdown leak. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D15566
2019-01-02 13:24:10 +00:00
Alexandre Poirot cf703aefe9 Bug 1513565 - Always use Target's WebConsoleClient instead of trying to instantiate it manually. r=yulia,nchevobbe
This will help getting rid of another usage of Target.form.
And also helps instantiating only one WebConsole client.
Once WebConsole becomes a front, we can replace all the target.activeTab
to target.getFront("console").

Differential Revision: https://phabricator.services.mozilla.com/D14278
2018-12-18 23:35:55 +00:00
Alexandre Poirot c2c92214da Bug 1508285 - Refactor RootFront.getTab to return BrowsingContextTargetFront instead of JSON form. r=yulia
MozReview-Commit-ID: 6TOInM5BmYe

Differential Revision: https://phabricator.services.mozilla.com/D14173
2018-12-17 11:56:26 +00:00
Nicolas Chevobbe 1882b66b88 Bug 1510422 - Fix autocomplete cache handling; r=Honza.
In Bug 1462394, we moved the autocomplete data handling
out of the JsTerm to the Redux store. In the process, we
regress some cases like `await n`, which should display
`navigator`, but isn't anymore when the user types the
whole sequence. Ctrl+Space would still show the popup,
which indicates that the issue is not on the server-side.

This issue is caused because our new code decides that
we should hit the cache when typing the `n`, and there's
nothing in the cache.

Previously, we were clearing the cache as soon as the input
last string wasn't alphanumeric, which we don't anymore.
To fix that, instead of relying on the last string of the
input (which could be wrong in cases like `x.["hello `), we
clear the cache when the autocomplete service returns a null
`matches` property.

In the JsPropertyProvider, we use to return null whenever
there isn't any search done (incorrect input, empty match prop, …).
So it seems like a good idea to bust the cache when the
server returns null.

This requires some changes to the autocomplete service, as well
as some in jsPropertyProvider (e.g. to handle `await `).

Tests are added both on the client and the frontend to make sure
we don't regress this (those tests fail without the actual fix).

Differential Revision: https://phabricator.services.mozilla.com/D13231
2018-11-29 13:58:57 +00:00
Alexandre Poirot 4d30293089 Bug 1509315 - Make the console test helper use getTab instead of listTabs. r=yulia
Ideally, it would use TargetFactory. But as that's mochitest chrome,
we don't have natural access to gBrowser/firefox tab.

MozReview-Commit-ID: 4nrfFZu6jAU

Depends on D12734

Differential Revision: https://phabricator.services.mozilla.com/D12735
2018-11-27 21:48:12 +00:00
Alexandre Poirot 28dcb11989 Bug 1509315 - Refactor console attachConsole test helpers to async. r=yulia
MozReview-Commit-ID: 2jIm73AiIPN

Depends on D12733

Differential Revision: https://phabricator.services.mozilla.com/D12734
2018-11-27 21:48:05 +00:00
Nicolas Chevobbe e013d59ca9 Bug 1473841 - Don't return dot-notation invalid properties; r=Honza.
In JsPropertyProvider, if doing a property access (with a dot),
check that the results are suited for a dot notation (e.g. `data`
is, while `data-test` is not).
In case, of an element access, we can return everything.

This implies making some changes to some tests which were using
invalid dot notation access in some case, which revealed a
bug with bracket autocomplete and spaces.

So the bracket autocomplete with spaces is now also fixed, and
a test case was added for that as well.

Differential Revision: https://phabricator.services.mozilla.com/D12726
2018-11-27 13:46:46 +00:00
Nicolas Chevobbe fc095e66e0 Bug 1506867 - Use AST to get the properties-access chain; r=bgrins.
Differential Revision: https://phabricator.services.mozilla.com/D11893
2018-11-20 06:43:03 +00:00
Alexandre Poirot e1d0ca7c1b Bug 1506548 - Return WorkerTargetFront from listWorkers instead of form. r=yulia
MozReview-Commit-ID: 4CBQNwC8tKq

Depends on D11762

Differential Revision: https://phabricator.services.mozilla.com/D11763
2018-11-15 10:23:50 +00:00
Alexandre Poirot 781a5ac688 Bug 1506549 - Return target fronts out of RootFront.getProcess and getMainProcess. r=yulia
MozReview-Commit-ID: EGWYEmAkbtr

Depends on D11693

Differential Revision: https://phabricator.services.mozilla.com/D11622
2018-11-15 10:22:49 +00:00
Alexandre Poirot 46971acb4d Bug 1506549 - Either pass a front or a form to Target constructor. r=yulia
MozReview-Commit-ID: BWsvAcWthnF

Differential Revision: https://phabricator.services.mozilla.com/D11693
2018-11-15 10:22:47 +00:00
Nicolas Chevobbe 79147a9c34 Bug 1216632 - Make autocompletion work on $_ and $0; r=bgrins.
To make $0 autocompletion work, we need to pass the current
selectedNode actor from the frontend, so we can retrieve the
object reference later.
For $_, we need the webconsole actor reference to be able
to retrieve the last input result.
Since the list of parameters of JsPropertyProviders was
getting a bit long, we transform them in an object so it's
more legible on the consumer side.
Mochitests are added for both helpers to ensure this work
as expected.

Differential Revision: https://phabricator.services.mozilla.com/D11866
2018-11-15 09:49:14 +00:00
Andreea Pavel 9d41a0a2bf Backed out 5 changesets (bug 1506549) for failing devtools at devtools/client/aboutdebugging/test/browser_service_workers_status.js on a CLOSED TREE
Backed out changeset 6be66dea928c (bug 1506549)
Backed out changeset da0d76d0e8fc (bug 1506549)
Backed out changeset 490eeba8f9f7 (bug 1506549)
Backed out changeset 97554f465eca (bug 1506549)
Backed out changeset 4f259de6cce0 (bug 1506549)
2018-11-14 21:46:07 +02:00
Alexandre Poirot 0d5dc1f31e Bug 1506549 - Return target fronts out of RootFront.getProcess and getMainProcess. r=yulia
MozReview-Commit-ID: EGWYEmAkbtr

Depends on D11693

Differential Revision: https://phabricator.services.mozilla.com/D11622
2018-11-14 15:48:16 +00:00
Alexandre Poirot 8a07616bea Bug 1506549 - Either pass a front or a form to Target constructor. r=yulia
MozReview-Commit-ID: BWsvAcWthnF

Differential Revision: https://phabricator.services.mozilla.com/D11693
2018-11-14 15:48:14 +00:00
Alexandre Poirot 1fc5daee89 Bug 1498280 - Introduce RootClient.getMainProcess to fetch ParentProcessTargetActor. r=yulia
MozReview-Commit-ID: E9OiwqDwNk7

Differential Revision: https://phabricator.services.mozilla.com/D11758
2018-11-13 14:07:36 +00:00
Nicolas Chevobbe 549a619b21 Bug 1479366 - Handle Number literals in JsPropertyProvider; r=bgrins.
When provided a number literal, JsPropertyProvider would
not return anything.
This patch solves this issue by adding an if case for those
objects.
Numerous test cases are added in test_js_property_provider to
make sure we handle this as expected and that we don't have
false positives.

Differential Revision: https://phabricator.services.mozilla.com/D11483
2018-11-12 07:39:38 +00:00
Nicolas Chevobbe ccc695e796 Bug 1505393 - Add better handling of unsafe getters in JsPropertyProvider; r=bgrins.
This patch adds two things to JsPropertyProvider:
- when provided an input which try to access an unsafe
getter properties, the function will indicate that an
unsafe getter should be invoked, with its name.
- a new boolean argument that when set to true would
invoke any unsafe getter that might be in the expression
to be completed.

For simplicity sake, the function only warns the user
of the presence of an unsafe getter when it's the last
property of the expression:

`object.myGetter.` will return that `myGetter` should be invoked
`object.myGetter.a.b.` will not (because then, a and b could
also be getters, and it's getting complex to handle both in
the function itself as in the UI).

Tests are added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D11170
2018-11-08 15:47:53 +00:00