As soon as the user clicks on a link to download a file Gecko will start the download - even before prompting the
user. This led to problems when the user hadn't granted the permission to write to the downloads directory yet. The
download would fail even though the user (later) accepted the permission.
With this patch we will start the download to the app's cache directory (only if we do not have the permission) and
prompt the user. As soon as the user has accepted the permission the download will be moved to the public downloads
directory (even while still downloading). If the permission is denied the download will be cancelled.
After the permission has been granted all subsequent downloads will start writing to the downloads directory
directly.
MozReview-Commit-ID: CCqk9h7Sxor
Be warned. Do not attemp to change the .js "test" source code in ./js
They are meant to check
- the outdated 0666 octal constant is still parsed correctly,
- the outdated 0666 octal constant raises syntax error flag
in strict mode, etc.
So leave them alone.
This patch will prevent Firefox from downloading OMA download descriptors on
its own. Instead it will prompt to complete the action with an external app
if available. An error will be shown if no external app can handle the download.
We will now search for distributions in the following folders:
* 1) Data distributions (APK or OTA):
* 1.1) <dataDir>/distribution/<mcc>/<mnc> - For bundled distributions for specific network providers
* 1.2) <dataDir>/distribution/<mcc> - For bundled distributions for specific countries
* 1.3) <dataDir>/distribution/default - For bundled distributions with no matching mcc/mnc
* 1.4) <dataDir>/distribution - Default non-bundled distribution
* 2) System distributions:
* 2.1) /system/<package>/distribution/<mcc>/<mnc> - For bundled distributions for specific network providers
* 2.2) /system/<package>/distribution/<mcc> - For bundled distributions for specific countries
* 2.3) /system/<package>/distribution/default - For bundled distributions with no matching mcc/mnc
* 2.4) /system/<package>/distribution - Default non-bundled system distribution
This patch will prevent Firefox from downloading OMA download descriptors on
its own. Instead it will prompt to complete the action with an external app
if available. An error will be shown if no external app can handle the download.
This patch moves the GMP update process from browser.js startup to
AddonUpdateService. It also uses the Gecko:ScheduleRun event in
GeckoService to schedule headless runs in order to perform updates
periodically.
The Android-specific AddonUpdateService has a bit of redundant code
because AddonManagerPrivate has a backgroundUpdateCheck method that does
a lot of the same thing. This patch makes AddonUpdateService call that
method so there's less code and more consistency.
This requires flipping the "extensions.update.enabled" pref, which was
disabled in bug 528588 for showing the XUL addon update dialog. I don't
think this is relevant anymore in native Fennec and with the later
rewrite of AddonManager, so I'm fairly certain it's okay to flip that
pref.
The patch also disables the AddonManager update timer because we have
our own update timer on Android.
The code in WebappsUpdateTimer.js tried to detect a webapp process by
using the context class name, which is extremely fragile. This patch
makes it detect the current Gecko profile instead.
- A telemetry probe for when a user clicks to unblock an image.
- A second probe for sending the size of the image being unblocked.
Since we don't have information on the image size the best option
was to make make an XHR HEAD request. We make an approximation
of the image size from the content length which we send in kB.
- Replaced bool pref for int list option: Never, Always, or Only over Wi-Fi
- Pref browser.image_blocking.enabled -> browser.image_blocking
- Converted the early return to check for cellular as well.
- Note that in the cellular check, I do not consider LINK_TYPE_USB as "cellular".
- Tested this on a physical device with all combinations
of WiFi ON/OFF (falling back to cellular and each menu state.
- Tested if menu options work as well for each state mentioned above.
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
Currently, BrowserCLH opens a single new window on startup. Now that
GeckoView is able to open windows through GeckoView.Window, we should
make GeckoView open its own window, which we can do earlier in startup,
and will make it possible to support multiple GeckoView's down the road.
This is a Fennec version of about:accounts, cribbed largely from
Desktop's implementation. This implementation serves two purposes:
One, it allows all fxa-content-server pref handling to remain in
Gecko. Java-side consumers redirect to about:accounts?action=... and
have pref munging and parameter addition (like context=fx_fennec_v1,
etc) handled by about:accounts itself.
Two, it handles network connectivity display and error handling. When
a request is started, we display an animated spinner. We transition
smoothly from the spinner to the iframe display if we can, and if not
we hide any network error and offer to retry. This is more important
in Fennec than it is on Desktop. This approach agrees with Firefox
for iOS.
Some additional notes:
The spinner to iframe transition uses the WebChannel listener to send
LOADED messages to the appropriate XUL <browser> element. It's worth
remembering that Fennec's Gecko is single process, so the <browser> in
question is in the same process. None-the-less, we are close to e10s
safe.
There are four actions: signup/signin/force_reauth, and manage. The
first three try to produce a LOGIN message. The last uses the
fxa-content-server to manage the Account settings. *This is not how
this is arranged on Desktop: Desktop redirects to a new tab, not
wrapped in about:accounts.*