diff --git a/src/js/scriptlets/element-picker.js b/src/js/scriptlets/element-picker.js index 5a5ae00d7..b48c41e79 100644 --- a/src/js/scriptlets/element-picker.js +++ b/src/js/scriptlets/element-picker.js @@ -336,18 +336,21 @@ var backgroundImageURLFromElement = function(elem) { /******************************************************************************/ +// https://github.com/gorhill/uBlock/issues/1725#issuecomment-226479197 +// Limit returned string to 2048 characters. + var resourceURLFromElement = function(elem) { var tagName = elem.localName, s; if ( (s = netFilter1stSources[tagName]) ) { s = elem[s]; if ( typeof s === 'string' && s !== '' ) { - return s; + return s.slice(0, 2048); } } if ( (s = netFilter2ndSources[tagName]) ) { s = elem[s]; if ( typeof s === 'string' && s !== '' ) { - return s; + return s.slice(0, 2048); } } return backgroundImageURLFromElement(elem);