The function, which is only used from previewers.js to retrieve
the first then interesting properties of an object, has a special
case for (local|session)Storage so we loop through their entries
and not their properties.
We're using storage#key to achieve this, but the problem is that
the function is quite slow, and if the storage object has a lot
of entries, it can end up freezing Firefox.
In order to avoid such freeze, for storage object, we're not returning
an array but an iterable object, which most of the time will only be
called 10 times and prevent any perf issue.
Differential Revision: https://phabricator.services.mozilla.com/D131913
I considered dropping `hasWinPackageId` because this new field is nearly a richer form of the same thing, but keeping it will allow us to distinguish the small edge case of an MSIX package _not_ produced by Mozilla. Were we to remove `hasWinPackageId`, those builds would not longer be distinguishable as MSIX packages.
Differential Revision: https://phabricator.services.mozilla.com/D131521
This patch changes ServiceWorkerScriptCache to use the principal of the
service worker to populate the partitionKey to the cookieJarSettings.
The service workers are using foreign partitioned principal. This means
it will contain a correct partitionKey if it's in a third-party context.
So we can use it to populate the partitionKey. In the first-party
context, we can use the script uri to get the partionKey, which is the
original approach.
Differential Revision: https://phabricator.services.mozilla.com/D128734
We used to use the principal URL for the partitionKey in
ServiceWorkerPrivateImpl. This is correct if the ServiceWorker only
works in first-party context. But, it isn't correct in third-party
context.
To fix that, we can directly use the foreign paritioned principal from
the ServiceWorkerPrivate to get the partitionKey in third-party context.
For the first-party context, we can still use the original approach to
get the partitionKey.
Differential Revision: https://phabricator.services.mozilla.com/D128733
This patch changes to use the foreign partitioned principal when check
if a channel needs to be intercepted by a certain service worker.
Differential Revision: https://phabricator.services.mozilla.com/D128731
When loading the main worker script, we will need to get the clientInfo
for the loading channel. However, the loading channel is created in
content processes and the `IsThirdPartyContextToTopWindow` won't be set
in this case. So, we will get an incorrect clientInfo with a wrong
foreign patitioned principal.
To resolve this, we have to set the flag in the content processes so
that we can get a correct clientInfo. The flag comes from the
workerPrivate which reflects the fact if the worker was created in a
third-party context. And the loading channel should have the same flag
as the document which creates the worker.
Differential Revision: https://phabricator.services.mozilla.com/D129060
To know if a worker is created under a third-party context, we need to
populate the `IsThirdPartyContextToTopWindow` to WorkerPrivate. This is
needed to get the correct foreign partitioned prinipal when loading
worker script in the content processes.
Differential Revision: https://phabricator.services.mozilla.com/D129059
Given that we use the partitioned Principal in the third-party context
and the loading principal won't have it, we should ignore the
partitionKey when doing the verfication.
Differential Revision: https://phabricator.services.mozilla.com/D127841
Currently, we use the script principal to verify the client to prevent
the principal forgery. After we moving to use foreign partitioned
principal for the Client, this no longer works. Instead, we can directly
use the client's principal to verify client.
Also, the patch rename StoragePrincipalHelper::VerifyValidStoragePrincipalInfoForPrincipalInfo() to
StoragePrincipalHelper::VerifyValidPartitionedPrincipalInfoForPrincipalInfo()
and fix a problem in the function that it should ignore the PartitionKey
instead of the FirstPartyDomain.
Differential Revision: https://phabricator.services.mozilla.com/D127840
Currently, the ServiceWorkerManager creates a content prinipcal based
on the regular originAttributes when dispatch the fetch event. This
patch changes to use the foreign partitioned originAttributs.
Note that we don't add tests for this because the change doesn't change
the behavior. And we don't enable partitioned third-party Service Worker.
So, the existing test cases is enough for this.
Differential Revision: https://phabricator.services.mozilla.com/D127632
To support foreign partitioned prinicpal for Client, we use
StoragePrincipalHelper::GetPrincipal() to get the foreign partitioned
principal from the channel in the ClientChannelHelper. And use it to
create client.
Differential Revision: https://phabricator.services.mozilla.com/D127631
Currently, we use the node principal to create clientSource in
nsGloblaWindowInner. This patch change this to use foreign partitioned
principal.
Differential Revision: https://phabricator.services.mozilla.com/D127630
Currently, we are using the regular principal and inherited regular
principal to create clientSource in nsDocShell. This patch makes the
nsDocshell to use the partitioned principal if needed.
Differential Revision: https://phabricator.services.mozilla.com/D127629
We implement
StoragePrincipalHelper::ShouldUsePartitionPrincipalForServiceWorker() to
help with deciding the principal needed to be used when creating a
initial clientSource in docShell.
Differential Revision: https://phabricator.services.mozilla.com/D127628
We take this opportunity to merge the browser toolbox and content toolbox preferences
into a single one.
Depends on D131600
Differential Revision: https://phabricator.services.mozilla.com/D131770
`470.82` is the first version that supports `EGL_NV_robustness_video_memory_purge`
which is required so we don't run into bug 1731172. The first stable release of
the `495` series also supports that extension, previous beta versions don't need
to be considered.
Differential Revision: https://phabricator.services.mozilla.com/D132101
The URL query stripping doesn't want the URLParams::Serialize() to
encode the result because it will encode the unstripped parameters. This
will change the unstripped parameters once stripping was happened.
Therefore, we introduce an parameter to URLParams::Serialize() to
disable encoding.
Differential Revision: https://phabricator.services.mozilla.com/D131964
It is helpful if window visibility state could be checked by debug overlay.
For now, it works only on Windows with compositor.
Differential Revision: https://phabricator.services.mozilla.com/D131807
Since we're going to enable EFT on Nightly and let it bake there a bit to
get feedback, we might face a situation where we have to disable EFT.
Having these test variants will help us to not regress non-EFT cases so if
we ever have to rollback EFT, there wouldn't be extra work.
Depends on D131477
Differential Revision: https://phabricator.services.mozilla.com/D131600
At the moment, the overlay can't be displayed if the DOM isn't loaded,
and we were waiting for that state before trying to show the overlay.
But we can't move forward in the document loading process until we resume,
which mean we could end up in weird state with the overlay, where the
page wasn't paused anymore, but we'd display it.
In this patch, we simply bail out if the document isn't ready.
Differential Revision: https://phabricator.services.mozilla.com/D131884
Instead, we try to get similar effects by calling toLowerCase() both on the
regex string and on the matched string.
This is probably not equivalent for non-English text. If we notice problems,
we can add more regexes. But as far as I know, this feature is currently
only enabled in the US and Canada.
In my testing, this change improves performance by 30x.
Before: https://share.firefox.dev/3kccIw8
After: https://share.firefox.dev/3EkZsNt
Differential Revision: https://phabricator.services.mozilla.com/D118231
`select` event on text controls now dispatched immediately before
`selectionchange`. However, it needs to create `AsyncEventDispatcher` for
each. This cost may not be expensive, but they are called really a lot even
if there is no corresponding event listener.
Therefore, this patch makes `nsPIDOMWindow` and `EventListenerManager` have
`MayHave*EventListeners` flag separately for each, and makes
`SelectionChangeEventDispatcher` does not try to do create
`AsyncEventDispatcher` when there is no corresponding event listener.
Differential Revision: https://phabricator.services.mozilla.com/D131750
Since we're going to enable EFT on Nightly and let it bake there a bit to
get feedback, we might face a situation where we have to disable EFT.
Having these test variants will help us to not regress non-EFT cases so if
we ever have to rollback EFT, there wouldn't be extra work.
Depends on D131477
Differential Revision: https://phabricator.services.mozilla.com/D131600
At the moment, the overlay can't be displayed if the DOM isn't loaded,
and we were waiting for that state before trying to show the overlay.
But we can't move forward in the document loading process until we resume,
which mean we could end up in weird state with the overlay, where the
page wasn't paused anymore, but we'd display it.
In this patch, we simply bail out if the document isn't ready.
Differential Revision: https://phabricator.services.mozilla.com/D131884