diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index bbe74f7807f4..d62e726859cb 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -921,8 +921,8 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U - Brave is made available to you under the <a target="_blank" href="$1">Mozilla Public License 2.0</a> (MPL) and includes <a target="_blank" href="$2">open source software</a> under a variety of other licenses. - You can read <a target="_blank" href="$3">instructions on how to download and build for yourself</a> the specific <a target="_blank" href="$4">source code used to create this copy</a>. + Brave is made available to you under the <a target="_blank" rel="noopener noreferrer" href="$1">Mozilla Public License 2.0</a> (MPL) and includes <a target="_blank" rel="noopener noreferrer" href="$2">open source software</a> under a variety of other licenses. + You can read <a target="_blank" rel="noopener noreferrer" href="$3">instructions on how to download and build for yourself</a> the specific <a target="_blank" rel="noopener noreferrer" href="$4">source code used to create this copy</a>. diff --git a/app/brave_strings.grd b/app/brave_strings.grd index cec930467acb..4d3bb1bdd4fc 100644 --- a/app/brave_strings.grd +++ b/app/brave_strings.grd @@ -277,10 +277,10 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> - Chrome OS is made possible by additional <a target="_blank" href="$1">open source software</a>. + Chrome OS is made possible by additional <a target="_blank" rel="noopener noreferrer" href="$1">open source software</a>. - Chrome OS is made possible by additional <a target="_blank" href="$1">open source software</a>, as is <a target="_blank" href="$2">Linux (Beta)</a>. + Chrome OS is made possible by additional <a target="_blank" rel="noopener noreferrer" href="$1">open source software</a>, as is <a target="_blank" rel="noopener noreferrer" href="$2">Linux (Beta)</a>. Not used in Brave. Placeholder to keep resource maps in sync. diff --git a/app/extensions_strings.grdp b/app/extensions_strings.grdp index 60e4857ac3ab..47efd2a881ab 100644 --- a/app/extensions_strings.grdp +++ b/app/extensions_strings.grdp @@ -312,7 +312,7 @@ No recent activities - Find extensions and themes in the <a target="_blank" href="https://chrome.google.com/webstore/category/extensions">Web Store</a></a> + Find extensions and themes in the <a target="_blank" rel="noopener noreferrer" href="https://chrome.google.com/webstore/category/extensions">Web Store</a></a> No description provided diff --git a/app/extensions_strings_override.grdp b/app/extensions_strings_override.grdp index f4370aff5991..bab37ac8a0e1 100644 --- a/app/extensions_strings_override.grdp +++ b/app/extensions_strings_override.grdp @@ -14,7 +14,7 @@ Web Store - Find extensions and themes in the <a target="_blank" href="https://chrome.google.com/webstore/category/extensions">Web Store</a></a> + Find extensions and themes in the <a target="_blank" rel="noopener noreferrer" href="https://chrome.google.com/webstore/category/extensions">Web Store</a></a> Open Web Store diff --git a/app/generated_resources.grd b/app/generated_resources.grd index 83f8dcb765b5..999dcf6c5261 100644 --- a/app/generated_resources.grd +++ b/app/generated_resources.grd @@ -6091,7 +6091,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Clear browsing data - The selected data has been removed from Brave and synced devices. Your Brave sync chain may have other forms of browsing history like searches and activity from other Brave services at <a target="_blank" href="$1">myactivity.google.com</a>. + The selected data has been removed from Brave and synced devices. Your Brave sync chain may have other forms of browsing history like searches and activity from other Brave services at <a target="_blank" rel="noopener noreferrer" href="$1">myactivity.google.com</a>. Cleared Brave data @@ -6101,7 +6101,7 @@ Keep your key file in a safe place. You will need it to create new versions of y - We were not able to delete all passwords stored in your Brave sync chain. Try again or visit <a target="_blank" href="$1">passwords.google.com</a>. + We were not able to delete all passwords stored in your Brave sync chain. Try again or visit <a target="_blank" rel="noopener noreferrer" href="$1">passwords.google.com</a>. Some passwords were not deleted @@ -7183,10 +7183,10 @@ Keep your key file in a safe place. You will need it to create new versions of y - Your <a target="_blank" href="$1">$2Bravebook is managed</a> by your organization + Your <a target="_blank" rel="noopener noreferrer" href="$1">$2Bravebook is managed</a> by your organization - Your <a target="_blank" href="$1">$2Bravebook is managed</a> by $3example.com + Your <a target="_blank" rel="noopener noreferrer" href="$1">$2Bravebook is managed</a> by $3example.com @@ -9356,7 +9356,7 @@ Please help our engineers fix this problem. Tell us what happened right before y - Documents are <a is="action-link" href="https://support.google.com/cloudprint/answer/2541843" target="_blank">sent to Brave</a> to prepare them for printing. View, edit and manage your printers and printer history on the <a is="action-link" href="https://www.google.com/cloudprint#jobs" target="_blank">Google Cloud Print dashboard</a>. + Documents are <a is="action-link" href="https://support.google.com/cloudprint/answer/2541843" target="_blank" rel="noopener noreferrer">sent to Brave</a> to prepare them for printing. View, edit and manage your printers and printer history on the <a is="action-link" href="https://www.google.com/cloudprint#jobs" target="_blank" rel="noopener noreferrer">Google Cloud Print dashboard</a>. diff --git a/app/os_settings_strings.grdp b/app/os_settings_strings.grdp index 2b924d93bb1e..b21200b5ec4a 100644 --- a/app/os_settings_strings.grdp +++ b/app/os_settings_strings.grdp @@ -21,11 +21,11 @@ {NUM_DAYS, plural, - =1 {{1}example.com requires you to back up your data and return this {2}Bravebook today.<a target="_blank" href="{3}https://google.com/">See details</a>} - other {{1}example.com requires you to back up your data and return this {2}Bravebook within {NUM_DAYS} days.<a target="_blank" href="{3}https://google.com/">See details</a>}} + =1 {{1}example.com requires you to back up your data and return this {2}Bravebook today.<a target="_blank" rel="noopener noreferrer" href="{3}https://google.com/">See details</a>} + other {{1}example.com requires you to back up your data and return this {2}Bravebook within {NUM_DAYS} days.<a target="_blank" rel="noopener noreferrer" href="{3}https://google.com/">See details</a>}} - $1example.com requires you to back up your data and return this $2Bravebook within 1 week.<a target="_blank" href="$3https://google.com/">See details</a> + $1example.com requires you to back up your data and return this $2Bravebook within 1 week.<a target="_blank" rel="noopener noreferrer" href="$3https://google.com/">See details</a> @@ -161,13 +161,13 @@ Your $1Bravebook is up to date - This device will get automatic software and security updates until $1September 2020. <a target="_blank" href="$2https://google.com/">Learn more</a> + This device will get automatic software and security updates until $1September 2020. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> - This device stopped getting automatic software and security updates in $1September 2020. <a target="_blank" href="$2https://google.com/">Learn more</a> + This device stopped getting automatic software and security updates in $1September 2020. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> - This is the last automatic software and security update for this $1Bravebook. To get future updates, upgrade to a newer model. <a target="_blank" href="$2https://google.com/">Learn more</a> + This is the last automatic software and security update for this $1Bravebook. To get future updates, upgrade to a newer model. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> @@ -267,7 +267,7 @@ Languages you read - Add and order languages you read. Apps and websites will be displayed in the most preferred language available. <a target="_blank" href="$1">Learn more</a> + Add and order languages you read. Apps and websites will be displayed in the most preferred language available. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> Translation suggestion @@ -547,10 +547,10 @@ Select $1Brave Photos albums - Relive your favorite memories. To add or edit albums, go to<a target="_blank" href="$1https://google.com/">Brave Photos</a>. + Relive your favorite memories. To add or edit albums, go to<a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Brave Photos</a>. - No albums. Create an album in<a target="_blank" href="$1https://google.com/">Brave Photos</a>. + No albums. Create an album in<a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Brave Photos</a>. Your best photos, selected automatically @@ -1309,7 +1309,7 @@ Reserve size - A factory reset of this Bravebook is required to enable ADB debugging. <a target="_blank" href="$1">Learn more</a> + A factory reset of this Bravebook is required to enable ADB debugging. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> To enable ADB debugging, a restart of this $1Bravebook is required. Disabling it requires a reset to factory settings. @@ -1318,7 +1318,7 @@ Disabling ADB debugging will reset this $1Bravebook to factory settings. All user accounts and local data will be erased. - Run Linux tools, editors, and IDEs on your $1Bravebook. <a target="_blank" href="$2https://google.com/">Learn more</a> + Run Linux tools, editors, and IDEs on your $1Bravebook. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> Remove Linux for $1Bravebook @@ -2039,13 +2039,13 @@ This network is shared with you. - This network is not synced to your account. <a target="_blank" href="$1https://google.com/">Learn more</a> + This network is not synced to your account. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> - Synced with other devices on your account. Settings modified by other users will not be synced. <a target="_blank" href="$1https://google.com/">Learn more</a> + Synced with other devices on your account. Settings modified by other users will not be synced. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> - Synced with other devices on your account. <a target="_blank" href="$1https://google.com/">Learn more</a> + Synced with other devices on your account. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> Network out of range @@ -2120,7 +2120,7 @@ Connect - Looking for a mobile network. <a target="_blank" href="$1">Learn more</a> + Looking for a mobile network. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> @@ -2184,7 +2184,7 @@ Messages - Send and receive text messages from your $1Bravebook. <a target="_blank" href="$2https://google.com/">Learn more</a> + Send and receive text messages from your $1Bravebook. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> Phone Hub @@ -2273,16 +2273,16 @@ Disconnect - Connect your $1Bravebook with your phone. <a target="_blank" href="$2https://google.com/">Learn more</a> + Connect your $1Bravebook with your phone. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> - No eligible devices. <a target="_blank" href="$1https://google.com/">Learn more</a> + No eligible devices. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> - Waiting for verification. <a target="_blank" href="$1https://google.com/">Learn more</a> + Waiting for verification. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> - Unlock your $1Bravebook with your phone. <a target="_blank" href="$2https://google.com/">Learn more</a> + Unlock your $1Bravebook with your phone. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> Lock screen from sleep mode @@ -2421,7 +2421,7 @@ Valid for $17 hours 12 minutes - Choose a ticket to use for authentication. <a target="_blank" href="$1https://google.com/">Learn more</a> + Choose a ticket to use for authentication. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> Kerberos tickets @@ -2929,7 +2929,7 @@ Android settings - Install apps and games from Google Play on your $1Bravebook. <a target="_blank" href="$2https://google.com/">Learn more</a> + Install apps and games from Google Play on your $1Bravebook. <a target="_blank" rel="noopener noreferrer" href="$2https://google.com/">Learn more</a> @@ -3031,7 +3031,7 @@ External storage preferences - Apps from Google Play may require full file system access to read and write files on external storage devices. Files and folders created on the device are visible to anyone who uses the external drive. <a target="_blank" href="$1https://google.com/">Learn more</a> + Apps from Google Play may require full file system access to read and write files on external storage devices. Files and folders created on the device are visible to anyone who uses the external drive. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> Available devices will appear here. diff --git a/app/settings_brave_strings.grdp b/app/settings_brave_strings.grdp index 5d00f7d2a8cd..6281788287f9 100644 --- a/app/settings_brave_strings.grdp +++ b/app/settings_brave_strings.grdp @@ -57,7 +57,7 @@ No saved passwords. Brave can check your passwords when you save them. - Brave can't check your passwords. Try again after 24 hours or <a href="$1" target="_blank">check passwords in your Brave sync chain</a>. + Brave can't check your passwords. Try again after 24 hours or <a href="$1" target="_blank" rel="noopener noreferrer">check passwords in your Brave sync chain</a>. Brave can't check your passwords. Try again after 24 hours. @@ -118,7 +118,7 @@ Brave can't check for updates. Try checking your internet connection. - Brave didn't update, something went wrong. <a target="_blank" href="$1">Fix Brave update problems and failed updates.</a> + Brave didn't update, something went wrong. <a target="_blank" rel="noopener noreferrer" href="$1">Fix Brave update problems and failed updates.</a> Brave version $115.0.865.0 is installed @@ -213,6 +213,6 @@ - Help make Brave better by reporting the <a is="action-link" target="_blank">current settings</a> + Help make Brave better by reporting the <a is="action-link" target="_blank" rel="noopener noreferrer">current settings</a> diff --git a/app/settings_strings.grdp b/app/settings_strings.grdp index f9c90ebc8f18..aaeaebd0d069 100644 --- a/app/settings_strings.grdp +++ b/app/settings_strings.grdp @@ -180,7 +180,7 @@ Search settings - Go to <a target="_blank" href="$1">Brave help</a> if you can't find what you're looking for + Go to <a target="_blank" rel="noopener noreferrer" href="$1">Brave help</a> if you can't find what you're looking for Settings @@ -273,7 +273,7 @@ Edit card - To add or manage Brave Pay payment methods, visit your <a href="$1" target="_blank">Brave sync chain</a> + To add or manage Brave Pay payment methods, visit your <a href="$1" target="_blank" rel="noopener noreferrer">Brave sync chain</a> This card will be saved to this device only @@ -561,19 +561,19 @@ Save all your passwords in your Brave sync chain, so you can use them on all your devices - View and manage saved passwords in your <a is="action-link" href="$1" target="_blank">Brave sync chain</a> + View and manage saved passwords in your <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">Brave sync chain</a> View and manage saved passwords in your Brave sync chain - You can also show passwords from your <a is="action-link" href="$1" target="_blank">Brave sync chain</a> here + You can also show passwords from your <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">Brave sync chain</a> here Show - Showing passwords from your <a is="action-link" href="$1" target="_blank">Brave sync chain</a> + Showing passwords from your <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">Brave sync chain</a> Remove from device @@ -858,16 +858,16 @@ Time range - To clear browsing data from this device only, while keeping it in your Brave sync chain, <a href="#" target="_blank">sign out</a>. + To clear browsing data from this device only, while keeping it in your Brave sync chain, <a href="#" target="_blank" rel="noopener noreferrer">sign out</a>. - To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank">visit sync settings</a>. + To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank" rel="noopener noreferrer">visit sync settings</a>. - To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank">enter your passphrase</a>. + To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank" rel="noopener noreferrer">enter your passphrase</a>. - To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank">sign in</a>. + To clear browsing data from all of your synced devices and your Brave sync chain, <a href="#" target="_blank" rel="noopener noreferrer">sign in</a>. Browsing history @@ -955,7 +955,7 @@ Google Cloud Print will no longer be supported after December 31 - Google Cloud Print will no longer be supported after December 31. <a target="_blank" href="$1">Learn more</a> + Google Cloud Print will no longer be supported after December 31. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> Google Cloud Print will no longer be supported after December 31. Contact your administrator. @@ -1207,7 +1207,7 @@ Updates - Updates are managed by <a target="_blank" href="$1">your administrator</a> + Updates are managed by <a target="_blank" rel="noopener noreferrer" href="$1">your administrator</a> Passwords @@ -1231,7 +1231,7 @@ Enhanced Protection is on - <a target="_blank" href="$1">Your administrator</a> has turned off Safe Browsing + <a target="_blank" rel="noopener noreferrer" href="$1">Your administrator</a> has turned off Safe Browsing An extension has turned off Safe Browsing @@ -1355,7 +1355,7 @@ Do Not Track - Enabling "Do Not Track" means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. For example, some websites may respond to this request by showing you ads that aren't based on other websites you've visited. Many websites will still collect and use your browsing data - for example to improve security, to provide content, services, ads and recommendations on their websites, and to generate reporting statistics. <a target="_blank" href="$1">Learn more</a></a> + Enabling "Do Not Track" means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. For example, some websites may respond to this request by showing you ads that aren't based on other websites you've visited. Many websites will still collect and use your browsing data - for example to improve security, to provide content, services, ads and recommendations on their websites, and to generate reporting statistics. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a></a> Permissions and content settings @@ -1403,7 +1403,7 @@ With - See this provider's <a target="_blank" href="$1https://google.com/">privacy policy</a> + See this provider's <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">privacy policy</a> This setting is disabled on managed browsers @@ -1519,7 +1519,7 @@ Search engine - Search engine used in the <a target="_blank" href="$1">address bar</a> + Search engine used in the <a target="_blank" rel="noopener noreferrer" href="$1">address bar</a> Manage search engines @@ -1963,10 +1963,10 @@ Your Flash settings will be kept until you quit Brave. - Settings with "*" wildcards are no longer supported. Contact the extension developer or your administrator to <a is="action-link" href="$1" target="_blank">change these settings</a>. + Settings with "*" wildcards are no longer supported. Contact the extension developer or your administrator to <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">change these settings</a>. - Settings with "*" wildcards are no longer supported. Contact your administrator to <a is="action-link" href="$1" target="_blank">change these settings</a>. + Settings with "*" wildcards are no longer supported. Contact your administrator to <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">change these settings</a>. Allow recently closed sites to finish sending and receiving data @@ -2129,7 +2129,7 @@ Additional content settings - To change this setting, first <a target="_blank" href="$1">turn on identifiers</a> + To change this setting, first <a target="_blank" rel="noopener noreferrer" href="$1">turn on identifiers</a> Allowlisted internally @@ -2452,7 +2452,7 @@ Sign in - Because this account is managed by $1example.com, your bookmarks, history, passwords, and other settings will be cleared from this device. However, your data will remain stored in your Brave sync chain and can be managed on <a href="$2" target="_blank"><a href="$2" target="_blank">Brave Dashboard</a></a>. + Because this account is managed by $1example.com, your bookmarks, history, passwords, and other settings will be cleared from this device. However, your data will remain stored in your Brave sync chain and can be managed on <a href="$2" target="_blank" rel="noopener noreferrer"><a href="$2" target="_blank">Brave Dashboard</a></a>. Edit profile @@ -2480,7 +2480,7 @@ - Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Brave sync chain. However, your existing data will remain stored in your Brave sync chain and can be managed on <a href="$1" target="_blank"><a href="$1" target="_blank">Brave Dashboard</a></a>. + Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Brave sync chain. However, your existing data will remain stored in your Brave sync chain and can be managed on <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">Brave Dashboard</a></a>. This will sign you out of your Brave sync chains. Your bookmarks, history, passwords, and more will no longer be synced. @@ -2507,19 +2507,19 @@ Manage synced data on Brave Dashboard - Encrypt synced data with your own <a href="$1" target="_blank"><a href="$1" target="_blank">sync passphrase</a></a>. This doesn't include payment methods and addresses from Brave Pay. + Encrypt synced data with your own <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">sync passphrase</a></a>. This doesn't include payment methods and addresses from Brave Pay. - Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting, you'll need to <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a>. + Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting, you'll need to <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a>. - To change this setting, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase + To change this setting, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase - To turn this on, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase + To turn this on, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase - If you forgot your passphrase or want to change this setting, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a>. + If you forgot your passphrase or want to change this setting, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a>. Control how your browsing history is used to personalize Search, ads, and more @@ -2771,7 +2771,7 @@ other {To ensure that you can keep browsing the web, ask your administrator to remove these applications.}} - <a target="_blank" href="$1">Learn how to update applications</a> + <a target="_blank" rel="noopener noreferrer" href="$1">Learn how to update applications</a> {NUM_APLLICATIONS, plural, diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd index 2f8c0a5e2771..23c331da46bd 100644 --- a/browser/ui/android/strings/android_chrome_strings.grd +++ b/browser/ui/android/strings/android_chrome_strings.grd @@ -756,7 +756,7 @@ For example, some websites may respond to this request by showing you ads that a Choose another provider - See this provider's <a target="_blank" href="$1https://google.com/">privacy policy</a> + See this provider's <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">privacy policy</a> This setting is disabled on managed browsers @@ -2109,11 +2109,6 @@ To change this setting, <resetlink>reset sync

- - - Drag from top and touch the back button to exit full screen. - - Download complete diff --git a/components/components_brave_strings.grd b/components/components_brave_strings.grd index da1558908f83..f7752c69bc1f 100644 --- a/components/components_brave_strings.grd +++ b/components/components_brave_strings.grd @@ -278,7 +278,7 @@ - Brave is made possible by the <a target="_blank" href="$1">Brave</a> open source project and other <a target="_blank" href="$2">open source software</a>. + Brave is made possible by the <a target="_blank" rel="noopener noreferrer" href="$1">Brave</a> open source project and other <a target="_blank" rel="noopener noreferrer" href="$2">open source software</a>. diff --git a/components/history_strings.grdp b/components/history_strings.grdp index 31f8d27b584f..4cf1903e48fa 100644 --- a/components/history_strings.grdp +++ b/components/history_strings.grdp @@ -40,7 +40,7 @@ Found $1 search results$2 for '$3' - Your Brave sync chain may have other forms of browsing history at <a target="_blank" href="$1">myactivity.google.com</a> + Your Brave sync chain may have other forms of browsing history at <a target="_blank" rel="noopener noreferrer" href="$1">myactivity.google.com</a> Loading... diff --git a/components/management_ios_strings.grdp b/components/management_ios_strings.grdp new file mode 100644 index 000000000000..119bfde070ca --- /dev/null +++ b/components/management_ios_strings.grdp @@ -0,0 +1,17 @@ + + + + + + Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Brave. + + + Learn More + + + Your browser is managed by your administrator. + + + Your browser is not managed. + + diff --git a/components/management_strings.grdp b/components/management_strings.grdp index 4839377ac706..f902136c2046 100644 --- a/components/management_strings.grdp +++ b/components/management_strings.grdp @@ -47,10 +47,10 @@ - Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> + Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Brave. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> - This browser is not managed by a company or other organization. Activity on this device may be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> + This browser is not managed by a company or other organization. Activity on this device may be managed outside of Brave. <a target="_blank" rel="noopener noreferrer" href="$1">Learn more</a> @@ -125,7 +125,7 @@ Which Google Play apps you have installed - Your administrator has allowed $1Plugin VM to collect diagnostics data to improve the product experience. See <a target="_blank" href="https://www.parallels.com/pcep">https://www.parallels.com/pcep</a> for more information. + Your administrator has allowed $1Plugin VM to collect diagnostics data to improve the product experience. See <a target="_blank" rel="noopener noreferrer" href="https://www.parallels.com/pcep">https://www.parallels.com/pcep</a> for more information. @@ -177,7 +177,7 @@ Which extensions and plugins you have installed - <a target="_blank" href="$1"><a target="_blank" href="https://example.com">Safe Browsing</a></a> warnings + <a target="_blank" rel="noopener noreferrer" href="$1"><a target="_blank" href="https://example.com">Safe Browsing</a></a> warnings Websites you visit and time spent on them diff --git a/components/security_interstitials_strings.grdp b/components/security_interstitials_strings.grdp index 0615a627cfe3..52b7a971e4d3 100644 --- a/components/security_interstitials_strings.grdp +++ b/components/security_interstitials_strings.grdp @@ -359,7 +359,7 @@ <h4>Step 1: Sign in to the portal</h4> <p>Wi-Fi networks at places like cafes or airports need you to sign in. To see the sign-in page, visit a page that uses <code>http://</code>.</p> <ol> - <li>Go to any website starting with <code>http://</code>, like <a href="http://example.com" target="_blank">http://example.com</a>.</li> + <li>Go to any website starting with <code>http://</code>, like <a href="http://example.com" target="_blank" rel="noopener noreferrer">http://example.com</a>.</li> <li>On the sign-in page that opens, sign in to use the internet.</li> </ol> <h4>Step 2: Open the page in Private mode (computer only)</h4> diff --git a/components/security_interstitials_strings_override.grdp b/components/security_interstitials_strings_override.grdp index 4c5774033454..00ecf9e0447a 100644 --- a/components/security_interstitials_strings_override.grdp +++ b/components/security_interstitials_strings_override.grdp @@ -36,7 +36,7 @@ <h4>Step 1: Sign in to the portal</h4> <p>Wi-Fi networks at places like cafes or airports need you to sign in. To see the sign-in page, visit a page that uses <code>http://</code>.</p> <ol> - <li>Go to any website starting with <code>http://</code>, like <a href="http://example.com" target="_blank">http://example.com</a>.</li> + <li>Go to any website starting with <code>http://</code>, like <a href="http://example.com" target="_blank" rel="noopener noreferrer">http://example.com</a>.</li> <li>On the sign-in page that opens, sign in to use the internet.</li> </ol> <h4>Step 2: Open the page in Private mode (computer only)</h4> diff --git a/components/sms_strings.grdp b/components/sms_strings.grdp new file mode 100644 index 000000000000..28e04bd70692 --- /dev/null +++ b/components/sms_strings.grdp @@ -0,0 +1,15 @@ + + + + + Verify your phone number + + + + $1123 is your code for $2example.com + + + + Verify + + diff --git a/components/sync_ui_strings.grdp b/components/sync_ui_strings.grdp index 29421e9b78cb..86203e79d1f0 100644 --- a/components/sync_ui_strings.grdp +++ b/components/sync_ui_strings.grdp @@ -54,10 +54,10 @@ Sync is not available for your domain - Your data was encrypted with your <a target="_blank" href="$1">sync passphrase</a> on $2Sept 1, 2012. Enter it to start sync. + Your data was encrypted with your <a target="_blank" rel="noopener noreferrer" href="$1">sync passphrase</a> on $2Sept 1, 2012. Enter it to start sync. - Your data was encrypted with your <a target="_blank" href="$1">Brave password</a> as of $2Sept 1, 2012. Enter it to start sync. + Your data was encrypted with your <a target="_blank" rel="noopener noreferrer" href="$1">Brave password</a> as of $2Sept 1, 2012. Enter it to start sync. diff --git a/script/chromium-rebase-l10n.py b/script/chromium-rebase-l10n.py index 94e7b04ad462..969c33555c0f 100644 --- a/script/chromium-rebase-l10n.py +++ b/script/chromium-rebase-l10n.py @@ -6,9 +6,13 @@ import sys from lxml import etree from lib.config import get_env_var -from lib.grd_string_replacements import (write_xml_file_from_tree, write_braveified_grd_override, - update_braveified_grd_tree_override, get_override_file_path) -from lib.transifex import pull_source_files_from_transifex, textify +from lib.grd_string_replacements import (write_xml_file_from_tree, + write_braveified_grd_override, + update_braveified_grd_tree_override, + get_override_file_path) +from lib.transifex import (fix_links_with_target_blank, + pull_source_files_from_transifex, + textify) SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) @@ -20,6 +24,7 @@ def parse_args(): def generate_overrides_and_replace_strings(source_string_path): + fix_links_with_target_blank(source_string_path) original_xml_tree_with_branding_fixes = etree.parse(source_string_path) update_braveified_grd_tree_override(original_xml_tree_with_branding_fixes, True) write_braveified_grd_override(source_string_path) diff --git a/script/lib/transifex.py b/script/lib/transifex.py index 0e8d54ed664d..d2424bc82ec5 100644 --- a/script/lib/transifex.py +++ b/script/lib/transifex.py @@ -1,6 +1,8 @@ from hashlib import md5 from lib.config import get_env_var -from lib.grd_string_replacements import generate_braveified_node, get_override_file_path +from lib.grd_string_replacements import (generate_braveified_node, + get_override_file_path, + write_xml_file_from_tree) from xml.sax.saxutils import escape, unescape from collections import defaultdict import HTMLParser @@ -22,6 +24,10 @@ 'brave_extension', 'rewards_extension' ] +# List of HTML tags that we allowed to be present inside the translated text. +allowed_html_tags = [ + 'a', 'abbr', 'b', 'br', 'code', 'h4', 'learnmore', 'li', 'ol', 'p', 'span', 'strong', 'ul' +] def transifex_name_from_filename(source_file_path, filename): @@ -168,13 +174,159 @@ def fixup_bad_ph_tags_from_raw_transifex_string(xml_content): return xml_content +def validate_elements_tags(elements): + """Recursively validates elements for being in the allow list""" + errors = None + for element in elements: + if element.tag not in allowed_html_tags: + error = ("ERROR: Element <{0}> is not allowed.\n").format(element.tag) + errors = (errors or '') + error + if element.tag == 'a' and element.get('target') == '_blank': + rel = element.get('rel') or '' + if rel.find('noopener') == -1 or rel.find('noreferrer') == -1: + error = ("ERROR: Element with target=\"_blank\" must set " + "rel=\"noopener noreferrer\"\n") + errors = (errors or '') + error + rec_errors = validate_elements_tags(list(element)) + if rec_errors is not None: + errors = (errors or '') + rec_errors + return errors + + +def validate_tags_in_one_string(string_tag): + """Validates that all child elements of a are allowed""" + lxml.etree.strip_elements(string_tag, 'ex', with_tail=False) + lxml.etree.strip_tags(string_tag, 'ph') + string_text = textify_from_transifex(string_tag) + string_text = (string_text.replace('<', '<') + .replace('>', '>')) + # print 'Validating: {}'.format(string_text.encode('utf-8')) + try: + string_xml = lxml.etree.fromstring('' + string_text + '') + except lxml.etree.XMLSyntaxError as e: + errors = ("\n--------------------\n" + "{0}\nERROR: {1}\n").format(string_text, str(e)) + print errors + cont = raw_input('Enter C to ignore and continue. Enter anything else to exit : ') + if cont == 'C' or cont == 'c': + return None + return errors + errors = validate_elements_tags(list(string_xml)) + if errors is not None: + errors = ("--------------------\n" + "{0}\n").format( + lxml.etree.tostring( + string_tag, method='xml', encoding='utf-8', pretty_print=True) + ) + errors + return errors + + +def validate_tags_in_transifex_strings(xml_content): + """Validates that all child elements of all s are allowed""" + xml = lxml.etree.fromstring(xml_content) + string_tags = xml.findall('.//string') + # print 'Validating HTML tags in {} strings'.format(len(string_tags)) + errors = None + for string_tag in string_tags: + error = validate_tags_in_one_string(string_tag) + if error is not None: + errors = (errors or '') + error + if errors is not None: + errors = ("\n") + errors + return errors + + +def fix_links_with_target_blank_in_ph_text(text): + """A containing a link usually only has part of the element, so + we can't convert it to proper xml and instead try to add rel attribute + via string search""" + target = text.find('target="_blank"') + if target == -1: + return text + target += 15 + rel = text.find('rel="') + if rel == -1: + return text[:target] + ' rel="noopener noreferrer"' + text[target:] + + rel += 5 + rel_end = text[rel:].find('"') + rel_value = text[rel:rel_end] + rel_add = '' + if rel_value.find('noopener') == -1: + rel_add = 'noopener ' + if rel_value.find('noreferrer') == -1: + rel_add = rel_add + 'noreferrer ' + return text[:rel] + rel_add + text[rel:] + + +def fix_links_with_target_blank_in_text(text): + """Process element text for embedded elements""" + if text.find('target="_blank"') == -1: + return text + xml_text = (text.replace('<', '<').replace('>', '>')) + try: + xml_elem = lxml.etree.fromstring('' + xml_text + '') + except lxml.etree.XMLSyntaxError as e: + print ("\n--------------------\n" + "{0}\nERROR: {1}\n").format(xml_text.encode('utf-8'), str(e)) + cont = raw_input('Enter C to ignore and continue. Enter anything else to exit : ') + if cont == 'C' or cont == 'c': + return text + raise + a_tags = xml_elem.findall('.//a') + for a_tag in a_tags: + if a_tag.get('target') == '_blank': + rel = a_tag.get('rel') or '' + if rel.find('noopener') == -1: + a_tag.set('rel', rel + (' noopener' if len(rel) else 'noopener')) + if rel.find('noreferrer') == -1: + a_tag.set('rel', a_tag.get('rel') + ' noreferrer') + new_text = lxml.etree.tostring(xml_elem, method='xml', encoding='unicode') + new_text = new_text[new_text.index('>')+1:new_text.rindex('<')] + return new_text + + +def fix_links_with_target_blank_in_element(elem): + """Recursively process text, tail and children of an element for embedded + elements and process them""" + if elem.text: + if elem.tag == 'ph': + elem.text = fix_links_with_target_blank_in_ph_text(elem.text) + else: + elem.text = fix_links_with_target_blank_in_text(elem.text) + if elem.tail: + if elem.tag == 'ph': + elem.tail = fix_links_with_target_blank_in_ph_text(elem.tail) + else: + elem.tail = fix_links_with_target_blank_in_text(elem.tail) + for child in elem: + if child.tag != 'ex': + fix_links_with_target_blank_in_element(child) + + +def fix_links_with_target_blank(source_string_path): + """Takes in a grd(p) path, finds all tags with target _blank and makes + sure they have rel attribute with noopener and noreferrer values""" + source_xml_tree = lxml.etree.parse(source_string_path) + for elem in source_xml_tree.xpath('//message'): + fix_links_with_target_blank_in_element(elem) + write_xml_file_from_tree(source_string_path, source_xml_tree) + + +def fix_links_with_target_blank_in_xtb_tree(xtb_tree): + """Takes in an xtb tree, finds all tags with target _blank and makes + sure they have rel attribute with noopener and noreferrer values""" + for elem in xtb_tree.xpath('//translation'): + fix_links_with_target_blank_in_element(elem) + + def trim_ph_tags_in_xtb_file_content(xml_content): - """Removes all children of tags including $X and %X text inside ph tag""" + """Removes all children of tags including text inside ph tag""" xml = lxml.etree.fromstring(xml_content) phs = xml.findall('.//ph') for ph in phs: - lxml.etree.strip_elements(ph, '*', with_tail=False) - if ph.text is not None and (ph.text.startswith('$') or ph.text.startswith('%')): + lxml.etree.strip_elements(ph, '*') + if ph.text is not None: ph.text = '' return lxml.etree.tostring(xml) @@ -345,7 +497,7 @@ def is_translateable_string(grd_file_path, message_tag): return False -def get_grd_strings(grd_file_path): +def get_grd_strings(grd_file_path, validate_tags=True): """Obtains a tubple of (name, value, FP) for each string in a GRD file""" strings = [] # Keep track of duplicate mesasge_names @@ -365,6 +517,10 @@ def get_grd_strings(grd_file_path): # The only thing that matters is the fingerprint string hash. if dupe_dict[message_name] > 1: message_name += "_%s" % dupe_dict[message_name] + if validate_tags: + message_xml = lxml.etree.tostring(message_tag, method='xml', encoding='utf-8') + errors = validate_tags_in_one_string(lxml.etree.fromstring(message_xml)) + assert errors is None, '\n' + errors message_desc = message_tag.get('desc') or '' message_value = textify(message_tag) assert not not message_name, 'Message name is empty' @@ -662,6 +818,8 @@ def pull_source_files_from_transifex(source_file_path, filename): xml_content = get_transifex_translation_file_content( source_file_path, filename, lang_code) xml_content = fixup_bad_ph_tags_from_raw_transifex_string(xml_content) + errors = validate_tags_in_transifex_strings(xml_content) + assert errors is None, errors xml_content = trim_ph_tags_in_xtb_file_content(xml_content) translations = get_strings_dict_from_xml_content(xml_content) xtb_content = generate_xtb_content(lang_code, grd_strings, @@ -750,8 +908,8 @@ def pull_xtb_without_transifex(grd_file_path, brave_source_root): chromium_grd_base_path = os.path.dirname(chromium_grd_file_path) # Update XTB FPs so it uses the branded source string - grd_strings = get_grd_strings(grd_file_path) - chromium_grd_strings = get_grd_strings(chromium_grd_file_path) + grd_strings = get_grd_strings(grd_file_path, validate_tags=False) + chromium_grd_strings = get_grd_strings(chromium_grd_file_path, validate_tags=False) assert(len(grd_strings) == len(chromium_grd_strings)) fp_map = {chromium_grd_strings[idx][2]: grd_strings[idx][2] for @@ -782,7 +940,7 @@ def pull_xtb_without_transifex(grd_file_path, brave_source_root): # A node's fingerprint changes if the desc or the meaning change if (pre_text_node != textify(node) or pre_meaning != meaning or - pre_desc == desc): + pre_desc != desc): old_fp = node.attrib['id'] # It's possible for an xtb string to not be in our GRD # This happens for exmaple with Chrome OS strings which @@ -791,6 +949,7 @@ def pull_xtb_without_transifex(grd_file_path, brave_source_root): if old_fp in fp_map: node.attrib['id'] = fp_map.get(old_fp) + fix_links_with_target_blank_in_xtb_tree(xml_tree) transformed_content = ('\n' + lxml.etree.tostring(xml_tree, pretty_print=True, xml_declaration=False,