From 4d8139e1ab8371e43d32a3cc65a57314e088f68e Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 9 Jul 2014 01:53:49 -0400 Subject: [PATCH] this fixes #50 --- js/contentscript-end.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/contentscript-end.js b/js/contentscript-end.js index 052165440..e120fcb2b 100644 --- a/js/contentscript-end.js +++ b/js/contentscript-end.js @@ -302,6 +302,8 @@ var cosmeticFiltering = (function() { } }; + // TODO: split back into to specialized functions as it was before. Too + // many code paths creeped back, I thought I could get rid of most. var selectorsFromNodeList = function(nodes) { if ( !nodes || !nodes.length ) { return; @@ -323,7 +325,12 @@ var cosmeticFiltering = (function() { continue; } // id - v = nodes[i].id.trim(); + v = nodes[i].id; + // quite unlikely, so no need to be fancy + if ( typeof v !== 'string' ) { + v = ''; + } + v = v.trim(); if ( v !== '' ) { v = '#' + v; if ( !qq[v] ) {