This adds a menu to the RDM global toolbar to allow the user to control whether
the page reloads in response to various state changes.
This also changes the default behavior to _not_ reload, so that we avoid losing
changes that might have been made in DevTools.
MozReview-Commit-ID: 86h5cB5dify
--HG--
extra : rebase_source : ebb4f86da4407772704a9fc06b4083b39cf61290
Currently, if you open the Inspector on some page, then enter RDM, the Inspector
will "reboot" (reload all panels) because it believes the document has reloaded.
However, it's not really true in this case. Instead, it's an artifact of the
pagehide / pageshow events that are triggered when swapping frames like RDM
does. Bug 1438697 adds a chrome-only property that we then use here to
distinguish this case.
MozReview-Commit-ID: Ks42QayVnij
--HG--
extra : rebase_source : 91739a5db2774073e723b1daf43bc5242755fc43
Note that this patch also replaces legacy VK_* with KEY_*, and replaces
synthesizeKey() for inputting some characters with sendString() because
it's better and clearer what it does and it sets shiftKey state properly.
MozReview-Commit-ID: De4enbjux3T
--HG--
extra : rebase_source : 2296b84bff8e22f01eeb48cd8614fac5db11136a
We can now remove the extra `.browser-container` element around the frame. It
was only here as a way to invoke React's `innerHTML` for real content.
MozReview-Commit-ID: 1wnv7SJmjTd
--HG--
extra : rebase_source : 12435e53d069d23adc22de4b1ba0259912ad6027
Now that we have React 16 (which includes support for custom attributes instead
of a fixed whitelist), we can create the browser frame in the "usual" way, as
opposed to this `innerHTML` workaround.
MozReview-Commit-ID: GwZVNIqF1QC
--HG--
extra : rebase_source : eec7a2c54638420b1a7adc27f25e1f0237eaa30e
Now, callers of EventUtils.synthesizeKey() don't need to specify
KeyboardEvent.code value anymore if they assume that active keyboard layout
is US keyboard layout.
Note that this patch changes the meaning of only test_bug551434.html.
Some callers in it don't match the key value and code value but that looks
like that they don't checking such odd keyboard events. So, they must be
bug of the test.
MozReview-Commit-ID: Itxo7yZ9rkK
--HG--
extra : rebase_source : 856ef3715c924ca16e993ea57d92d1243b5cc6be
In RDM's test for device pixel ratio overrides, there was a race condition where
the document's pixel ratio might change at the same time as it reloads (because
we trigger reloads for certain device changes). The step that listens for the
new pixel ratio to be applied was missing the case where after a reload, the
pixel ratio is already set to expected value, leading to intermittent hangs.
To resolve this issue and simplify things overall, we now explicitly wait for
reloads where we know they will happen first. Then, we check the pixel ratio
state after that, using the expected value we want to find.
MozReview-Commit-ID: DZYFT4AzaJd
--HG--
extra : rebase_source : 58dce8839a1f9d9a0064e2114e3a4811a437d8b7
This patch was autogenerated by my decomponents.py
It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.
It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.
It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)
MozReview-Commit-ID: DeSHcClQ7cG
--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
This is a short-term solution to our inability to apply CSP to
chrome-privileged documents.
Ideally, we should be preventing all inline script execution in
chrome-privileged documents, since the reprecussions of XSS in chrome
documents are much worse than in content documents. Unfortunately, that's not
possible in the near term because a) we don't support CSP in system principal
documents at all, and b) we rely heavily on inline JS in our static XUL.
This stop-gap solution at least prevents some of the most common vectors of
XSS attack, by automatically sanitizing any HTML fragment created for a
chrome-privileged document.
MozReview-Commit-ID: 5w17celRFr
--HG--
extra : rebase_source : 1c0a1448a06d5b65e548d9f5362d06cc6d865dbe
extra : amend_source : 7184593019f238b86fd1e261941d8e8286fa4006
When exiting RDM with a device applied, we clear the UA override, but we did not
force a refresh of the page. This means that the customized UA was still
accessible via `navigator.userAgent` and the page might have a non-default
layout if it tests the UA value.
To ensure there's no chance of confusion after exiting RDM, force a reload if
clearing emulation values determines it is needed.
MozReview-Commit-ID: Fkji12Utmis
--HG--
extra : rebase_source : a7ae8851165fae7aec5875d10f51cbb703b3f870
Changes:
- Added testUtils to React DOMs Proxy MonkeyPatch.
- Removed TestUtils where it is not needed.
- Added syntax identifiers to Markdown fences just because VSCode can do syntax highlighting in the markdown itself when you do that.
- In our require-helper.js files I have had to keep the name "react-addons-test-utils." This is because Enzyme uses the require paths to choose which adapters are needed (none are... yet)... we will need to use "react-addons-test-utils" instead of "react-dom/test-utils" as the path until we upgrade to React 16+.
MozReview-Commit-ID: H1tgzfp0MXl
--HG--
extra : rebase_source : cbdd59f6256703e7aba2dac76aece94c1101898e
Most of the codebase that needs to create a debugger server
can use a server with all actors registered.
Define an additional method registerAllActors to do that.
By previous implementations, all the call sites that were
using browser: true were indirectly using tab & root: true
as well. So all the call sites using browser: true have been
migrated to registerAllActors and the specific behavior of
the browser: true case has been removed. Passing browser:true
to registerActors now only registers browser specific actors.
MozReview-Commit-ID: F3sx71eGrdG
--HG--
extra : rebase_source : 7704264e84d96e03a0c789103ff466980913d4d2
DebuggerServer.init() already bails out if it was previously initialized
so we could avoid guarding the calls to init() with it everywhere.
Registering an actor module several times is also a noop as the Server
keeps a map of all the already registered modules and will bail out if
the module is already known.
MozReview-Commit-ID: 4ONLlx9253i
--HG--
extra : rebase_source : a6fce209baf5e019b6a216761c01832a30332343
DebuggerServer has old APIs addBrowserActors & addTabActors that can be
replaced by calls to registerActors.
MozReview-Commit-ID: KpYJpbSHM8I
--HG--
extra : rebase_source : c7f20edf503b944ef2582b5fe73bd6d899c0d1cc
Switch some calls to addOneTimeListener from callback-style to Promise.
MozReview-Commit-ID: F9AlSvK0MAH
--HG--
extra : rebase_source : 076522e89004f8a4634b4f7732800a5ec14ce633
As you add more than 7 or so custom devices, the modal will eventually wrap to
a 4th column. Adding some more width allows that to happen without a horizontal
scroll bar.
This width looks natural without custom devices as well, and its not too large
for the most popular screen size (1366 x 768).
MozReview-Commit-ID: 5IErG8NX3xO
--HG--
extra : rebase_source : cbdb862597ef1774964bea135da6376e0cbb7650
These low level docs are getting out of date and causing confusion. Further,
they are of limited value at this stage anyway.
MozReview-Commit-ID: FSoNniNZjtj
--HG--
extra : rebase_source : fa5e02a771adcae9b0e53bd18c4eb10ebb5315ef
This test verifies that WebExt messaging works as expected for both the
background page scripts and content scripts when RDM is used.
MozReview-Commit-ID: 3fODg3nYLr7
--HG--
extra : rebase_source : ad0051f6c377f15dbe27cf6cac5c3fd07af6fac7
WebExt messaging sends several new message types to content that should be
tunneled by RDM.
This change allows them to reach content as expected in RDM mode.
MozReview-Commit-ID: GKelgOGBUKI
--HG--
extra : rebase_source : 77288fc586efbaeb9b4c344a291c7c5f815e1a15
The local device removal path used by RDM had a bug in its `findIndex` call
which caused it to always return `true` for the first device.
Effectively this meant that each separate device removal button always removed
the first device! This would lead to all sorts of user confusion and UI
divergence.
Here we clean this up by allowing the caller (RDM in this case) to specify via a
callback which device is intended for removal.
MozReview-Commit-ID: 22VwEDZAXOa
--HG--
extra : rebase_source : a48b314090a321aa13cf8ca436e2beefa3dcc392
Before the browser is mounted, listen for `remote-browser-shown` so that we know
when the browser is fully ready. Without waiting for an event such as this, we
don't know whether all frame state for the browser is fully initialized (since
some happens async after the element is added), and swapping browsers can fail
if this state is not ready.
MozReview-Commit-ID: Ltd7mjdt7ox
--HG--
extra : rebase_source : 1cebc140c8f68d9daab7f8a0916be68f209d0f36
It is possible for the frame loader swap within `gBrowser._swapBrowserDocShells`
to fail when various frame state is either not ready yet or doesn't match
between the two browsers you're trying to swap. However, such errors are
currently caught and silenced in the browser, because they are apparently
expected in certain cases. So, here we do our own check to verify that the swap
actually did in fact take place, making it much easier to track such errors when
they happen.
MozReview-Commit-ID: LwuCXJQRRVW
--HG--
extra : rebase_source : f2e523ec3a5fc14306881dd823190dfcfe7cdd7a
Add some (disabled by default) logging to the RDM swap process to speed up
future investigations.
MozReview-Commit-ID: ICuH7i5Nsq5
--HG--
extra : rebase_source : 9d20a69965572020e7a98dbfe56bbcc57df0dad1
Using fill instead of filter we don't need to define each icon as
invertable or not. If the icon is a SVG and supports fill="context-fill"
then it will be inverted/highlighted etc... as expected.
If not then it won't be impacted by DevTools themes.
MozReview-Commit-ID: CLFprKMuCt9
--HG--
extra : rebase_source : 391f3567c2bdf319dcfd0a3b0c87f0479f85eabd
RDM uses temporary tabs to move content around and into the tool's viewport.
This triggers events like `TabOpen` and `TabClose` for the temporary tab,
trigger unnecessary work, like alerting WebExtensions.
Avoid this noise for WebExtensions and others by absorbing these events.
Note that the _original_ browser tab is unaffected. This only changes temporary
tabs RDM uses during the swapping process.
MozReview-Commit-ID: H8kBYBma6i9
--HG--
extra : rebase_source : 37150c7cb889ff64982f33f991a64fe50eacfd04
Remove the main file that we don't need anymore and modify all
the imports to target the specific file they now need.
MozReview-Commit-ID: 2uWjTnAMAU0
--HG--
extra : rebase_source : ebf75886fac79aaebfab16c03997f402e9f5a278
This removes the switching based on the RDM.html pref and the pref itself.
Some files in old RDM are updated for completeness, but they are about to be
removed anyway.
MozReview-Commit-ID: JnTC7ZF3UCC
--HG--
extra : rebase_source : 6a520a726fe77c560ecb71c5f633a9e2d7b956f7
This removes the switching based on the RDM.html pref and the pref itself.
Some files in old RDM are updated for completeness, but they are about to be
removed anyway.
MozReview-Commit-ID: JnTC7ZF3UCC
--HG--
extra : rebase_source : d591e04148d748c2659093295160adc6a3d2c445
Updated colors and styles for toolbox toolbar tabs as well as sidebar tabs.
For icon color changes created special filters that match the expected photon colors.
The normal, selected and checked states of icons in both dark and light theme are now
always set using filters.
MozReview-Commit-ID: 4MTAxHnyI7a
Sometime during Firefox 56, the `dataTransfer` property was removed, so this
started to fail. It was a bit strange anyway, since we have a principal on the
outer browser.
Adds a test to cover this use case.
MozReview-Commit-ID: 9UOCc77ZRxk
--HG--
extra : rebase_source : f743c7704ff8fc0e52b7facb11e0e9b6aca9670e
This was working around some old XUL layout weirdness, but nowadays this uses the same scroll frame implementation as HTML and tabStrip.scrollPosition + tabStrip.scrollClientSize > tabStrip.scrollSize cannot be true.
MozReview-Commit-ID: F5fOEpXn8ay
--HG--
extra : rebase_source : 5dcd0282e1054aad1c1a4946dd98dc33549bd2d6
In bug 1356448, the RDM tests are causing trouble in Windows 32-bit platforms,
so let's disable them for all Windows runs.
The timing of these tests appears to be very different on Windows platforms,
even though the production functionality works correctly, so more investigation
is needed.
MozReview-Commit-ID: 3BBbladg5Pl