diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index ab022214fef..712779b1496 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -686,7 +686,7 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U IPFS public gateway fallback - Automatically fallback to IPFS public gateway when failed to access through the local node. + Automatically fallback to IPFS public gateway when the local node cannot be accessed. Uses Hangouts component to enable screen sharing and other features in the browser. diff --git a/components/ipfs/browser/ipfs_navigation_throttle.cc b/components/ipfs/browser/ipfs_navigation_throttle.cc index 076a5f4f949..6897db61c9f 100644 --- a/components/ipfs/browser/ipfs_navigation_throttle.cc +++ b/components/ipfs/browser/ipfs_navigation_throttle.cc @@ -95,7 +95,8 @@ IpfsNavigationThrottle::WillStartRequest() { return content::NavigationThrottle::PROCEED; } - bool is_local_mode = pref_service_->FindPreference(kIPFSResolveMethod) && + bool is_local_mode = + pref_service_->FindPreference(kIPFSResolveMethod) && pref_service_->GetInteger(kIPFSResolveMethod) == static_cast(ipfs::IPFSResolveMethodTypes::IPFS_LOCAL); @@ -170,8 +171,7 @@ void IpfsNavigationThrottle::LoadPublicGatewayURL() { if (!web_contents) return; - const GURL url = IpfsUtils::ToPublicGatewayURL( - navigation_handle()->GetURL()); + const GURL url = IpfsUtils::ToPublicGatewayURL(navigation_handle()->GetURL()); if (url.is_empty()) return; diff --git a/components/ipfs/browser/ipfs_navigation_throttle_unittest.cc b/components/ipfs/browser/ipfs_navigation_throttle_unittest.cc index ae81f787186..b579cf9ebe2 100644 --- a/components/ipfs/browser/ipfs_navigation_throttle_unittest.cc +++ b/components/ipfs/browser/ipfs_navigation_throttle_unittest.cc @@ -45,10 +45,9 @@ const GURL& GetIPFSURL() { } const GURL& GetIPNSURL() { - static const GURL - ipns_url( - "http://localhost:8080/ipns/tr.wikipedia-on-ipfs.org/wiki/" - "Anasayfa.html"); // NOLINT + static const GURL ipns_url( + "http://localhost:8080/ipns/tr.wikipedia-on-ipfs.org/wiki/" + "Anasayfa.html"); // NOLINT return ipns_url; } diff --git a/components/ipfs/browser/ipfs_not_connected_page.h b/components/ipfs/browser/ipfs_not_connected_page.h index 72523bbaacf..00adb0815f7 100644 --- a/components/ipfs/browser/ipfs_not_connected_page.h +++ b/components/ipfs/browser/ipfs_not_connected_page.h @@ -23,6 +23,11 @@ class SecurityInterstitialControllerClient; namespace ipfs { +// IPFSNotConnectedPage is the interstitial page which will be shown when the +// browser failed to access IPFS contents through the local node due to no +// connected peers or it fails to start the daemon during page load. A proceed +// button is provided in the page to turn on the setting for automatically +// fallback to the public gateway in these cases. class IPFSNotConnectedPage : public security_interstitials::SecurityInterstitialPage { public: diff --git a/components/ipfs/common/ipfs_utils.cc b/components/ipfs/common/ipfs_utils.cc index 63749923de0..46ffc84e6b7 100644 --- a/components/ipfs/common/ipfs_utils.cc +++ b/components/ipfs/common/ipfs_utils.cc @@ -46,7 +46,7 @@ GURL IpfsUtils::ToPublicGatewayURL(const GURL& url) { DCHECK(IsIPFSScheme(url) || IsIPFSURL(url)); GURL new_url; - // For ipfs/ipfs schemes, use TranslateIPFSURI directly. + // For ipfs/ipns schemes, use TranslateIPFSURI directly. if (IsIPFSScheme(url) && TranslateIPFSURI(url, &new_url, false)) { return new_url; } diff --git a/components/resources/ipfs_strings.grdp b/components/resources/ipfs_strings.grdp index ddbed5c1379..3a68fcc059b 100644 --- a/components/resources/ipfs_strings.grdp +++ b/components/resources/ipfs_strings.grdp @@ -31,7 +31,7 @@ Hide Advanced - We cannot connect to the requested content using the local IPFS node at the moment because the local node doesn't seem to start or there are no connected peers available at the moment. By proceeding we will automatically fallback to the default public gateway in the future when we cannot connect to IPFS contents using the local IPFS node, this could be turned off later in settings. + We cannot connect to the requested content using the local IPFS node because the local node didn't start or because there are no connected peers available at the moment. By proceeding, we will automatically fallback to the default public gateway in the future when we cannot connect to IPFS content using the local IPFS node. This can be turned off later in settings.