-
Notifications
You must be signed in to change notification settings - Fork 974
do not allow emojis for page title in titlemode #10051
Comments
We are showing punycode (ex: the domain still has the |
i'm a fan of erring on the safe side and not allowing emoji to show up in titleMode. @bradleyrichter thoughts? |
I agree. Sounds messy and problematic. |
how-to stepsfor the person interested: we render the title for titleMode in urlBar component, most precisely in this line. A safe way to solve this is to install the
you can check our const emojiRegex = require('emoji-regex') Then still in get titleValue () {
// For about:newtab we don't want the top of the browser saying New Tab
// Instead just show "Brave"
return ['about:blank', 'about:newtab'].includes(this.props.urlbarLocation)
? '' : this.props.title // HERE'S OUR HERO!!
} See that the else condition in the above ternary? You can make use of the get titleValue () {
// For about:newtab we don't want the top of the browser saying New Tab
// Instead just show "Brave"
const title =
return ['about:blank', 'about:newtab'].includes(this.props.urlbarLocation)
- ? '' : this.props.title
+ ? '' : this.props.title.replace(emojiRegex(), '')
} ensure to run our app again and test http://xn--https-5w14d.cf/paypal.com/ to see if you still see that golden evil lock emoji. Don't you? We're waiting for your PR! |
I am interested to fix this bug. |
hy @cezaraugusto how to enable the title mode in brave?? |
hello @cezaraugusto , I have sent a PR . Kindly have a look at it. |
hy @cezaraugusto , my pr does not pass the travis test cases.. can you help me to fix the issue ? |
@prasanthp96 currently there are some travis tests which consistently fail (we are trying to fix them all). If you see that your change does not break another test, then please leave the change as it is. If you cannot tell, please ping @cezaraugusto for audit :-) |
Works as expected |
Test plan
Original issue description
result:
cc @diracdeltas
The text was updated successfully, but these errors were encountered: