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: Changed crazy logic Created Oct. 14, 2016, 5:47 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..2baaf758030673f62af50c2756046f7e43e0d809 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 : null,
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