Pier Angelo Vendrame pushed to branch tor-browser-102.7.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
feffd625 by Henry Wilkes at 2023-02-08T10:21:04+00:00
dropme! Partial revert of "Bug 10760: Integrate TorButton to TorBrowser core"
Bug 41609: Revert the activity stream changes.
- - - - -
6cd4fa5a by Henry Wilkes at 2023-02-08T10:21:05+00:00
fixup! Firefox preference overrides.
Bug 41609: Set home page and new tab to about:blank in base-browser.
- - - - -
ed354cc8 by Henry Wilkes at 2023-02-08T10:21:38+00:00
Bug 31575: Disable Firefox Home (Activity Stream)
Treat about:blank as the default home page and new tab page.
Avoid loading AboutNewTab in BrowserGlue.jsm in order
to avoid several network requests that we do not need.
- - - - -
6793375e by Henry Wilkes at 2023-02-08T10:22:35+00:00
fixup! Bug 10760: Integrate TorButton to TorBrowser core
Bug 41609: Change the default home page from about:blank to about:tor
- - - - -
93a409f1 by Henry Wilkes at 2023-02-08T10:22:36+00:00
amend! Bug 10760: Integrate TorButton to TorBrowser core
Bug 10760: Integrate TorButton to TorBrowser core
Because of the non-restartless nature of Torbutton, it required
a two-stage installation process. On mobile, it was a problem,
because it was not loading when the user opened the browser for
the first time.
Moving it to tor-browser and making it a system extension allows it
to load when the user opens the browser for first time.
Additionally, this patch also fixes Bug 27611.
Bug 26321: New Circuit and New Identity menu items
Bug 14392: Make about:tor behave like other initial pages.
Bug 25013: Add torbutton as a tor-browser submodule
Bug 31575: Replace Firefox Home (newtab) with about:tor
- - - - -
3 changed files:
- browser/app/profile/001-base-profile.js
- browser/components/BrowserGlue.jsm
- browser/components/preferences/home.js
Changes:
=====================================
browser/app/profile/001-base-profile.js
=====================================
@@ -4,6 +4,11 @@
// Use the OS locale by default (tor-browser#17400)
pref("intl.locale.requested", "");
+// Home page and new tab is blank rather than Firefox Home (Activity Stream).
+// tor-browser#31575 and tor-browser#30662
+pref("browser.startup.homepage", "about:blank");
+pref("browser.newtabpage.enabled", false);
+
// Disable initial homepage notifications
pref("browser.search.update", false);
pref("startup.homepage_welcome_url", "");
@@ -151,7 +156,6 @@ pref("services.sync.engine.passwords", false);
pref("services.sync.engine.prefs", false);
pref("services.sync.engine.tabs", false);
pref("extensions.getAddons.cache.enabled", false); // https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/
-pref("browser.newtabpage.enabled", false);
pref("browser.search.region", "US"); // The next two prefs disable GeoIP search lookups (#16254)
pref("browser.search.geoip.url", "");
pref("browser.fixup.alternate.enabled", false); // Bug #16783: Prevent .onion fixups
=====================================
browser/components/BrowserGlue.jsm
=====================================
@@ -5899,7 +5899,7 @@ var AboutHomeStartupCache = {
return { pageInputStream: null, scriptInputStream: null };
}
- this.log.error("Activity Stream is disabled in Tor Browser.");
+ this.log.error("Activity Stream is disabled.");
return { pageInputStream: null, scriptInputStream: null };
},
=====================================
browser/components/preferences/home.js
=====================================
@@ -380,10 +380,14 @@ var gHomePane = {
if (controllingExtension && controllingExtension.id) {
newValue = controllingExtension.id;
- } else if (isDefault) {
- newValue = this.HOME_MODE_FIREFOX_HOME;
} else if (isBlank) {
+ // For base-browser, we want to check isBlank first since the default page
+ // is also the blank page, but we only have a menu option for
+ // HOME_MODE_BLANK, rather than HOME_MODE_FIREFOX_HOME.
+ // See tor-browser#41609.
newValue = this.HOME_MODE_BLANK;
+ } else if (isDefault) {
+ newValue = this.HOME_MODE_FIREFOX_HOME;
} else {
newValue = this.HOME_MODE_CUSTOM;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/1ac852…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/1ac852…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.7.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
1ac8520e by hackademix at 2023-02-07T09:27:49+01:00
amend! Bug 8324: Prevent DNS proxy bypasses caused by Drag&Drop
Bug 8324: Prevent DNS proxy bypasses caused by Drag&Drop
Bug 41613: Skip Drang & Drop filtering for DNS-safe URLs
- - - - -
1 changed file:
- toolkit/torbutton/components/dragDropFilter.js
Changes:
=====================================
toolkit/torbutton/components/dragDropFilter.js
=====================================
@@ -113,6 +113,25 @@ DragDropFilter.prototype = {
for (let i = 0, count = aDataTransfer.mozItemCount; i < count; ++i) {
this.logger.log(3, `Inspecting the data transfer: ${i}.`);
const types = aDataTransfer.mozTypesAt(i);
+ const urlType = "text/x-moz-url";
+ // Fallback url type, to be parsed by this browser but not externally
+ const INTERNAL_FALLBACK = "application/x-torbrowser-opaque";
+ if (types.contains(urlType)) {
+ const links = aDataTransfer.mozGetDataAt(urlType, i);
+ // Skip DNS-safe URLs (no hostname, e.g. RFC 3966 tel:)
+ const mayLeakDNS = links.split("\n").some(link => {
+ try {
+ return new URL(link).hostname;
+ } catch (e) {
+ return false;
+ }
+ });
+ if (!mayLeakDNS) {
+ continue;
+ }
+ const opaqueKey = OpaqueDrag.store(links, urlType);
+ aDataTransfer.mozSetDataAt(INTERNAL_FALLBACK, opaqueKey, i);
+ }
for (const type of types) {
this.logger.log(3, `Type is: ${type}.`);
if (URLISH_TYPES.includes(type)) {
@@ -120,14 +139,6 @@ DragDropFilter.prototype = {
3,
`Removing transfer data ${aDataTransfer.mozGetDataAt(type, i)}`
);
- const urlType = "text/x-moz-url";
- // Fallback url type, to be parsed by this browser but not externally
- const INTERNAL_FALLBACK = "application/x-torbrowser-opaque";
- if (types.contains(urlType)) {
- const link = aDataTransfer.mozGetDataAt(urlType, i);
- const opaqueKey = OpaqueDrag.store(link, urlType);
- aDataTransfer.mozSetDataAt(INTERNAL_FALLBACK, opaqueKey, i);
- }
for (const type of types) {
if (
type !== INTERNAL_FALLBACK &&
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/1ac8520…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/1ac8520…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.2.1-12.0-2 at The Tor Project / Applications / fenix
Commits:
25e5afc9 by Tommy Webb at 2023-02-02T23:24:52+00:00
Bug 40536: Wait until Tor is connected to process intents
(cherry picked from commit 667092ef6caed0c7524e4cd717079bd159a556dd)
- - - - -
2 changed files:
- app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
Changes:
=====================================
app/src/main/java/org/mozilla/fenix/HomeActivity.kt
=====================================
@@ -129,6 +129,7 @@ import org.mozilla.fenix.tabstray.TabsTrayFragment
import org.mozilla.fenix.tabstray.TabsTrayFragmentDirections
import org.mozilla.fenix.theme.DefaultThemeManager
import org.mozilla.fenix.theme.ThemeManager
+import org.mozilla.fenix.tor.TorEvents
import org.mozilla.fenix.trackingprotection.TrackingProtectionPanelDialogFragmentDirections
import org.mozilla.fenix.utils.BrowsersCache
import org.mozilla.fenix.utils.Settings
@@ -533,6 +534,24 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
* Handles intents received when the activity is open.
*/
final override fun onNewIntent(intent: Intent?) {
+ if (intent?.action == ACTION_MAIN || components.torController.isConnected) {
+ onNewIntentInternal(intent)
+ } else {
+ // Wait until Tor is connected to handle intents from external apps for links, search, etc.
+ components.torController.registerTorListener(object : TorEvents {
+ override fun onTorConnected() {
+ components.torController.unregisterTorListener(this)
+ onNewIntentInternal(intent)
+ }
+ override fun onTorConnecting() { /* no-op */ }
+ override fun onTorStopped() { /* no-op */ }
+ override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
+ })
+ return
+ }
+ }
+
+ private fun onNewIntentInternal(intent: Intent?) {
super.onNewIntent(intent)
intent?.let {
handleNewIntent(it)
@@ -1092,13 +1111,16 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
/**
* Indicates if the user should be redirected to the [BrowserFragment] or to the [HomeFragment],
- * links from an external apps should always opened in the [BrowserFragment].
+ * links from an external apps should always opened in the [BrowserFragment],
+ * unless Tor is not yet connected.
*/
fun shouldStartOnHome(intent: Intent? = this.intent): Boolean {
return components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
// We only want to open on home when users tap the app,
- // we want to ignore other cases when the app gets open by users clicking on links.
- getSettings().shouldStartOnHome() && intent?.action == ACTION_MAIN
+ // we want to ignore other cases when the app gets open by users clicking on links,
+ // unless Tor is not yet connected.
+ getSettings().shouldStartOnHome() && (intent?.action == ACTION_MAIN ||
+ !components.torController.isConnected)
}
}
=====================================
app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
=====================================
@@ -6,6 +6,7 @@ package org.mozilla.fenix
import android.app.Activity
import android.content.Intent
+import android.content.Intent.ACTION_MAIN
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
@@ -24,6 +25,7 @@ import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.perf.MarkersActivityLifecycleCallbacks
import org.mozilla.fenix.perf.StartupTimeline
import org.mozilla.fenix.shortcut.NewTabShortcutIntentProcessor
+import org.mozilla.fenix.tor.TorEvents
/**
* Processes incoming intents and sends them to the corresponding activity.
@@ -45,7 +47,23 @@ class IntentReceiverActivity : Activity() {
// the HomeActivity.
val intent = intent?.let { Intent(it) } ?: Intent()
intent.sanitize().stripUnwantedFlags()
- processIntent(intent)
+ if (intent.action == ACTION_MAIN || components.torController.isConnected) {
+ processIntent(intent)
+ } else {
+ // Wait until Tor is connected to handle intents from external apps for links, search, etc.
+ components.torController.registerTorListener(object : TorEvents {
+ override fun onTorConnected() {
+ components.torController.unregisterTorListener(this)
+ processIntent(intent)
+ }
+ override fun onTorConnecting() { /* no-op */ }
+ override fun onTorStopped() { /* no-op */ }
+ override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
+ })
+
+ // In the meantime, open the HomeActivity so the user can get connected.
+ processIntent(Intent())
+ }
components.core.engine.profiler?.addMarker(
MarkersActivityLifecycleCallbacks.MARKER_NAME, startTimeProfiler, "IntentReceiverActivity.onCreate"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/25e5afc9e6e85…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/25e5afc9e6e85…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.2.1-12.5-1 at The Tor Project / Applications / fenix
Commits:
667092ef by Tommy Webb at 2023-02-02T23:23:07+00:00
Bug 40536: Wait until Tor is connected to process intents
- - - - -
2 changed files:
- app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
Changes:
=====================================
app/src/main/java/org/mozilla/fenix/HomeActivity.kt
=====================================
@@ -129,6 +129,7 @@ import org.mozilla.fenix.tabstray.TabsTrayFragment
import org.mozilla.fenix.tabstray.TabsTrayFragmentDirections
import org.mozilla.fenix.theme.DefaultThemeManager
import org.mozilla.fenix.theme.ThemeManager
+import org.mozilla.fenix.tor.TorEvents
import org.mozilla.fenix.trackingprotection.TrackingProtectionPanelDialogFragmentDirections
import org.mozilla.fenix.utils.BrowsersCache
import org.mozilla.fenix.utils.Settings
@@ -533,6 +534,24 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
* Handles intents received when the activity is open.
*/
final override fun onNewIntent(intent: Intent?) {
+ if (intent?.action == ACTION_MAIN || components.torController.isConnected) {
+ onNewIntentInternal(intent)
+ } else {
+ // Wait until Tor is connected to handle intents from external apps for links, search, etc.
+ components.torController.registerTorListener(object : TorEvents {
+ override fun onTorConnected() {
+ components.torController.unregisterTorListener(this)
+ onNewIntentInternal(intent)
+ }
+ override fun onTorConnecting() { /* no-op */ }
+ override fun onTorStopped() { /* no-op */ }
+ override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
+ })
+ return
+ }
+ }
+
+ private fun onNewIntentInternal(intent: Intent?) {
super.onNewIntent(intent)
intent?.let {
handleNewIntent(it)
@@ -1092,13 +1111,16 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
/**
* Indicates if the user should be redirected to the [BrowserFragment] or to the [HomeFragment],
- * links from an external apps should always opened in the [BrowserFragment].
+ * links from an external apps should always opened in the [BrowserFragment],
+ * unless Tor is not yet connected.
*/
fun shouldStartOnHome(intent: Intent? = this.intent): Boolean {
return components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
// We only want to open on home when users tap the app,
- // we want to ignore other cases when the app gets open by users clicking on links.
- getSettings().shouldStartOnHome() && intent?.action == ACTION_MAIN
+ // we want to ignore other cases when the app gets open by users clicking on links,
+ // unless Tor is not yet connected.
+ getSettings().shouldStartOnHome() && (intent?.action == ACTION_MAIN ||
+ !components.torController.isConnected)
}
}
=====================================
app/src/main/java/org/mozilla/fenix/IntentReceiverActivity.kt
=====================================
@@ -6,6 +6,7 @@ package org.mozilla.fenix
import android.app.Activity
import android.content.Intent
+import android.content.Intent.ACTION_MAIN
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
@@ -24,6 +25,7 @@ import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.perf.MarkersActivityLifecycleCallbacks
import org.mozilla.fenix.perf.StartupTimeline
import org.mozilla.fenix.shortcut.NewTabShortcutIntentProcessor
+import org.mozilla.fenix.tor.TorEvents
/**
* Processes incoming intents and sends them to the corresponding activity.
@@ -45,7 +47,23 @@ class IntentReceiverActivity : Activity() {
// the HomeActivity.
val intent = intent?.let { Intent(it) } ?: Intent()
intent.sanitize().stripUnwantedFlags()
- processIntent(intent)
+ if (intent.action == ACTION_MAIN || components.torController.isConnected) {
+ processIntent(intent)
+ } else {
+ // Wait until Tor is connected to handle intents from external apps for links, search, etc.
+ components.torController.registerTorListener(object : TorEvents {
+ override fun onTorConnected() {
+ components.torController.unregisterTorListener(this)
+ processIntent(intent)
+ }
+ override fun onTorConnecting() { /* no-op */ }
+ override fun onTorStopped() { /* no-op */ }
+ override fun onTorStatusUpdate(entry: String?, status: String?) { /* no-op */ }
+ })
+
+ // In the meantime, open the HomeActivity so the user can get connected.
+ processIntent(Intent())
+ }
components.core.engine.profiler?.addMarker(
MarkersActivityLifecycleCallbacks.MARKER_NAME, startTimeProfiler, "IntentReceiverActivity.onCreate"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/667092ef6caed…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/commit/667092ef6caed…
You're receiving this email because of your account on gitlab.torproject.org.