morgan pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
74a1ef5e by cypherpunks1 at 2024-09-18T19:15:44+00:00
fixup! Bug 40009: [android] Change the default search engines
Bug 43146: Update the icon of DuckDuckGo onion search engine
- - - - -
1 changed file:
- mobile/android/android-components/components/feature/search/src/main/assets/searchplugins/ddg-onion.xml
Changes:
=====================================
mobile/android/android-components/components/feature/search/src/main/assets/searchplugins/ddg-onion.xml
=====================================
@@ -2,7 +2,7 @@
<ShortName>DuckDuckGo (.onion)</ShortName>
<Description>Duck Duck Go Onion</Description>
<InputEncoding>UTF-8</InputEncoding>
-<Image height="16" width="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB8lBMVEUAAADkRQzjPwPjQQXkRQ3iPwTiQQXgPQPeQgrcOwPVNgDVNQDWOgbTMwDRMgDQMwDSMwDRNwTQLgDRJgDSJwDSLgDSNwTjOgDiOADjOQDkPADhQAXzs5v+/fv////0vKbiRQvgPQHpdUr85NzuknPdKgDcIwDnZzj2w7HqeU/gPQLsimb/+PftjWn97Obpb0LdJQDeLQDtjmvsi2jgSBDnbULgOQD/39HgLQDeMgDpeFLgSBH0v670uqbaJQD2qImWvP/G1Ob5+/3u//+fvvXyp47dMwDaLwD0u6v0v6/aNQDiXi/aKQD3qozU7/8gSY2vvtg0ZK/OqLDaKQHYKgLgWTfaNADZMgDZMADZLADzqpD7//+xwdz//9H/5Bn/7Bn//ADofADYMADYMQDZOgPXLgDiZDj//97/0AD3tQDvlgHZOgbXLATXMADWMgDfXjLVLQD///z+0AD/3Rn/yRnwnQDcVjbVMQDyv67wuKTSJwDRHQD+8O/tg3/iQQDwhAHnawHWMADvtKfyva7XQxHga0bQGQD2vbH/u8LXIQCmPQzja07XQxLliGn99fPkcVHvhnGZ5VguvUU5wktBwCcAgxzydVv/8/XmiGngdlL+ysi3+I8LtCE80V6P3YmX4sDleljSNQLzr6D7sKPXNQTSIwAEAbMrAAAAF3RSTlMARqSkRvPz80PTpKRG3fPe3hio9/eoGP50jNsAAAABYktHRB5yCiArAAAAyElEQVQYGQXBvUqCYRiA4fu2V9Tn+UQddI3aCpxaOoU6iU4gcqqpoYbALXBuCuoYmttamqJDiEoh4YP+MOi6BNCh+uYKEGiOVNCXXxA2XDVV/UyfKbRCXTLQWAxbP2vt8Ue/uYDvfim91615sb2um6rqtrr/NFb1cUf1Ybd06areU6lSlYpK79jzK1SyJOkfhOl8JGEcqV5zoKrTRqO6yUzIzNu46ijdM1VV9bhuUJ/nZURExLRzUiPQm3kKXHi4BAEGOmOi78A/L1QoU/VHoTsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTQtMDEtMTlUMjA6MDE6MTEtMDU6MDAuET6cAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE0LTAxLTE5VDIwOjAxOjExLTA1OjAwX0yGIAAAAABJRU5ErkJggg==</Image>
+<Image width="32" height="32">data:image/png;base64,AAABAAIAEBAAAAEAIAB5AwAAJgAAACAgAAABACAAUAcAAJ8DAACJUE5HDQoaCgAAAA1JSERSAAAAEAAAABAIBgAAAB/z/2EAAANASURBVDiNpZNNTFsFAMd/76t9rx+UsZYCGTNsIytVsXGGA5qNmAjG0Ok+OsXNuIMas4MnT4o6g4bTYnYw7jCnS/QAZHMmbBlKluzCphlK5mAbAcamlKyUQt+jtH19Hx6MZpz93f6X3+n/g/+J8OiYTe0KObLysikqRz3F9WeVcsVTUr1rjs9z04vTr66YVxqGx4sCuBsELgj39rW1CtWevkDjzqT60mHU5icRbBvbKmOvrmKODrF669qIvZr/aFvLjXHhU5z/BHOH2p6SNkdGwq8cjUqxXVTSM6xfGcYYHESMBAkeeofgiylYnGPpu5O5tfRMsuXc5BiAeG/PHlUO+ftq33gvaksa6SMdWOlZNn1wkoYz55DDtegDp/irpx3TW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FTkSuQmCC</Image>
<Url type="text/html" method="GET" template="https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/">
<Param name="q" value="{searchTerms}"/>
</Url>
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/74a1ef5…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/74a1ef5…
You're receiving this email because of your account on gitlab.torproject.org.
morgan pushed to branch mullvad-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
64b4b81e by Henry Wilkes at 2024-09-18T18:16:55+00:00
fixup! Firefox preference overrides.
Bug 42718: Drop unused browser.tabs.firefox-view preference.
- - - - -
7414b290 by Henry Wilkes at 2024-09-18T18:16:56+00:00
fixup! Bug 42037: Disable about:firefoxview page
Bug 42718: Always hide the firefox view button.
Also, ensure that `FirefoxViewHandler.openTab` returns early rather than
throwing.
- - - - -
3 changed files:
- browser/app/profile/001-base-profile.js
- browser/base/content/browser.js
- browser/themes/shared/tabbrowser/tabs.css
Changes:
=====================================
browser/app/profile/001-base-profile.js
=====================================
@@ -17,9 +17,6 @@ pref("startup.homepage_welcome_url.additional", "");
// Disable Firefox Welcome Dialog
pref("browser.aboutwelcome.enabled", false);
-// Disable the Firefox View tab (tor-browser#41876)
-pref("browser.tabs.firefox-view", false, locked);
-
#if MOZ_UPDATE_CHANNEL == release
// tor-browser#42640: Disable Firefox Flame buttond due to unknown interactions with New Identity
pref("browser.privatebrowsing.resetPBM.enabled", false, locked);
=====================================
browser/base/content/browser.js
=====================================
@@ -8079,6 +8079,11 @@ var FirefoxViewHandler = {
}
},
openTab(section) {
+ if (AppConstants.BASE_BROWSER_VERSION) {
+ // about:firefoxview is disabled. tor-browser#42037.
+ return;
+ }
+
if (!CustomizableUI.getPlacementOfWidget(this.BUTTON_ID)) {
CustomizableUI.addWidgetToArea(
this.BUTTON_ID,
=====================================
browser/themes/shared/tabbrowser/tabs.css
=====================================
@@ -747,17 +747,28 @@
/* Firefox View button and menu item */
-:root:not([privatebrowsingmode], [firefoxviewhidden]) :is(toolbarbutton, toolbarpaletteitem) + #tabbrowser-tabs,
-:root[privatebrowsingmode]:not([firefoxviewhidden]) :is(
+/* about:firefoxview is disabled in Base Browser. See tor-browser#42037.
+ * Therefore we always hide #firefox-view-button, regardless of private
+ * browsing. Here we only want to draw the border if there is a non-hidden
+ * toolbar item before the tabs.
+ * NOTE: Expect merge conflict from bugzilla bug 1917595 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+:root :is(
toolbarbutton:not(#firefox-view-button),
toolbarpaletteitem:not(#wrapper-firefox-view-button)
-) + #tabbrowser-tabs {
+) ~ #tabbrowser-tabs {
border-inline-start: 1px solid color-mix(in srgb, currentColor 25%, transparent);
padding-inline-start: calc(var(--tab-overflow-pinned-tabs-width) + 2px);
margin-inline-start: 2px;
}
-:root[privatebrowsingmode] :is(#firefox-view-button, #menu_openFirefoxView) {
+/* about:firefoxview is disabled in Base Browser. Always hide the toolbar button
+ * and menu item regardless of private browsing. See tor-browser#42037.
+ * NOTE: We also hide #wrapper-firefox-view-button, which is used during
+ * customization.
+ * NOTE: Expect merge conflict from bugzilla bug 1903812 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+#firefox-view-button, #wrapper-firefox-view-button, #menu_openFirefoxView {
display: none;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/a6…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/a6…
You're receiving this email because of your account on gitlab.torproject.org.
morgan pushed to branch base-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
1de422d9 by Henry Wilkes at 2024-09-18T18:16:06+00:00
fixup! Firefox preference overrides.
Bug 42718: Drop unused browser.tabs.firefox-view preference.
- - - - -
9507b27a by Henry Wilkes at 2024-09-18T18:16:06+00:00
fixup! Bug 42037: Disable about:firefoxview page
Bug 42718: Always hide the firefox view button.
Also, ensure that `FirefoxViewHandler.openTab` returns early rather than
throwing.
- - - - -
3 changed files:
- browser/app/profile/001-base-profile.js
- browser/base/content/browser.js
- browser/themes/shared/tabbrowser/tabs.css
Changes:
=====================================
browser/app/profile/001-base-profile.js
=====================================
@@ -17,9 +17,6 @@ pref("startup.homepage_welcome_url.additional", "");
// Disable Firefox Welcome Dialog
pref("browser.aboutwelcome.enabled", false);
-// Disable the Firefox View tab (tor-browser#41876)
-pref("browser.tabs.firefox-view", false, locked);
-
#if MOZ_UPDATE_CHANNEL == release
// tor-browser#42640: Disable Firefox Flame buttond due to unknown interactions with New Identity
pref("browser.privatebrowsing.resetPBM.enabled", false, locked);
=====================================
browser/base/content/browser.js
=====================================
@@ -8077,6 +8077,11 @@ var FirefoxViewHandler = {
}
},
openTab(section) {
+ if (AppConstants.BASE_BROWSER_VERSION) {
+ // about:firefoxview is disabled. tor-browser#42037.
+ return;
+ }
+
if (!CustomizableUI.getPlacementOfWidget(this.BUTTON_ID)) {
CustomizableUI.addWidgetToArea(
this.BUTTON_ID,
=====================================
browser/themes/shared/tabbrowser/tabs.css
=====================================
@@ -747,17 +747,28 @@
/* Firefox View button and menu item */
-:root:not([privatebrowsingmode], [firefoxviewhidden]) :is(toolbarbutton, toolbarpaletteitem) + #tabbrowser-tabs,
-:root[privatebrowsingmode]:not([firefoxviewhidden]) :is(
+/* about:firefoxview is disabled in Base Browser. See tor-browser#42037.
+ * Therefore we always hide #firefox-view-button, regardless of private
+ * browsing. Here we only want to draw the border if there is a non-hidden
+ * toolbar item before the tabs.
+ * NOTE: Expect merge conflict from bugzilla bug 1917595 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+:root :is(
toolbarbutton:not(#firefox-view-button),
toolbarpaletteitem:not(#wrapper-firefox-view-button)
-) + #tabbrowser-tabs {
+) ~ #tabbrowser-tabs {
border-inline-start: 1px solid color-mix(in srgb, currentColor 25%, transparent);
padding-inline-start: calc(var(--tab-overflow-pinned-tabs-width) + 2px);
margin-inline-start: 2px;
}
-:root[privatebrowsingmode] :is(#firefox-view-button, #menu_openFirefoxView) {
+/* about:firefoxview is disabled in Base Browser. Always hide the toolbar button
+ * and menu item regardless of private browsing. See tor-browser#42037.
+ * NOTE: We also hide #wrapper-firefox-view-button, which is used during
+ * customization.
+ * NOTE: Expect merge conflict from bugzilla bug 1903812 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+#firefox-view-button, #wrapper-firefox-view-button, #menu_openFirefoxView {
display: none;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d72c29…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/d72c29…
You're receiving this email because of your account on gitlab.torproject.org.
morgan pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
c28ee632 by Henry Wilkes at 2024-09-18T18:05:17+00:00
fixup! Firefox preference overrides.
Bug 42718: Drop unused browser.tabs.firefox-view preference.
- - - - -
4869b835 by Henry Wilkes at 2024-09-18T18:05:17+00:00
fixup! Bug 42037: Disable about:firefoxview page
Bug 42718: Always hide the firefox view button.
Also, ensure that `FirefoxViewHandler.openTab` returns early rather than
throwing.
- - - - -
3 changed files:
- browser/app/profile/001-base-profile.js
- browser/base/content/browser.js
- browser/themes/shared/tabbrowser/tabs.css
Changes:
=====================================
browser/app/profile/001-base-profile.js
=====================================
@@ -17,9 +17,6 @@ pref("startup.homepage_welcome_url.additional", "");
// Disable Firefox Welcome Dialog
pref("browser.aboutwelcome.enabled", false);
-// Disable the Firefox View tab (tor-browser#41876)
-pref("browser.tabs.firefox-view", false, locked);
-
#if MOZ_UPDATE_CHANNEL == release
// tor-browser#42640: Disable Firefox Flame buttond due to unknown interactions with New Identity
pref("browser.privatebrowsing.resetPBM.enabled", false, locked);
=====================================
browser/base/content/browser.js
=====================================
@@ -8121,6 +8121,11 @@ var FirefoxViewHandler = {
}
},
openTab(section) {
+ if (AppConstants.BASE_BROWSER_VERSION) {
+ // about:firefoxview is disabled. tor-browser#42037.
+ return;
+ }
+
if (!CustomizableUI.getPlacementOfWidget(this.BUTTON_ID)) {
CustomizableUI.addWidgetToArea(
this.BUTTON_ID,
=====================================
browser/themes/shared/tabbrowser/tabs.css
=====================================
@@ -747,17 +747,28 @@
/* Firefox View button and menu item */
-:root:not([privatebrowsingmode], [firefoxviewhidden]) :is(toolbarbutton, toolbarpaletteitem) + #tabbrowser-tabs,
-:root[privatebrowsingmode]:not([firefoxviewhidden]) :is(
+/* about:firefoxview is disabled in Base Browser. See tor-browser#42037.
+ * Therefore we always hide #firefox-view-button, regardless of private
+ * browsing. Here we only want to draw the border if there is a non-hidden
+ * toolbar item before the tabs.
+ * NOTE: Expect merge conflict from bugzilla bug 1917595 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+:root :is(
toolbarbutton:not(#firefox-view-button),
toolbarpaletteitem:not(#wrapper-firefox-view-button)
-) + #tabbrowser-tabs {
+) ~ #tabbrowser-tabs {
border-inline-start: 1px solid color-mix(in srgb, currentColor 25%, transparent);
padding-inline-start: calc(var(--tab-overflow-pinned-tabs-width) + 2px);
margin-inline-start: 2px;
}
-:root[privatebrowsingmode] :is(#firefox-view-button, #menu_openFirefoxView) {
+/* about:firefoxview is disabled in Base Browser. Always hide the toolbar button
+ * and menu item regardless of private browsing. See tor-browser#42037.
+ * NOTE: We also hide #wrapper-firefox-view-button, which is used during
+ * customization.
+ * NOTE: Expect merge conflict from bugzilla bug 1903812 and bug 1917599. In
+ * these cases we want to keep our selector as-is. */
+#firefox-view-button, #wrapper-firefox-view-button, #menu_openFirefoxView {
display: none;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/06801c…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/06801c…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch mullvad-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser
Commits:
a64e84bc by Pier Angelo Vendrame at 2024-09-18T15:37:35+02:00
Bug 42220: Allow for more file types to be forced-inline.
Firefox allows to open some files in the browser without any
confirmation, but this will result in a disk leak, because the file will
be downloaded to the temporary directory first (and not deleted, in some
cases).
A preference allows PDFs to be opened without being downloaded to disk.
So, we introduce a similar one to do the same for all the files that are
set to be opened automatically in the browser.
- - - - -
2 changed files:
- modules/libpref/init/StaticPrefList.yaml
- uriloader/base/nsURILoader.cpp
Changes:
=====================================
modules/libpref/init/StaticPrefList.yaml
=====================================
@@ -1446,6 +1446,12 @@
value: false
mirror: always
+# tor-browser#42220
+- name: browser.download.ignore_content_disposition
+ type: bool
+ value: true
+ mirror: always
+
# See bug 1811830
- name: browser.download.force_save_internally_handled_attachments
type: bool
=====================================
uriloader/base/nsURILoader.cpp
=====================================
@@ -292,34 +292,42 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
LOG((" forceExternalHandling: %s", forceExternalHandling ? "yes" : "no"));
if (forceExternalHandling &&
- mozilla::StaticPrefs::browser_download_open_pdf_attachments_inline()) {
+ (mozilla::StaticPrefs::browser_download_open_pdf_attachments_inline() ||
+ mozilla::StaticPrefs::browser_download_ignore_content_disposition())) {
// Check if this is a PDF which should be opened internally. We also handle
// octet-streams that look like they might be PDFs based on their extension.
bool isPDF = mContentType.LowerCaseEqualsASCII(APPLICATION_PDF);
- if (!isPDF &&
- (mContentType.LowerCaseEqualsASCII(APPLICATION_OCTET_STREAM) ||
- mContentType.IsEmpty())) {
+ nsAutoCString ext;
+ if (mContentType.LowerCaseEqualsASCII(APPLICATION_OCTET_STREAM) ||
+ mContentType.IsEmpty()) {
nsAutoString flname;
aChannel->GetContentDispositionFilename(flname);
- isPDF = StringEndsWith(flname, u".pdf"_ns);
- if (!isPDF) {
+ if (!flname.IsEmpty()) {
+ int32_t extStart = flname.RFindChar(u'.');
+ if (extStart != kNotFound) {
+ CopyUTF16toUTF8(Substring(flname, extStart + 1), ext);
+ }
+ }
+ if (ext.IsEmpty() || (!mozilla::StaticPrefs::
+ browser_download_ignore_content_disposition() &&
+ !ext.EqualsLiteral("pdf"))) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
if (url) {
- nsAutoCString ext;
url->GetFileExtension(ext);
- isPDF = ext.EqualsLiteral("pdf");
}
}
+ isPDF = ext.EqualsLiteral("pdf");
}
- // For a PDF, check if the preference is set that forces attachments to be
- // opened inline. If so, treat it as a non-attachment by clearing
- // 'forceExternalHandling' again. This allows it open a PDF directly
- // instead of downloading it first. It may still end up being handled by
- // a helper app depending anyway on the later checks.
- if (isPDF) {
+ // One of the preferences to forces attachments to be opened inline is set.
+ // If so, treat it as a non-attachment by clearing 'forceExternalHandling'
+ // again. This allows it open a file directly instead of downloading it
+ // first. It may still end up being handled by a helper app depending anyway
+ // on the later checks.
+ if (mozilla::StaticPrefs::browser_download_ignore_content_disposition() ||
+ isPDF) {
nsCOMPtr<nsILoadInfo> loadInfo;
aChannel->GetLoadInfo(getter_AddRefs(loadInfo));
@@ -328,8 +336,13 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
nsCOMPtr<nsIMIMEService> mimeSvc(
do_GetService(NS_MIMESERVICE_CONTRACTID));
NS_ENSURE_TRUE(mimeSvc, NS_ERROR_FAILURE);
- mimeSvc->GetFromTypeAndExtension(nsLiteralCString(APPLICATION_PDF), ""_ns,
- getter_AddRefs(mimeInfo));
+ if (isPDF) {
+ mimeSvc->GetFromTypeAndExtension(nsLiteralCString(APPLICATION_PDF),
+ ""_ns, getter_AddRefs(mimeInfo));
+ } else {
+ mimeSvc->GetFromTypeAndExtension(mContentType, ext,
+ getter_AddRefs(mimeInfo));
+ }
if (mimeInfo) {
int32_t action = nsIMIMEInfo::saveToDisk;
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a64…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a64…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch base-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits:
d72c2984 by Pier Angelo Vendrame at 2024-09-18T15:36:07+02:00
Bug 42220: Allow for more file types to be forced-inline.
Firefox allows to open some files in the browser without any
confirmation, but this will result in a disk leak, because the file will
be downloaded to the temporary directory first (and not deleted, in some
cases).
A preference allows PDFs to be opened without being downloaded to disk.
So, we introduce a similar one to do the same for all the files that are
set to be opened automatically in the browser.
- - - - -
2 changed files:
- modules/libpref/init/StaticPrefList.yaml
- uriloader/base/nsURILoader.cpp
Changes:
=====================================
modules/libpref/init/StaticPrefList.yaml
=====================================
@@ -1446,6 +1446,12 @@
value: false
mirror: always
+# tor-browser#42220
+- name: browser.download.ignore_content_disposition
+ type: bool
+ value: true
+ mirror: always
+
# See bug 1811830
- name: browser.download.force_save_internally_handled_attachments
type: bool
=====================================
uriloader/base/nsURILoader.cpp
=====================================
@@ -292,34 +292,42 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
LOG((" forceExternalHandling: %s", forceExternalHandling ? "yes" : "no"));
if (forceExternalHandling &&
- mozilla::StaticPrefs::browser_download_open_pdf_attachments_inline()) {
+ (mozilla::StaticPrefs::browser_download_open_pdf_attachments_inline() ||
+ mozilla::StaticPrefs::browser_download_ignore_content_disposition())) {
// Check if this is a PDF which should be opened internally. We also handle
// octet-streams that look like they might be PDFs based on their extension.
bool isPDF = mContentType.LowerCaseEqualsASCII(APPLICATION_PDF);
- if (!isPDF &&
- (mContentType.LowerCaseEqualsASCII(APPLICATION_OCTET_STREAM) ||
- mContentType.IsEmpty())) {
+ nsAutoCString ext;
+ if (mContentType.LowerCaseEqualsASCII(APPLICATION_OCTET_STREAM) ||
+ mContentType.IsEmpty()) {
nsAutoString flname;
aChannel->GetContentDispositionFilename(flname);
- isPDF = StringEndsWith(flname, u".pdf"_ns);
- if (!isPDF) {
+ if (!flname.IsEmpty()) {
+ int32_t extStart = flname.RFindChar(u'.');
+ if (extStart != kNotFound) {
+ CopyUTF16toUTF8(Substring(flname, extStart + 1), ext);
+ }
+ }
+ if (ext.IsEmpty() || (!mozilla::StaticPrefs::
+ browser_download_ignore_content_disposition() &&
+ !ext.EqualsLiteral("pdf"))) {
nsCOMPtr<nsIURI> uri;
aChannel->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
if (url) {
- nsAutoCString ext;
url->GetFileExtension(ext);
- isPDF = ext.EqualsLiteral("pdf");
}
}
+ isPDF = ext.EqualsLiteral("pdf");
}
- // For a PDF, check if the preference is set that forces attachments to be
- // opened inline. If so, treat it as a non-attachment by clearing
- // 'forceExternalHandling' again. This allows it open a PDF directly
- // instead of downloading it first. It may still end up being handled by
- // a helper app depending anyway on the later checks.
- if (isPDF) {
+ // One of the preferences to forces attachments to be opened inline is set.
+ // If so, treat it as a non-attachment by clearing 'forceExternalHandling'
+ // again. This allows it open a file directly instead of downloading it
+ // first. It may still end up being handled by a helper app depending anyway
+ // on the later checks.
+ if (mozilla::StaticPrefs::browser_download_ignore_content_disposition() ||
+ isPDF) {
nsCOMPtr<nsILoadInfo> loadInfo;
aChannel->GetLoadInfo(getter_AddRefs(loadInfo));
@@ -328,8 +336,13 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
nsCOMPtr<nsIMIMEService> mimeSvc(
do_GetService(NS_MIMESERVICE_CONTRACTID));
NS_ENSURE_TRUE(mimeSvc, NS_ERROR_FAILURE);
- mimeSvc->GetFromTypeAndExtension(nsLiteralCString(APPLICATION_PDF), ""_ns,
- getter_AddRefs(mimeInfo));
+ if (isPDF) {
+ mimeSvc->GetFromTypeAndExtension(nsLiteralCString(APPLICATION_PDF),
+ ""_ns, getter_AddRefs(mimeInfo));
+ } else {
+ mimeSvc->GetFromTypeAndExtension(mContentType, ext,
+ getter_AddRefs(mimeInfo));
+ }
if (mimeInfo) {
int32_t action = nsIMIMEInfo::saveToDisk;
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d72c298…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/d72c298…
You're receiving this email because of your account on gitlab.torproject.org.