Commit graph

718 commits

Author SHA1 Message Date
Mark Banner
4a729cf9d7 Bug 1824173 - Automatically fix some ESLint issues raised by the valid-jsdoc configuration. r=mossop,webcompat-reviewers,denschub
Differential Revision: https://phabricator.services.mozilla.com/D173450
2023-03-24 19:35:24 +00:00
Gijs Kruitbosch
a30f9a5843 Bug 1824095 - rename savePrivacyAwareURI to saveURI, r=mtigley
Depends on D173432

Differential Revision: https://phabricator.services.mozilla.com/D173433
2023-03-24 11:54:45 +00:00
Gijs Kruitbosch
0163c6cdcc Bug 1824095 - remove obsolete saveURI API in favour of savePrivacyAwareURI, r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D173432
2023-03-24 11:54:44 +00:00
Emilio Cobos Álvarez
7d6d74bb92 Bug 1823686 - Add one more missing include.
MANUAL PUSH: Trivial bustage fix CLOSED TREE
2023-03-22 16:43:52 +01:00
Barret Rennie
65ff891284 Bug 1821644 - Set ShellService default log level to error r=nalexander
The associated comment says to set this value to debug when developing to get
more logging, but it appears it was accidentally left set to debug when
committing.

Differential Revision: https://phabricator.services.mozilla.com/D172291
2023-03-14 19:52:58 +00:00
Barret Rennie
174da7f10d Bug 1820642 - Fix intermittent in browser_setDefaultPDFHandler.js r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D171794
2023-03-08 18:38:46 +00:00
Barret Rennie
9a989eba44 Bug 1805509 - Add ShellService.setAsDefaultPDFHandler r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D169817
2023-03-06 20:10:56 +00:00
Barret Rennie
557a9c54ab Bug 1805511 - Add targeting for default PDF and HTML handlers r=nalexander,omc-reviewers,emcminn
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D169408
2023-03-06 20:10:55 +00:00
Sandor Molnar
bf87798f51 Backed out 4 changesets (bug 1805511, bug 1805509) for causing bc and xpc failures. CLOSED TREE
Backed out changeset 31a8dcad0d88 (bug 1805509)
Backed out changeset 3dd1735b85fa (bug 1805509)
Backed out changeset 87641a6eee2b (bug 1805509)
Backed out changeset e5bd4ad558f2 (bug 1805511)
2023-03-02 23:26:06 +02:00
Barret Rennie
eec9f6d959 Bug 1805509 - Add ShellService.setAsDefaultPDFHandler r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D169817
2023-03-02 20:33:22 +00:00
Barret Rennie
4ee24e27d8 Bug 1805511 - Add targeting for default PDF and HTML handlers r=nalexander,omc-reviewers,emcminn
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D169408
2023-03-02 20:33:21 +00:00
Sandor Molnar
dcf64fc565 Backed out 4 changesets (bug 1805509, bug 1805511) for causing node newtab failures. CLOSED TREE
Backed out changeset 1c1d335d4ef5 (bug 1805509)
Backed out changeset 0bf2579bccd7 (bug 1805509)
Backed out changeset a87f459f2caa (bug 1805509)
Backed out changeset ae16a9890f22 (bug 1805511)
2023-03-02 21:03:45 +02:00
Barret Rennie
c87b42b8c1 Bug 1805509 - Add ShellService.setAsDefaultPDFHandler r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D169817
2023-03-02 18:27:14 +00:00
Barret Rennie
42b3aa3286 Bug 1805511 - Add targeting for default PDF and HTML handlers r=nalexander,omc-reviewers,emcminn
This also fixes a bug in ASRouter devtools that prevented evaluation of
expressions containing nested promises. Objects containing promises are now
correctly serialized to the ASRouter devtools and expressions evaluate
correctly.

Differential Revision: https://phabricator.services.mozilla.com/D169408
2023-03-02 18:27:13 +00:00
Gijs Kruitbosch
9e07759558 Bug 1810141 - fix loadURI callers that already have an nsIURI reference or where creating one is clearly safe, r=mossop,geckoview-reviewers,extension-reviewers,settings-reviewers,mconley,m_kato
There are 3 types of changes in this commit:

- from `loadURI(foo.spec)` to `loadURI(foo)`, as there's already a URI
- from `loadURI("string")` to `loadURI(Services.io.newURI("string"))` as the URL is hardcoded
- one or two where there is perhaps an intermediate variable but the patch
  context should still make it trivial to ascertain the change is correct.

Depends on D168393

Differential Revision: https://phabricator.services.mozilla.com/D168394
2023-02-13 23:50:40 +00:00
Cristina Horotan
5f4356e527 Backed out 9 changesets (bug 1810141) for several test failures on a CLOSED TREE
Backed out changeset 8781a0d1254d (bug 1810141)
Backed out changeset 131037295784 (bug 1810141)
Backed out changeset 3852fbe290f4 (bug 1810141)
Backed out changeset 118f131a524a (bug 1810141)
Backed out changeset ab5d76846e10 (bug 1810141)
Backed out changeset dce3aa683445 (bug 1810141)
Backed out changeset 4dc41d90dbb3 (bug 1810141)
Backed out changeset 50b57ba1a061 (bug 1810141)
Backed out changeset 569de94781e4 (bug 1810141)
2023-02-13 16:05:30 +02:00
Gijs Kruitbosch
6add9ed34d Bug 1810141 - fix loadURI callers that already have an nsIURI reference or where creating one is clearly safe, r=mossop,geckoview-reviewers,extension-reviewers,settings-reviewers,mconley,m_kato
There are 3 types of changes in this commit:

- from `loadURI(foo.spec)` to `loadURI(foo)`, as there's already a URI
- from `loadURI("string")` to `loadURI(Services.io.newURI("string"))` as the URL is hardcoded
- one or two where there is perhaps an intermediate variable but the patch
  context should still make it trivial to ascertain the change is correct.

Depends on D168393

Differential Revision: https://phabricator.services.mozilla.com/D168394
2023-02-13 12:55:24 +00:00
Gijs Kruitbosch
efef52fc92 Bug 1795255 - autofix duplicate imports in tests under browser/, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D166179
2023-01-31 11:48:41 +00:00
Mark Banner
a94fe03b9d Bug 1811334 - Automatically replace Cu.reportError with console.error (most of browser/components). r=settings-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D167297
2023-01-20 17:49:21 +00:00
Emilio Cobos Álvarez
46df319668 Bug 1805939 - Have a central source of truth for desktop environment detection. r=stransky,jld
Gfx blocklist doesn't actually use the desktop environment filter so
remove that functionality. We can reintroduce it in the future if we
need it.

Differential Revision: https://phabricator.services.mozilla.com/D166090
2023-01-20 11:26:11 +00:00
Sylvestre Ledru
1f8d23143a Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D165559
2022-12-28 09:52:44 +00:00
Marco Castelluccio
f69e697461 Bug 1801836 - Remove no longer necessary 'from __future__' imports. r=linter-reviewers,glandium,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,jld,ahal,owlish,afinder DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165395
2022-12-23 22:45:46 +00:00
Ben Hearsum
712824d11a Bug 1804659: GNOME Shell search provider creates unnecessary windows r=jhorak
I was unable to get gnome searching working at all on my machine (perhaps it's broken on Ubuntu?), thus I was unable to verify this fix myself -- but it seems pretty straightforward and safe to take.

Differential Revision: https://phabricator.services.mozilla.com/D164902
2022-12-16 16:30:33 +00:00
Emilio Cobos Álvarez
a14c746228 Bug 1805415 - Use activateItem() rather than click() to activate menuitems. r=Gijs,extension-reviewers,pip-reviewers,search-reviewers
Bug 1805414 will move menu event handling to the DOM.

With that change the current synthetic click behavior of XUL menuitems
breaks. On current central, we rely on nsMenuFrame::HandleEvent not
getting called at all for synthetic clicks, and instead we just fire a
command event synchronously here:

  https://searchfox.org/mozilla-central/rev/a0d4f8f112c5c792ae272bf6ce50763ddd23ffa2/dom/xul/nsXULElement.cpp#1071

After my patch the command event is fired properly (potentially
asynchronously too) by the regular menu activation machinery, which is
preferable.

 * They fire a command event synchronously (even though on some
   platforms like macOS activating a context menu item is async).

 * They use a totally different codepath from what a user does.

 * They don't deal with native menus, etc.

We have a proper API for this (activateItem) which takes a much more
closer codepath to what users do, requires that the menu is shown, etc.
Use that API instead for testing.

As a benefit, tests now do not need to close the context menu manually
when clicking on a menu item (because we trigger the same code path as
users clicking the menu).

Differential Revision: https://phabricator.services.mozilla.com/D164567
2022-12-15 03:11:55 +00:00
Cristian Tuns
b638ccfac9 Backed out 2 changesets (bug 1805415) for causing dt failures on browser_net_telemetry_throttle_changed.js CLOSED TREE
Backed out changeset 5056d7df9f1e (bug 1805415)
Backed out changeset e13513500184 (bug 1805415)
2022-12-14 08:52:21 -05:00
Emilio Cobos Álvarez
be1f057109 Bug 1805415 - Use activateItem() rather than click() to activate menuitems. r=Gijs,extension-reviewers,pip-reviewers,search-reviewers
Bug 1805414 will move menu event handling to the DOM.

With that change the current synthetic click behavior of XUL menuitems
breaks. On current central, we rely on nsMenuFrame::HandleEvent not
getting called at all for synthetic clicks, and instead we just fire a
command event synchronously here:

  https://searchfox.org/mozilla-central/rev/a0d4f8f112c5c792ae272bf6ce50763ddd23ffa2/dom/xul/nsXULElement.cpp#1071

After my patch the command event is fired properly (potentially
asynchronously too) by the regular menu activation machinery, which is
preferable.

 * They fire a command event synchronously (even though on some
   platforms like macOS activating a context menu item is async).

 * They use a totally different codepath from what a user does.

 * They don't deal with native menus, etc.

We have a proper API for this (activateItem) which takes a much more
closer codepath to what users do, requires that the menu is shown, etc.
Use that API instead for testing.

As a benefit, tests now do not need to close the context menu manually
when clicking on a menu item (because we trigger the same code path as
users clicking the menu).

Differential Revision: https://phabricator.services.mozilla.com/D164567
2022-12-14 10:25:17 +00:00
Marco Castelluccio
6d04d33abd Bug 1790816 - Reformat browser/ with isort. r=linter-reviewers,search-reviewers,Standard8 DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162667
2022-11-22 11:09:34 +00:00
Mark Banner
640cf06c1b Bug 1797686 - Convert subprocess import consumers to import ES modules directly. r=kmag,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D160489
2022-10-27 20:17:39 +00:00
Mark Banner
7beacf6f18 Bug 1795322 - Update toolkit modules references in browser/ code. r=mossop,Gijs,preferences-reviewers,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D160031
2022-10-26 08:06:35 +00:00
Csoregi Natalia
5f9da7b301 Backed out 12 changesets (bug 1795322) for causing multiple failures e.g. test_deletion_request_ping.py. CLOSED TREE
Backed out changeset aba25cbcda51 (bug 1795322)
Backed out changeset a4a35005ada9 (bug 1795322)
Backed out changeset 8e8d790eb0f4 (bug 1795322)
Backed out changeset db8903454bd3 (bug 1795322)
Backed out changeset 60cc71c61cad (bug 1795322)
Backed out changeset bc6a674994ad (bug 1795322)
Backed out changeset 6ac8a611f8c7 (bug 1795322)
Backed out changeset 9fb873ecfb31 (bug 1795322)
Backed out changeset c8a7a40c2a2f (bug 1795322)
Backed out changeset f2c118b6c6ce (bug 1795322)
Backed out changeset 38df43b4a70f (bug 1795322)
Backed out changeset 89aea8373411 (bug 1795322)
2022-10-25 23:47:58 +03:00
Mark Banner
97298a7f37 Bug 1795322 - Update toolkit modules references in browser/ code. r=mossop,Gijs,preferences-reviewers,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D160031
2022-10-25 19:49:26 +00:00
Olli Pettay
cd1e2f6198 Bug 1644658 - Remove usages of <img> loadend events in screenshots code, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D159929
2022-10-25 08:27:01 +00:00
Norisz Fay
81c86f9a79 Backed out 3 changesets (bug 1644658, bug 1574487, bug 1644656) for causing mochitest failures on browser_staticPartition_saveAs.js CLOSED TREE
Backed out changeset ccd076f67748 (bug 1574487)
Backed out changeset 2235323f0cf9 (bug 1644656)
Backed out changeset 7fe2c7526246 (bug 1644658)
2022-10-25 02:22:37 +03:00
Olli Pettay
a0dfa0ffbe Bug 1644658 - Remove usages of <img> loadend events in screenshots code, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D159929
2022-10-24 20:33:03 +00:00
Mark Banner
2ffde1e92f Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Emilio Cobos Álvarez
9c5a574645 Bug 1794969 - Fix other dialogs / windows with fixed widths. r=Gijs,preferences-reviewers,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D159247
2022-10-13 16:00:22 +00:00
Ben Hearsum
56e315b983 Bug 1794017: improve shortcut detection of existing shortcuts in windows shell service r=bytesized
The current shortcut detection was good enough for a long while -- it was mainly used for Telemetry purposes, and installer created shortcuts were almost always created anyways -- so both the rate of mismatches and the consequences of them were fairly low. This changed when we implemented Private taskbar pinning, most notably because when we're creating Private Browsing shortcuts in the installer (which we ought to do to work around various Windows bugs), we end up with 2 strings for the shortcut names (one for the installer, one for the browser).

The other thing that has changed since this was originally implemented is that all of those code has moved off of the main thread -- so it is less perf-sensitive than it was before.

With these two things in mind, making our shortcut detection much more accurate seems like the right thing to do. There's still rare cases (noted in the original comments) where it could be wrong -- but with this change we no longer rely on the file name, which can very easily be wrong for a number of reasons.

This also includes a fix for a bug I introduced in https://bugzilla.mozilla.org/show_bug.cgi?id=1789974 that caused pinning not to work if a shortcut needed to be created at pinning time (unlikely except in zip builds, but still needs to be fixed).

Differential Revision: https://phabricator.services.mozilla.com/D158799
2022-10-11 14:02:57 +00:00
Mark Banner
8d1ebcb9d6 Bug 1792365 - Convert toolkit/modules consumers to use ES module imports directly. r=webdriver-reviewers,perftest-reviewers,geckoview-reviewers,extension-reviewers,preferences-reviewers,desktop-theme-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,robwu,Gijs,sgalich,bytesized,AlexandruIonescu,dao,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D158094
2022-09-29 06:52:34 +00:00
Ben Hearsum
724b167fce Bug 1787121: write runtime shortcuts log in UTF-16LE encoding r=bytesized
It turns out that the INI parser used by NSIS only supports UTF-16LE encoding. Our INI parser doesn't support UTF-16 at all, so we need to a bit of work ourselves to write this file correctly.

Differential Revision: https://phabricator.services.mozilla.com/D157378
2022-09-28 13:17:41 +00:00
Ben Hearsum
f6505e408b Bug 1791981: guard against null dereference in Windows 7 taskbar pinning code r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D158140
2022-09-26 16:30:56 +00:00
Ben Hearsum
e645b70d43 Bug 1789974: Fix shortcut creation when pinning to taskbar r=bytesized
In the recent refactor of this (https://bugzilla.mozilla.org/show_bug.cgi?id=1782295) I managed to break our ability to create shortcuts if they don't already existed. This was caused by two things:
1) An errant `NS_SUCCEEDED` call remained after the call it was checking moved elsewhere (oops)
2) The taskbar pinning code was not updated to set the shortcut file path (required after the refactor).

This patches fixes both of those issues. Note that all the directory service interaction is done on the main thread, because the actual function doing the work is on a background thread, and the directory service does not work there.

Differential Revision: https://phabricator.services.mozilla.com/D156993
2022-09-12 18:45:33 +00:00
Ben Hearsum
5c00f544a5 Bug 1789991: correctly detect existing private browsing shortcuts r=bytesized
This was an oversight during the original implementation in bug 1761291. I updated the code that creates shortcuts there, but not the code that looks at existing ones.

Differential Revision: https://phabricator.services.mozilla.com/D156992
2022-09-12 18:45:32 +00:00
Ben Hearsum
f4fb6620ae Bug 1789991: use a distinct string for in-product shortcut names r=nalexander,flod
In days of old, it was safe to use -brand-short-name for this, as it always lined up with the installer's concept of BrandShortName. This changed when https://bugzilla.mozilla.org/show_bug.cgi?id=1378834 landed -- which started using "Firefox Nightly" for the nightly branding BrandShortName in the installer (but maintained "Nightly" as the in-product -brand-short-name). Changing one or the other of these is not really a viable option:

- Changing the installer's BrandShortName for Nightly to match -brand-short-name would cause shortcuts to simply be called "Nightly" -- which is the opposite of what the aforementioned bug wanted
- Changing -brand-short-name would cause a number of in-product strings to start using "Firefox Nightly" instead of "Nightly" -- which is probably undesirable for a few reasons, not the least of which is possible l10n implications

For these reasons, and the relatively short timeline I have to fix this, I'm taking the simplest and easiest path of introducing a new string specifically for in-product shortcut names, which lines up with the installer's values for BrandShortName. (We perhaps should also separate this out in the installer -- but it's unnecessary here, so I did not go to the trouble.)

Differential Revision: https://phabricator.services.mozilla.com/D156991
2022-09-12 18:39:19 +00:00
Ben Hearsum
b6b648ce76 Bug 1782295: move private shortcut check & creation to background thread r=barret
This happens during lazy startup, and we try to avoid any main thread I/O there. Even though this will only ever happen once, there's really no reason I know of to keep it on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D155598
2022-09-08 13:09:10 +00:00
Cristian Tuns
cabdc5ed0b Backed out 3 changesets (bug 1782295) for causing Assertion failures on nsDirectoryService.cpp CLOSED TREE
Backed out changeset b332385ffca4 (bug 1782295)
Backed out changeset 8c36812a12dc (bug 1782295)
Backed out changeset 8016b1f25509 (bug 1782295)
2022-08-26 11:50:40 -04:00
Ben Hearsum
ca4462ce62 Bug 1782295: move private shortcut check & creation to background thread r=barret
This happens during lazy startup, and we try to avoid any main thread I/O there. Even though this will only ever happen once, there's really no reason I know of to keep it on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D155598
2022-08-26 14:50:13 +00:00
Ben Hearsum
85ca3c1116 Bug 1785814: The "os.environment.is_taskbar_pinned_private" scalar is set to "false" even if the "Pin Private Window" shortcut is pinned to the taskbar r=bytesized
In an ideal world we'd pass in the `privateBrowsing` flag and use that to both find the correct AUMID and binary to compare against, but because this code runs off main thread, and finding AUMIDs requires prefs access - we must pass in the AUMID from elsewhere.

Given that, checking that the target of the shortcut is one of the two possible Firefox entry points, and ensuring it matches the requested AUMID, seems reasonable.

There's no technical reason why we couldn't pass in the `privateBrowsing` flag to use in determining which binary we're looking for -- but I don't think it really adds any real benefit, and passing both it an the AUMID makes the interface more confusing.

Differential Revision: https://phabricator.services.mozilla.com/D155008
2022-08-18 20:50:05 +00:00
Ben Hearsum
c7cfad2069 Bug 1761291: use private browsing wrapper as target for Private Browsing shortcuts r=mhowell
This ensure the shortcuts will use the correct Visual Elements on the off chance they get pinned to the Start Menu.

Differential Revision: https://phabricator.services.mozilla.com/D151539
2022-08-03 13:49:05 +00:00
Mark Banner
7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Tooru Fujisawa
54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00