Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: composer.postload.js

Issue 29356630: Issue 4330 - Avoid suggesting huge URL filters (Closed)
Patch Set: Check src length in content script Created Oct. 14, 2016, 4:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: composer.postload.js
diff --git a/composer.postload.js b/composer.postload.js
index dcf808b85a786c809b788926ef26aa8e03bf11b1..77fe8c911ea9d2585da4a5d9cbb15161d114841d 100644
--- a/composer.postload.js
+++ b/composer.postload.js
@@ -42,12 +42,13 @@ let lastRightClickEventIsMostRecent = false;
function getFiltersForElement(element, callback)
{
+ let src = element.getAttribute("src");
ext.backgroundPage.sendMessage(
{
type: "composer.getFilters",
tagName: element.localName,
id: element.id,
- src: element.getAttribute("src"),
+ src: src && src.length < 1000 && src,
Sebastian Noack 2016/10/14 17:32:32 This expression is quite weird. Besides that it is
kzar 2016/10/14 17:48:58 Yea you're right, it was pretty weird to be fair :
style: element.getAttribute("style"),
classes: Array.prototype.slice.call(element.classList),
urls: getURLsFromElement(element),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld