I mistake previous. We should disable testClipboard test on opt build
as temporary due to frequency failures until this is fixed.
Differential Revision: https://phabricator.services.mozilla.com/D182470
Bug 1834831 forgot converting mobile version since
`Document::AutomaticStorageAccessPermissionCanBeGranted` uses this module.
Differential Revision: https://phabricator.services.mozilla.com/D182661
There's a race in between a call of `evaluatePromiseJS` and a call of
`flushApzRepaints` which is similar to bug 1743857. If the given JS for the
`evaluatePromiseJS` call returns a Promise and if the call site doesn't wait for
the Promise, we can't ensure the given JS has set up in the content.
Unforutnately there's no good way to avoid the race, adding `waitForRoundTrip`
seems to work.
Differential Revision: https://phabricator.services.mozilla.com/D182439
Set `inputHandling: true` in the onClicked event of the
action/browserAction and pageAction APIs, and add tests.
Besides the usual coverage for the feature here, this patch also
introduces the only Android test for the `page_action.show_matches`
manifest key and the `pageAction.isShown` API. These APIs were already
covered by desktop-specific tests in browser/, but had zero test
coverage on Android. Since toolkit mochitests are run on desktop and
Android, this provides better cross-browser coverage.
Differential Revision: https://phabricator.services.mozilla.com/D181012
This goes through the previous changes in the dependencies of bug 877389, and does two things:
1) Remove instances of \n
2) Change reporting of exceptions so that they are passed as separate arguments. This should result
in an improved display of the exception in the browser console, should it occur.
Differential Revision: https://phabricator.services.mozilla.com/D180843
Since this test is often failure, I would like to add a wait for avoid
test failures. When I run this with `--repeat 200` on local, no failure.
Differential Revision: https://phabricator.services.mozilla.com/D179916
When a subframe and all of its scroll handoff parents have no room to
scroll up, provide a mechanism for the frontend to implement
pull-to-refresh. When input targets a subframe that meets the above
conditions:
For eager results and content that has a related event handler that does
not preventDefault, return input "unhandled". This allows pull to refresh
to work on mobile when the upwards scroll occurs over a subframe.
Differential Revision: https://phabricator.services.mozilla.com/D176559
Added `didPrintPageContent` to return a GeckoResult if printing completed on
Android when printing the current page. Also added `ERROR_NO_PRINT_DELEGATE`.
Differential Revision: https://phabricator.services.mozilla.com/D180355
This patch was generated as follows:
Run:
`./mach esmify --imports . --prefix=toolkit/mozapps/extensions/AddonManager`
In the output there are linter/prettifier errors due to unused
XPCOMUtils or separate importESModule calls. These have been fixed
manually and verified with `./mach lint --outgoing`.
The `esmify` script also inserts many unwanted newlines around imports
that are broken on two lines due to length. Due to the number of these,
I fixed them programatically.
1. Create patch from the changes so far.
2. From the patch, delete all lines that consist of "+" (i.e. added blank line).
3. Reset the working dir and apply the revised patch.
4. Verify that the diff between step 1 and 3 looks reasonable.
5. Verify that this patch as a whole looks reasonable.
Commands:
```
git diff > rename.diff
:%g/^+$/d
git commit -va -m WIP-rename
git revert HEAD
git apply --recount rename.diff
git diff HEAD^ # and verify that the removed lines are ok.
git commit -va # one last review to verify correctness of whole patch.
git rebase -i HEAD~3 # drop the WIP + reverted commit, pick only the last.
```
`git apply` has the `--recount` option to force it to ignore mismatches
in line counts, which happens because we deleted added lines (^+$)
without fixing up the line counts in the file headers.
Differential Revision: https://phabricator.services.mozilla.com/D179874
There is some OOM errors by `GeckoAppShell.getDNSDomains`. Since
`nsAndroidNetworkLinkService::GetDnsSuffixList` can returns `nsresult`, we
should return error instead of crash.
Differential Revision: https://phabricator.services.mozilla.com/D179791
Renamed chrome only URL.isValidURL to URL.isValidObjectURL for the name
to better match existing object/blob URL functions and to be less
confusing with new URL.canParse.
No tests for this function exist since it's chrome only (todo?) :'(
Differential Revision: https://phabricator.services.mozilla.com/D179641
This issue is a timing issue of loading content via about:config etc.
Although `GeckoViewMediaControl` registers event listeners for
`MediaController` when enabling `MediaSessionDelegate`, if process
switching occurs, `browsingContenxt` and `MediaController` are re-created.
It means that we has to register newer `MediaController`.
To detect destroying current browser, I will add `onDestroyBrowser` to
`GeckoViewModule` again (This was removed by bug 1672262).
Differential Revision: https://phabricator.services.mozilla.com/D179177
As this is the only string in `services/`, let's simplify by moving it under `toolkit/` and removing `services/sync/locales/` as empty.
On advice from markh, the ON_NEW_DEVICE_ID notification is delayed during device registration & updates until the update has been written to storage.
Differential Revision: https://phabricator.services.mozilla.com/D178805
When saving, the pdf data were fetched in JS and then passed to Java in using a message.
But with large pdf, it was possible to not have enough memory to allocate for the message.
Hence the idea is to just pass the blob url to Java and then stream the data.
Differential Revision: https://phabricator.services.mozilla.com/D179076
GeckoView's `DelayedInit.jsm` is only one consumer for `nsIMessageLoop`. This
XPCOM has no unit test now, so we don't know whether this XPCOM works
correctly.
Actually, `ChromeUtils` has `idleDispatch`, so we can replace `nsIMessageLoop`
with `ChromeUtils.idleDispatch`. It is used on a lot of code.
Differential Revision: https://phabricator.services.mozilla.com/D178624
Fix-ups in this patch:
* Enable multidex on messaging example apps to fix Lite build bustage where we API 16 is still supported
* Switch from deprecated assertThat to Hamcrest version
* Remove usage of deprecated ExpectedException.none()
Differential Revision: https://phabricator.services.mozilla.com/D178819
This changes the arguments of `ExtensionData.formatPermissionStrings()`.
The second `bundle` arg is dropped, and a `localization` option is added.
Call sites in m-c are updated, but this will also need a matching update for Thunderbird.
A few Thunderbird test cases will also need to be updated,
as they currently point to a non-existing localization file paths
"messenger/addons.ftl" and "messenger/addonPermissions.ftl".
As discussed at the addon workweek,
the Fluent l10n keys for extension permissions match the pattern:
webext-perms-description-{name}
where `{name}` is the permission's sanitized name.
A fluent-lint exception is added for the capitalization of these generated names.
To allow for message updates and subsequent l10n identifier updates,
a `PERMISSION_L10N_ID_OVERRIDES` map is provided.
Because Fluent localization keys are not enumerable
and attempting to format a missing key is an error,
the `PERMISSIONS_WITH_MESSAGE` set must be kept in sync with message updates.
Differential Revision: https://phabricator.services.mozilla.com/D158663
This bug adds in some additional telemetry for window.print on GeckoView
to report error conditions and if the Android print dialog successfully
opens.
Differential Revision: https://phabricator.services.mozilla.com/D177106
That's how we do it for all other platforms. Do this rather than via a
custom mostly-untested pref, which allows us to simplify text zoom
handling.
Differential Revision: https://phabricator.services.mozilla.com/D177062
We see a fair number of crashes caused by failing to create an EGL
surface when resuming the compositor on Android. We believe that in
the vast majority of these cases the Surface we have been provided by
the OS is in an invalid state, and therefore we will never succeed in
creating an EGL surface from it.
Currently when creating the EGL surface fails we raise a NEW_SURFACE
webrender error. This causes us to fall back through webrender
configurations, reinitialize the compositors, and eventually crash
when we are still unable to resume. None of this will help when the
Android Surface we have been provided is in this invalid state.
This patch therefore avoids raising the webrender error initially, and
instead gives the widget an opportunity to handle the failure. The
widget uses the new GeckoView API added in the previous patch in this
series to request a new Surface from the application. This will cause
another resume event immediately afterwards with a new - and hopefully
valid - surface, allowing the EGL surface to be created and the
compositor to be successfully resumed. If we are still unable to
create an EGL surface after this, then we will raise the webrender
error as before, likely eventually resulting in a crash.
Differential Revision: https://phabricator.services.mozilla.com/D176721
Adds a new interface, GeckoDisplay.NewSurfaceProvider, of which an
implementation can be provided in the GeckoDisplay.SurfaceInfo passed
to GeckoDisplay.surfaceChanged(). We include an implementation in
the GeckoView class, which works by toggling the SurfaceView's
visibility, causing a new surfaceChanged callback to be fired.
Differential Revision: https://phabricator.services.mozilla.com/D176720
The detection is inadequate and the workaround does not work on all
versions of Android. Later patches in this series will replace this
with something better.
Differential Revision: https://phabricator.services.mozilla.com/D176719
We see a fair number of crashes caused by failing to create an EGL
surface when resuming the compositor on Android. We believe that in
the vast majority of these cases the Surface we have been provided by
the OS is in an invalid state, and therefore we will never succeed in
creating an EGL surface from it.
Currently when creating the EGL surface fails we raise a NEW_SURFACE
webrender error. This causes us to fall back through webrender
configurations, reinitialize the compositors, and eventually crash
when we are still unable to resume. None of this will help when the
Android Surface we have been provided is in this invalid state.
This patch therefore avoids raising the webrender error initially, and
instead gives the widget an opportunity to handle the failure. The
widget uses the new GeckoView API added in the previous patch in this
series to request a new Surface from the application. This will cause
another resume event immediately afterwards with a new - and hopefully
valid - surface, allowing the EGL surface to be created and the
compositor to be successfully resumed. If we are still unable to
create an EGL surface after this, then we will raise the webrender
error as before, likely eventually resulting in a crash.
Differential Revision: https://phabricator.services.mozilla.com/D176721
Adds a new interface, GeckoDisplay.NewSurfaceProvider, of which an
implementation can be provided in the GeckoDisplay.SurfaceInfo passed
to GeckoDisplay.surfaceChanged(). We include an implementation in
the GeckoView class, which works by toggling the SurfaceView's
visibility, causing a new surfaceChanged callback to be fired.
Differential Revision: https://phabricator.services.mozilla.com/D176720
The detection is inadequate and the workaround does not work on all
versions of Android. Later patches in this series will replace this
with something better.
Differential Revision: https://phabricator.services.mozilla.com/D176719
Although `screen.orientation.lock()` works correctly and `orientation.type`
returns correct value, when using auto-rotation, `orientation.type` sometimes
return previous value on Android 12+'s device.
By bug 1806072, orientation.angle returns correct value. But
`Configuration.orientation` may be still previous value on
`onConfigurationChanged`. So we don't trust this value.
I cannot reproduce this on emulator image of Android 13. This seems to be
real device only
Also, I add orientation unlock to GVE for manual test.
Differential Revision: https://phabricator.services.mozilla.com/D176762
GMS's FIDO2 19.0.x supports residentKey values. So let's implement it
for Android's native token manager.
But when implementing it, GMS's FIDO2 will synchronize key via Google's
account Passkey. So this is experimental by preferences.
Differential Revision: https://phabricator.services.mozilla.com/D176391
The browser's activeness is set to false by default at the time of its creation. The reason is to let the background tabs have inactive browsers until they acquire a display to be visible to the user. This optimizes the cpu usage of unviewed tabs that are in the background.
Differential Revision: https://phabricator.services.mozilla.com/D176421
Adjusted the options on a WebResponse to include a way to request that
GeckoView embedders ask if users would like to view the file in another
app or to show the confirm download flow. (Default is false.)
Set requestExternalApp to true if the GeckoView embeder should prompt
the user to see the file in another app.
Set skipConfirmation to true if the GeckoView embeder does not need to
confirm the download. (Default is false.)
Differential Revision: https://phabricator.services.mozilla.com/D176179
The underlying Android-Gradle plugin bug has been addressed, so we no
longer see the issue, and therefore we don't need this complicated
"library set generation ID" workaround at all!
Differential Revision: https://phabricator.services.mozilla.com/D175167
This commit removes a good deal of complexity around how
`assets/omni.ja` and `libs/*` are packaged into the Android GeckoView
project and ultimately AAR and APK files.
Historically there was a delicate arrangement that had both the
omnijar and the native libraries in Android assets, the latter so
they could be compressed and read by Gecko's own loader
implementation. As GeckoView (and Android itself!) matured, the
arrangement was normalized: now Gecko libraries are regular Android
libraries with no compression and special loading. This is why we had
levels of indirection around `syncOmnijarFromDistDir` and
`syncLibsFromDistDir`: we needed fine-grained mappings from locations
to locations. These delicate mappings are no longer needed and the
whole process can be simplified in the manner of this patch.
By declaring the Android sourcesets (close to) statically, the updated
Android-Gradle plugin version 7.3.0 no longer "misses" content changes
in the relevant directories.
We continue to need the `withGeckoBinaries` product flavours to
support non-builds like linting and generating documentation.
Differential Revision: https://phabricator.services.mozilla.com/D161510
If an issue occurs when generating the PDF stream, we should be able to
send an error. The prior function (SendError()) was for stream readers
to use. The error state here can occur during writing.
Created a WriteError() option to set an error state that will cause
an IOException when reading to indicate the stream is in an inconclusive
state and to stop reading from it.
Differential Revision: https://phabricator.services.mozilla.com/D175918
After landing bug 1673068, `LoadURIDelegate.jsm` isn't used until error page
is shown. This should move to lazy and convert to ES system module.
Differential Revision: https://phabricator.services.mozilla.com/D175661
Implemented the inverted-colors media feature from Media Queries Level 5
for all platforms.
Spec: https://drafts.csswg.org/mediaqueries-5/#inverted
Platform specific implementations:
- Windows: Checks system color filter setting, and if it is inverted
(note: Windows does not live update due to having to read a reg key)
- Mac: Checks dedicated inverted accessibility system setting
- Android: Checks dedicated inverted system setting
- Linux: No GTK API exposes anything like it so always none
Locked behind new pref `layout.css.inverted-colors.enabled`,
always off by default for now.
Also added new WPT tests (none previously).
Other browsers:
- WebKit: shipped since Safari 9.1 (Jan 2017)
- Blink: no signal
Test page: https://goose.icu/inverted-colors
Differential Revision: https://phabricator.services.mozilla.com/D173201
Also, GeckoViewStorageController might not use correct principal since
bug 1801338 doesn't consider GeckoView.
So this fix loads correct ESM and use lazy loading.
Differential Revision: https://phabricator.services.mozilla.com/D174557
This bug changes the preference for window.print (dom.enable_window_print)
in GeckoView and Android to on by default. It also adjusts WPT expectations.
Differential Revision: https://phabricator.services.mozilla.com/D174535
This is the first step to listen to other AddonManager events. We likely
need a new delegate because there is no other existing delegate we can
leverage I think.
In Fenix, we could use this new delegate like this:
```diff
diff --git a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
index 5d34a952e8..8031bd1f67 100644
--- a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
+++ b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
@@ -357,8 +357,15 @@ class GeckoEngine(
}
}
- runtime.webExtensionController.promptDelegate = promptDelegate
+ val addonManagerDelegate = object : WebExtensionController.AddonManagerDelegate {
+ override fun onDisabled(extension: org.mozilla.geckoview.WebExtension) {
+ webExtensionDelegate.onDisabled(GeckoWebExtension(extension, runtime))
+ }
+ }
+
+ runtime.webExtensionController.setPromptDelegate(promptDelegate)
runtime.webExtensionController.setDebuggerDelegate(debuggerDelegate)
+ runtime.webExtensionController.setAddonManagerDelegate(addonManagerDelegate)
}
/**
@@ -422,7 +429,6 @@ class GeckoEngine(
runtime.webExtensionController.disable((extension as GeckoWebExtension).nativeExtension, source.id).then(
{
val disabledExtension = GeckoWebExtension(it!!, runtime)
- webExtensionDelegate?.onDisabled(disabledExtension)
onSuccess(disabledExtension)
GeckoResult<Void>()
},
```
Differential Revision: https://phabricator.services.mozilla.com/D173835
This is the first step to listen to other AddonManager events. We likely
need a new delegate because there is no other existing delegate we can
leverage I think.
In Fenix, we could use this new delegate like this:
```diff
diff --git a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
index 5d34a952e8..8031bd1f67 100644
--- a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
+++ b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
@@ -357,8 +357,15 @@ class GeckoEngine(
}
}
- runtime.webExtensionController.promptDelegate = promptDelegate
+ val addonManagerDelegate = object : WebExtensionController.AddonManagerDelegate {
+ override fun onDisabled(extension: org.mozilla.geckoview.WebExtension) {
+ webExtensionDelegate.onDisabled(GeckoWebExtension(extension, runtime))
+ }
+ }
+
+ runtime.webExtensionController.setPromptDelegate(promptDelegate)
runtime.webExtensionController.setDebuggerDelegate(debuggerDelegate)
+ runtime.webExtensionController.setAddonManagerDelegate(addonManagerDelegate)
}
/**
@@ -422,7 +429,6 @@ class GeckoEngine(
runtime.webExtensionController.disable((extension as GeckoWebExtension).nativeExtension, source.id).then(
{
val disabledExtension = GeckoWebExtension(it!!, runtime)
- webExtensionDelegate?.onDisabled(disabledExtension)
onSuccess(disabledExtension)
GeckoResult<Void>()
},
```
Differential Revision: https://phabricator.services.mozilla.com/D173835
This is the first step to listen to other AddonManager events. We likely
need a new delegate because there is no other existing delegate we can
leverage I think.
In Fenix, we could use this new delegate like this:
```diff
diff --git a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
index 5d34a952e8..8031bd1f67 100644
--- a/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
+++ b/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
@@ -357,8 +357,15 @@ class GeckoEngine(
}
}
- runtime.webExtensionController.promptDelegate = promptDelegate
+ val addonManagerDelegate = object : WebExtensionController.AddonManagerDelegate {
+ override fun onDisabled(extension: org.mozilla.geckoview.WebExtension) {
+ webExtensionDelegate.onDisabled(GeckoWebExtension(extension, runtime))
+ }
+ }
+
+ runtime.webExtensionController.setPromptDelegate(promptDelegate)
runtime.webExtensionController.setDebuggerDelegate(debuggerDelegate)
+ runtime.webExtensionController.setAddonManagerDelegate(addonManagerDelegate)
}
/**
@@ -422,7 +429,6 @@ class GeckoEngine(
runtime.webExtensionController.disable((extension as GeckoWebExtension).nativeExtension, source.id).then(
{
val disabledExtension = GeckoWebExtension(it!!, runtime)
- webExtensionDelegate?.onDisabled(disabledExtension)
onSuccess(disabledExtension)
GeckoResult<Void>()
},
```
Differential Revision: https://phabricator.services.mozilla.com/D173835
This is a race condition of full screen event and activated event of media
controller.
Media controller will dispatch activated event when full screen button is
clicked on controller. But since this depends on full screen event, if
GeckoView's media session receives this event before controller fires activated
event, `MediaSession.Delegate.onFullscreen` won't be called because
MediaSession.isActive() is false at this time.
So I would like to retry `GeckoView:MediaSession:Fullscreen` call when
entering full screen and controller isn't active yet.
Differential Revision: https://phabricator.services.mozilla.com/D173831