Allow data URLs for toolbar icons

The autoIcon function now immediately returns the icon URL if it
begins with "data:".

Bug: T27223
Change-Id: Ib62f1f50f612ddae9b5f8fb4a6b59863a6da3c98
This commit is contained in:
Alexander Jones 2019-08-04 19:30:55 -05:00
parent 2075d6d2dc
commit 05a6e4e6a6

View file

@ -193,6 +193,12 @@
key = fallbackChain[ i ];
if ( icon && hasOwn.call( icon, key ) ) {
src = icon[ key ];
// Return a data URL immediately
if ( src.substr( 0, 5 ) === 'data:' ) {
return src;
}
// Prepend path if src is not absolute
if ( src.substr( 0, 7 ) !== 'http://' && src.substr( 0, 8 ) !== 'https://' && src[ 0 ] !== '/' ) {
src = path + src;